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