Go to the documentation of this file.
19 #ifndef AVCODEC_BSF_PACKETSYNC_H
20 #define AVCODEC_BSF_PACKETSYNC_H
311 #define PACKETSYNC_DEFINE_PURE_CLASS(name, desc, func_prefix, options) \
312 static const AVClass name##_class = { \
313 .class_name = desc, \
314 .item_name = av_default_item_name, \
316 .version = LIBAVUTIL_VERSION_INT, \
317 .category = AV_CLASS_CATEGORY_BITSTREAM_FILTER, \
318 .child_class_iterate = ff_packetsync_child_class_iterate, \
319 .child_next = func_prefix##_child_next, \
325 #define PACKETSYNC_AUXILIARY_FUNCS(func_prefix, context, field) \
326 static int func_prefix##_packetsync_preinit(AVBitStreamFilterContext *ctx) \
328 context *s = ctx->priv_data; \
329 ff_packetsync_preinit(&s->field); \
332 static void *func_prefix##_child_next(void *obj, void *prev) \
335 return prev ? NULL : &s->field; \
338 #define PACKETSYNC_DEFINE_CLASS_EXT(name, context, field, options) \
339 PACKETSYNC_AUXILIARY_FUNCS(name, context, field) \
340 PACKETSYNC_DEFINE_PURE_CLASS(name, #name, name, options)
342 #define PACKETSYNC_DEFINE_CLASS(name, context, field) \
343 PACKETSYNC_DEFINE_CLASS_EXT(name, context, field, name##_options)
FFPacketSyncIn * in
Pointer to array of inputs.
enum FFPacketSyncExtMode before
Extrapolation mode for timestamps before the first packet.
AVPacket * pkt
Current packet, may be NULL before the first one or after EOF.
int ff_packetsync_dualinput_get(FFPacketSync *fs, AVPacket **f0, AVPacket **f1)
@ EXT_NULL
Ignore this stream and continue processing the other ones.
AVPacket * pkt_next
Next packet, for internal use.
@ EXT_STOP
Completely stop all streams with this one.
enum FFPacketSyncExtMode after
Extrapolation mode for timestamps after the last packet.
void * opaque
Opaque pointer, not used by the API.
int64_t pts
Timestamp of the current event.
int ff_packetsync_configure(FFPacketSync *fs)
Configure a packet sync structure.
@ TS_NEAREST
Sync to packets from secondary input with the absolute nearest timestamp to the packet event one.
uint8_t state
State: before first, in stream or after EOF, for internal use.
void ff_packetsync_preinit(FFPacketSync *fs)
Pre-initialize a packet sync structure.
int64_t pts_next
PTS of the next packet, for internal use.
Describe the class of an AVClass context structure.
FFPacketSyncExtMode
This API is intended as a helper for filters that have several video input and need to combine them s...
#define fs(width, name, subs,...)
Rational number (pair of numerator and denominator).
const AVClass ff_packetsync_class
static void get(const uint8_t *pixels, int stride, int16_t *block)
const AVClass * ff_packetsync_child_class_iterate(void **iter)
unsigned nb_in
Number of input streams.
int ff_packetsync_activate(FFPacketSync *fs)
Examine the packets in the filter's input and try to produce output.
int ff_packetsync_dualinput_get_writable(FFPacketSync *fs, AVPacket **f0, AVPacket **f1)
Same as ff_packetsync_dualinput_get(), but make sure that f0 is writable.
int64_t pts
PTS of the current packet.
int ff_packetsync_get_packet(FFPacketSync *fs, unsigned in, AVPacket **rpacket, unsigned get)
Get the current packet in an input.
unsigned sync
Synchronization level: packets on input at the highest sync level will generate output packet events.
int(* on_event)(struct FFPacketSync *fs)
Callback called when a packet event is ready.
AVBitStreamFilterContext * parent
Parent filter context.
FFPacketTSSyncMode
Timestamp synchronization mode.
uint8_t eof
Flag indicating that output has reached EOF.
AVRational time_base
Time base for the incoming packets.
enum FFPacketTSSyncMode ts_mode
int ff_packetsync_init_dualinput(FFPacketSync *fs, AVBitStreamFilterContext *parent)
Initialize a packet sync structure for dualinput.
This structure stores compressed data.
uint8_t pkt_ready
Flag indicating that a packet event is ready.
int ff_packetsync_init(FFPacketSync *fs, AVBitStreamFilterContext *parent, unsigned nb_in)
Initialize a packet sync structure.
unsigned sync_level
Synchronization level: only inputs with the same sync level are sync sources.
AVRational time_base
Time base for the output events.
unsigned in_request
Index of the input that requires a request.
void ff_packetsync_uninit(FFPacketSync *fs)
Free all memory currently allocated.
@ TS_DEFAULT
Sync to packets from secondary input with the nearest, lower or equal timestamp to the packet event o...
uint8_t have_next
Boolean flagging the next packet, for internal use.