Go to the documentation of this file.
157 .parent_log_context_offset = offsetof(
DecoderPriv, log_parent),
207 const int sr =
frame->sample_rate;
217 if (prev / gcd >= INT_MAX / sr) {
219 "Audio timestamps cannot be represented exactly after "
220 "sample rate change: %d -> %d\n", prev, sr);
229 if (
frame->time_base.num == 1 &&
frame->time_base.den > tb_new.
den &&
230 !(
frame->time_base.den % tb_new.
den))
231 tb_new =
frame->time_base;
260 frame->pts = pts_pred;
261 frame->time_base = tb;
270 tb,
frame->nb_samples,
280 frame->time_base = tb_filter;
301 const int duration_unreliable =
frame->duration == 1 && ts_diff > 2 *
frame->duration;
305 (
frame->duration > 0 && !ts_unreliable && !duration_unreliable))
306 return frame->duration;
317 if (codec_duration > 0 && ts_unreliable)
318 return codec_duration;
326 if (
frame->duration > 0)
327 return frame->duration;
328 if (codec_duration > 0)
329 return codec_duration;
364 "output frame: %d.\n", err);
386 unsigned *outputs_mask)
422 "decoder -> pts:%s pts_time:%s "
423 "pkt_dts:%s pkt_dts_time:%s "
424 "duration:%s duration_time:%s "
425 "keyframe:%d frame_type:%d time_base:%d/%d\n",
449 *outputs_mask = (uintptr_t)
frame->opaque;
458 .format =
src->format,
459 .start_display_time =
src->start_display_time,
460 .end_display_time =
src->end_display_time,
472 for (
int i = 0;
i <
src->num_rects;
i++) {
486 dst_rect->
x = src_rect->
x;
487 dst_rect->
y = src_rect->
y;
488 dst_rect->
w = src_rect->
w;
489 dst_rect->
h = src_rect->
h;
504 for (
int j = 0; j < 4; j++) {
512 if (!src_rect->
data[j])
555 sub =
av_memdup(subtitle,
sizeof(*subtitle));
558 memset(subtitle, 0,
sizeof(*subtitle));
586 if (end < sub_prev->end_display_time) {
588 "Subtitle duration reduced from %"PRId32
" to %d%s\n",
590 end <= 0 ?
", dropping it" :
"");
625 !prev_subtitle->
num_rects || signal_pts <= prev_subtitle->
pts)
634 subtitle->pts = signal_pts;
730 "This is a bug, please report it.\n");
747 unsigned outputs_mask = 1;
760 }
else if (
ret < 0) {
772 "corrupt decoded frame\n");
799 "Error while processing the decoded data\n");
812 outputs_mask &= ~(1
U <<
pos);
848 memset(&o, 0,
sizeof(o));
872 char name[16] =
"dec";
890 memset(dt, 0,
sizeof(*dt));
895 memset(dt, 0,
sizeof(*dt));
916 int ret = 0, input_status = 0;
924 while (!input_status) {
925 int flush_buffers, have_data;
928 have_data = input_status >= 0 &&
932 flush_buffers = input_status >= 0 && !have_data;
935 flush_buffers ?
"flush" :
"EOF");
941 if (input_status < 0) {
943 "Cannot initialize a standalone decoder\n");
968 flush_buffers ?
"resetting" :
"finishing");
980 }
else if (
ret < 0) {
1016 }
else if (err_rate)
1030 unsigned out_idx = 0;
1040 "Manually selecting views with -view_ids cannot be combined "
1041 "with view selection via stream specifiers. It is strongly "
1042 "recommended you always use stream specifiers only.\n");
1091 unsigned views_wanted = 0;
1093 unsigned nb_view_ids_av, nb_view_ids;
1094 unsigned *view_ids_av =
NULL, *view_pos_av =
NULL;
1095 int *view_ids =
NULL;
1113 "Multiview decoding requested, but decoder '%s' does not "
1118 if (nb_view_ids_av) {
1119 unsigned nb_view_pos_av;
1121 if (nb_view_ids_av >=
sizeof(views_wanted) * 8) {
1127 view_ids_av =
av_calloc(nb_view_ids_av,
sizeof(*view_ids_av));
1141 if (
ret >= 0 && nb_view_pos_av == nb_view_ids_av) {
1142 view_pos_av =
av_calloc(nb_view_ids_av,
sizeof(*view_pos_av));
1157 view_ids_av =
av_calloc(nb_view_ids_av,
sizeof(*view_ids_av));
1158 view_pos_av =
av_calloc(nb_view_ids_av,
sizeof(*view_pos_av));
1159 if (!view_ids_av || !view_pos_av) {
1182 if (vs->
val >= nb_view_ids_av) {
1184 "View with index %u requested, but only %u views available "
1185 "in current video sequence (more views may or may not be "
1186 "available in later sequences).\n",
1187 vs->
val, nb_view_ids_av);
1195 views_wanted |= 1
U << vs->
val;
1202 for (
unsigned j = 0; j < nb_view_ids_av; j++) {
1203 if (view_ids_av[j] == vs->
val) {
1210 "View with ID %u requested, but is not available "
1211 "in the video sequence\n", vs->
val);
1219 views_wanted |= 1
U << view_idx;
1227 for (
unsigned j = 0; view_pos_av && j < nb_view_ids_av; j++) {
1228 if (view_pos_av[j] == vs->
val) {
1235 "View position '%s' requested, but is not available "
1244 views_wanted |= 1
U << view_idx;
1250 views_wanted |= (1
U << nb_view_ids_av) - 1;
1258 if (!views_wanted) {
1272 for (
unsigned i = 0;
i < nb_view_ids;
i++) {
1277 views_wanted &= ~(1
U <<
pos);
1279 view_ids[
i] = view_ids_av[
pos];
1310 "is not recommended, use view specifiers instead\n");
1337 for (
int i = 0;;
i++) {
1344 if (
config->pix_fmt == *p)
1364 int view_id = sd ? *(
int*)sd->
data : 0;
1381 for (
int i = 0;;
i++) {
1395 const char *hwaccel_device)
1400 int err, auto_device = 0;
1402 if (hwaccel_device) {
1421 "specified for decoder: device %s of type %s is not "
1422 "usable with hwaccel %s.\n", dev->
name,
1463 for (
int i = 0; !dev;
i++) {
1471 "hwaccel type %s with existing device %s.\n",
1475 for (
int i = 0; !dev;
i++) {
1487 if (hwaccel_device) {
1489 "hwaccel type %s with new device created "
1494 "hwaccel type %s with new default device.\n",
1502 "disabled: no device found.\n");
1510 "for decoder: device type %s needed for codec %s.\n",
1579 "Hardware device setup failed for decoder: %s\n",
1680 int of_index, ost_index;
1700 of_index = strtol(
arg, &p, 0);
1707 ost_index = strtol(p + 1,
NULL, 0);
1708 if (ost_index < 0 || ost_index >= of->
nb_streams) {
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
const uint8_t * subtitle_header
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
@ AV_ROUND_UP
Round toward +infinity.
AVCodecParameters * par_enc
static int copy_av_subtitle(AVSubtitle *dst, const AVSubtitle *src)
#define stdc_trailing_zeros(value)
static int fix_sub_duration_heartbeat(DecoderPriv *dp, int64_t signal_pts)
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
AVPixelFormat
Pixel format.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static AVCodecContext * dec_ctx
static const AVClass dec_class
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
Callback to negotiate the pixel format.
struct DecoderPriv::@5 * views_requested
enum AVColorSpace colorspace
YUV colorspace type.
int check_avoptions(AVDictionary *m)
int sample_rate
samples per second
int64_t last_frame_duration_est
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
static AVRational audio_samplerate_update(DecoderPriv *dp, const AVFrame *frame)
@ DECODER_FLAG_SEND_END_TS
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AVERROR_EOF
End of file.
uint8_t * data
The data buffer.
static void dec_thread_uninit(DecThreadContext *dt)
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static int dec_alloc(DecoderPriv **pdec, Scheduler *sch, int send_end_ts)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
static HWDevice * hw_device_match_by_codec(const AVCodec *codec)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
void * opaque
Frame owner's private data.
enum AVColorSpace colorspace
YUV colorspace type.
This structure describes decoded (raw) audio or video data.
static av_cold void cleanup(FlashSV2Context *s)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
@ DECODER_FLAG_FRAMERATE_FORCED
const AVCodecParameters * par
static const char * dec_item_name(void *obj)
static int dec_thread_init(DecThreadContext *dt)
enum AVHWDeviceType hwaccel_device_type
enum AVPixelFormat hwaccel_output_format
enum HWAccelID hwaccel_id
uint8_t * subtitle_header
#define AV_LOG_VERBOSE
Detailed information.
int multiview_user_config
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
@ VIEW_SPECIFIER_TYPE_ALL
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
enum HWAccelID hwaccel_id
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
@ AV_STEREO3D_VIEW_UNSPEC
Content is unspecified.
int enc_loopback(Encoder *enc)
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void dec_free(Decoder **pdec)
#define DEFAULT_FRAME_THREAD_QUEUE_SIZE
Default size of a frame thread queue.
int av_frame_apply_cropping(AVFrame *frame, int flags)
Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields.
int64_t av_gcd(int64_t a, int64_t b)
Compute the greatest common divisor of two integer operands.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
enum AVPixelFormat hwaccel_output_format
#define AV_CODEC_FLAG_COPY_OPAQUE
@ FRAME_OPAQUE_SUB_HEARTBEAT
const struct AVCodec * codec
AVBufferRef * opaque_ref
AVBufferRef for free use by the API user.
AVChannelLayout ch_layout
Audio channel layout.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
int x
top left corner of pict, undefined when pict is not set
@ AV_FRAME_CROP_UNALIGNED
Apply the maximum possible cropping, even if it requires setting the AVFrame.data[] entries to unalig...
@ VIEW_SPECIFIER_TYPE_POS
int flags
AV_CODEC_FLAG_*.
void update_benchmark(const char *fmt,...)
AVChannelLayout ch_layout
Channel layout of the audio data.
static int multiview_setup(DecoderPriv *dp, AVCodecContext *dec_ctx)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
char * ass
0 terminated ASS/SSA compatible event line.
const char * av_stereo3d_view_name(unsigned int view)
Provide a human-readable name of a given stereo3d view.
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int(* get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags)
This callback is called at the beginning of each frame to get data buffer(s) for it.
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
Decode a subtitle message.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
Create a standalone decoder.
static int hwaccel_retrieve_data(AVCodecContext *avctx, AVFrame *input)
#define FF_ARRAY_ELEMS(a)
AVDictionary * codec_opts
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
This struct describes the properties of a single codec described by an AVCodecID.
AVRational sample_aspect_ratio
Video only.
static int subtitle_wrap_frame(AVFrame *frame, AVSubtitle *subtitle, int copy)
int y
top left corner of pict, undefined when pict is not set
@ VIEW_SPECIFIER_TYPE_NONE
int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static enum AVPixelFormat pix_fmts[]
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int sch_dec_send(Scheduler *sch, unsigned dec_idx, unsigned out_idx, AVFrame *frame)
Called by decoder tasks to send a decoded frame downstream.
int av_opt_get_array_size(void *obj, const char *name, int search_flags, unsigned int *out_val)
For an array-type option, get the number of elements in the array.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int64_t pts
Same as packet pts, in AV_TIME_BASE.
int av_opt_set_array(void *obj, const char *name, int search_flags, unsigned int start_elem, unsigned int nb_elems, enum AVOptionType val_type, const void *val)
Add, replace, or remove elements for an array option.
int64_t last_filter_in_rescale_delta
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
#define stdc_count_ones(value)
void * opaque
for some private data of the user
char * text
0 terminated plain UTF-8 text
#define SCH_DEC_IN(decoder)
int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb)
Rescale a timestamp while preserving known durations.
static int get_buffer(AVCodecContext *dec_ctx, AVFrame *frame, int flags)
static int video_frame_process(DecoderPriv *dp, AVFrame *frame, unsigned *outputs_mask)
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the then the processing requires a frame on this link and the filter is expected to make efforts in that direction The status of input links is stored by the fifo and status_out fields
static void audio_ts_process(DecoderPriv *dp, AVFrame *frame)
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int avcodec_parameters_to_context(AVCodecContext *codec, const struct AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
int w
width of pict, undefined when pict is not set
int dec_request_view(Decoder *d, const ViewSpecifier *vs, SchedulerNode *src)
static int hw_device_setup_for_decode(DecoderPriv *dp, const AVCodec *codec, const char *hwaccel_device)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
int apply_cropping
Video decoding only.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts, const DecoderOpts *o, AVFrame *param_out)
static void dec_thread_set_name(const DecoderPriv *dp)
int hw_device_init_from_type(enum AVHWDeviceType type, const char *device, HWDevice **dev_out)
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Rational number (pair of numerator and denominator).
static int transcode_subtitles(DecoderPriv *dp, const AVPacket *pkt, AVFrame *frame)
int subtitle_header_size
Header containing style information for text subtitles.
uint8_t * data[4]
data+linesize for the bitmap of this subtitle.
int sch_add_dec(Scheduler *sch, SchThreadFunc func, void *ctx, int send_end_ts)
Add a decoder to the scheduler.
int64_t wallclock[LATENCY_PROBE_NB]
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
int av_opt_get_array(void *obj, const char *name, int search_flags, unsigned int start_elem, unsigned int nb_elems, enum AVOptionType out_type, void *out_val)
For an array-type option, retrieve the values of one or more array elements.
@ AV_OPT_TYPE_UINT
Underlying C type is unsigned int.
@ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
The codec supports this format via the hw_device_ctx interface.
enum AVPixelFormat hwaccel_pix_fmt
@ DECODER_FLAG_FIX_SUB_DURATION
int last_frame_sample_rate
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static void copy(const float *p1, float *p2, const int length)
int extra_hw_frames
Video decoding only.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
struct DecoderPriv::@7 standalone_init
int dec_init(Decoder **pdec, Scheduler *sch, AVDictionary **dec_opts, const DecoderOpts *o, AVFrame *param_out)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
OutputFile ** output_files
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
int sample_rate
Sample rate of the audio data.
enum AVSampleFormat sample_fmt
audio sample format
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed.
#define AV_NOPTS_VALUE
Undefined timestamp value.
AVRational time_base
Time base for the timestamps in this frame.
HWDevice * hw_device_get_by_type(enum AVHWDeviceType type)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
FrameData * frame_data(AVFrame *frame)
Get our axiliary frame data attached to the frame, allocating it if needed.
uint32_t end_display_time
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
static void multiview_check_manual(DecoderPriv *dp, const AVDictionary *dec_opts)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
@ SUBTITLE_BITMAP
A bitmap, pict will be set.
#define AV_LOG_INFO
Standard information.
@ AV_FRAME_DATA_VIEW_ID
This side data must be associated with a video frame.
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
static int64_t video_duration_estimate(const DecoderPriv *dp, const AVFrame *frame)
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static int process_subtitle(DecoderPriv *dp, AVFrame *frame)
#define AV_FRAME_FLAG_CORRUPT
The frame data may be corrupted, e.g.
int nb_colors
number of colors in pict, undefined when pict is not set
SpecifierOptList codec_names
int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
Set all the options from a given dictionary on an object.
#define AV_TIME_BASE
Internal time base represented as integer.
struct DecoderPriv::@6 * view_map
static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
#define av_malloc_array(a, b)
#define SCH_DEC_OUT(decoder, out_idx)
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Name of the codec implementation.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void * av_calloc(size_t nmemb, size_t size)
int sch_connect(Scheduler *sch, SchedulerNode src, SchedulerNode dst)
int64_t frame_num
Frame counter, set by libavcodec.
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
int h
height of pict, undefined when pict is not set
int sch_dec_receive(Scheduler *sch, unsigned dec_idx, AVPacket *pkt)
Called by decoder tasks to receive a packet for decoding.
#define FFSWAP(type, a, b)
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal codec state / flush internal buffers.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
@ VIEW_SPECIFIER_TYPE_IDX
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes,...
void * opaque
Private data of the user, can be used to carry app specific stuff.
@ DECODER_FLAG_TOP_FIELD_FIRST
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags)
Copy data to or from a hw surface.
int dec_filter_add(Decoder *d, InputFilter *ifilter, InputFilterOptions *opts, const ViewSpecifier *vs, SchedulerNode *src)
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
main external API structure.
@ PKT_OPAQUE_SUB_HEARTBEAT
static DecoderPriv * dp_from_dec(Decoder *d)
@ AV_OPT_TYPE_INT
Underlying C type is int.
static char * output_format
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
#define GROW_ARRAY(array, nb_elems)
const AVCodecHWConfig * avcodec_get_hw_config(const AVCodec *codec, int index)
Retrieve supported hardware configurations for a codec.
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
#define AVERROR_DECODER_NOT_FOUND
Decoder not found.
enum AVMediaType codec_type
char * av_strdup(const char *s)
Duplicate a string.
enum ViewSpecifierType type
A reference to a data buffer.
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
@ DECODER_FLAG_TS_UNRELIABLE
Structure to hold side data for an AVFrame.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static int decoder_thread(void *arg)
int sch_add_dec_output(Scheduler *sch, unsigned dec_idx)
Add another output to decoder (e.g.
#define FFMPEG_ERROR_RATE_EXCEEDED
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
FrameData * packet_data(AVPacket *pkt)
int width
picture width / height.
#define flags(name, subs,...)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
static void subtitle_free(void *opaque, uint8_t *data)
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
HWDevice * hw_device_get_by_name(const char *name)
@ PKT_OPAQUE_FIX_SUB_DURATION
enum AVHWDeviceType hwaccel_device_type
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.
AVRational time_base
Time base of the packet's timestamps.
static int dec_standalone_open(DecoderPriv *dp, const AVPacket *pkt)
static int ff_thread_setname(const char *name)