Go to the documentation of this file.
21 #ifndef AVFILTER_FRAMESYNC_H
22 #define AVFILTER_FRAMESYNC_H
297 #define FRAMESYNC_DEFINE_PURE_CLASS(name, desc, func_prefix, options) \
298 static const AVClass name##_class = { \
299 .class_name = desc, \
300 .item_name = av_default_item_name, \
302 .version = LIBAVUTIL_VERSION_INT, \
303 .category = AV_CLASS_CATEGORY_FILTER, \
304 .child_class_iterate = ff_framesync_child_class_iterate, \
305 .child_next = func_prefix##_child_next, \
311 #define FRAMESYNC_AUXILIARY_FUNCS(func_prefix, context, field) \
312 static int func_prefix##_framesync_preinit(AVFilterContext *ctx) \
314 context *s = ctx->priv; \
315 ff_framesync_preinit(&s->field); \
318 static void *func_prefix##_child_next(void *obj, void *prev) \
321 return prev ? NULL : &s->field; \
324 #define FRAMESYNC_DEFINE_CLASS_EXT(name, context, field, options) \
325 FRAMESYNC_AUXILIARY_FUNCS(name, context, field) \
326 FRAMESYNC_DEFINE_PURE_CLASS(name, #name, name, options)
328 #define FRAMESYNC_DEFINE_CLASS(name, context, field) \
329 FRAMESYNC_DEFINE_CLASS_EXT(name, context, field, name##_options)
AVRational time_base
Time base for the incoming frames.
unsigned in_request
Index of the input that requires a request.
AVRational time_base
Time base for the output events.
int64_t pts
PTS of the current frame.
This structure describes decoded (raw) audio or video data.
unsigned sync_level
Synchronization level: only inputs with the same sync level are sync sources.
uint8_t frame_ready
Flag indicating that a frame event is ready.
@ EXT_INFINITY
Extend the frame to infinity.
int ff_framesync_init(FFFrameSync *fs, AVFilterContext *parent, unsigned nb_in)
Initialize a frame sync structure.
AVFilterContext * parent
Parent filter context.
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
uint8_t state
State: before first, in stream or after EOF, for internal use.
@ EXT_STOP
Completely stop all streams with this one.
FFFrameSyncExtMode
This API is intended as a helper for filters that have several video input and need to combine them s...
int(* on_event)(struct FFFrameSync *fs)
Callback called when a frame event is ready.
AVFrame * frame
Current frame, may be NULL before the first one or after EOF.
@ EXT_NULL
Ignore this stream and continue processing the other ones.
unsigned sync
Synchronization level: frames on input at the highest sync level will generate output frame events.
int64_t pts_next
PTS of the next frame, for internal use.
static void get(uint8_t *pixels, int stride, int16_t *block)
FFFrameSyncIn * in
Pointer to array of inputs.
Describe the class of an AVClass context structure.
#define fs(width, name, subs,...)
Rational number (pair of numerator and denominator).
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
Same as ff_framesync_dualinput_get(), but make sure that f0 is writable.
int64_t pts
Timestamp of the current event.
void * opaque
Opaque pointer, not used by the API.
uint8_t eof
Flag indicating that output has reached EOF.
uint8_t have_next
Boolean flagging the next frame, for internal use.
AVFrame * frame_next
Next frame, for internal use.
enum FFFrameSyncExtMode before
Extrapolation mode for timestamps before the first frame.
int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
const AVClass * ff_framesync_child_class_iterate(void **iter)
void ff_framesync_preinit(FFFrameSync *fs)
Pre-initialize a frame sync structure.
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
enum FFFrameSyncExtMode after
Extrapolation mode for timestamps after the last frame.
unsigned nb_in
Number of input streams.