|
FFmpeg
|
#include <stdint.h>#include "libavutil/log.h"#include "libavcodec/bsf.h"#include "libavcodec/packet.h"Go to the source code of this file.
Data Structures | |
| struct | FFPacketSyncIn |
| Input stream structure. More... | |
| struct | FFPacketSync |
| Packet sync structure. More... | |
Macros | |
| #define | PACKETSYNC_DEFINE_PURE_CLASS(name, desc, func_prefix, options) |
| #define | PACKETSYNC_AUXILIARY_FUNCS(func_prefix, context, field) |
| #define | PACKETSYNC_DEFINE_CLASS_EXT(name, context, field, options) |
| #define | PACKETSYNC_DEFINE_CLASS(name, context, field) PACKETSYNC_DEFINE_CLASS_EXT(name, context, field, name##_options) |
Enumerations | |
| enum | EOFAction { EOF_ACTION_ENDALL, EOF_ACTION_PASS, EOF_ACTION_REPEAT, EOF_ACTION_ENDALL, EOF_ACTION_PASS, EOF_ACTION_ROUND, EOF_ACTION_PASS, EOF_ACTION_NB } |
| enum | FFPacketSyncExtMode { EXT_STOP, EXT_NULL } |
| This API is intended as a helper for filters that have several video input and need to combine them somehow. More... | |
| enum | FFPacketTSSyncMode { TS_DEFAULT, TS_NEAREST } |
| Timestamp synchronization mode. More... | |
Functions | |
| void | ff_packetsync_preinit (FFPacketSync *fs) |
| Pre-initialize a packet sync structure. More... | |
| int | ff_packetsync_init (FFPacketSync *fs, AVBitStreamFilterContext *parent, unsigned nb_in) |
| Initialize a packet sync structure. More... | |
| int | ff_packetsync_configure (FFPacketSync *fs) |
| Configure a packet sync structure. More... | |
| void | ff_packetsync_uninit (FFPacketSync *fs) |
| Free all memory currently allocated. More... | |
| int | ff_packetsync_get_packet (FFPacketSync *fs, unsigned in, AVPacket **rpacket, unsigned get) |
| Get the current packet in an input. More... | |
| int | ff_packetsync_activate (FFPacketSync *fs) |
| Examine the packets in the filter's input and try to produce output. More... | |
| int | ff_packetsync_init_dualinput (FFPacketSync *fs, AVBitStreamFilterContext *parent) |
| Initialize a packet sync structure for dualinput. More... | |
| int | ff_packetsync_dualinput_get (FFPacketSync *fs, AVPacket **f0, AVPacket **f1) |
| 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. More... | |
| const AVClass * | ff_packetsync_child_class_iterate (void **iter) |
Variables | |
| const AVClass | ff_packetsync_class |
Definition at line 311 of file packetsync.h.
Definition at line 325 of file packetsync.h.
Definition at line 338 of file packetsync.h.
| #define PACKETSYNC_DEFINE_CLASS | ( | name, | |
| context, | |||
| field | |||
| ) | PACKETSYNC_DEFINE_CLASS_EXT(name, context, field, name##_options) |
Definition at line 342 of file packetsync.h.
| enum EOFAction |
| Enumerator | |
|---|---|
| EOF_ACTION_ENDALL | |
| EOF_ACTION_PASS | |
| EOF_ACTION_REPEAT | |
| EOF_ACTION_ENDALL | |
| EOF_ACTION_PASS | |
| EOF_ACTION_ROUND | |
| EOF_ACTION_PASS | |
| EOF_ACTION_NB | |
Definition at line 29 of file packetsync.h.
| enum FFPacketSyncExtMode |
This API is intended as a helper for filters that have several video input and need to combine them somehow.
If the inputs have different or variable frame rate, getting the input packets to match requires a rather complex logic and a few user-tunable options.
In this API, when a set of synchronized input packets is ready to be processed is called a packet event. packet event can be generated in response to input packets on any or all inputs and the handling of situations where some stream extend beyond the beginning or the end of others can be configured.
The basic working of this API is the following: set the on_event callback, then call ff_packetsync_activate() from the filter's activate callback. Stream extrapolation mode
Describe how the packets of a stream are extrapolated before the first one and after EOF to keep sync with possibly longer other streams.
| Enumerator | |
|---|---|
| EXT_STOP | Completely stop all streams with this one. |
| EXT_NULL | Ignore this stream and continue processing the other ones. |
Definition at line 57 of file packetsync.h.
| enum FFPacketTSSyncMode |
Timestamp synchronization mode.
Describe how the packets of a stream are synchronized based on timestamp distance.
Definition at line 76 of file packetsync.h.
| void ff_packetsync_preinit | ( | FFPacketSync * | fs | ) |
Pre-initialize a packet sync structure.
It sets the class pointer and inits the options to their default values. The entire structure is expected to be already set to 0. This step is optional, but necessary to use the options.
Definition at line 79 of file packetsync.c.
Referenced by ff_packetsync_init().
| int ff_packetsync_init | ( | FFPacketSync * | fs, |
| AVBitStreamFilterContext * | parent, | ||
| unsigned | nb_in | ||
| ) |
Initialize a packet sync structure.
The entire structure is expected to be already set to 0 or preinited.
| fs | packet sync structure to initialize |
| parent | parent AVBitStreamFilterContext object |
| nb_in | number of inputs |
Definition at line 87 of file packetsync.c.
Referenced by ff_packetsync_init_dualinput().
| int ff_packetsync_configure | ( | FFPacketSync * | fs | ) |
Configure a packet sync structure.
Must be called after all options are set but before all use.
Definition at line 138 of file packetsync.c.
Referenced by config_output().
| void ff_packetsync_uninit | ( | FFPacketSync * | fs | ) |
Free all memory currently allocated.
Definition at line 289 of file packetsync.c.
Referenced by uninit().
| int ff_packetsync_get_packet | ( | FFPacketSync * | fs, |
| unsigned | in, | ||
| AVPacket ** | rpacket, | ||
| unsigned | get | ||
| ) |
Get the current packet in an input.
| fs | packet sync structure |
| in | index of the input |
| rpacket | used to return the current packet (or NULL) |
| get | if not zero, the calling code needs to get ownership of the returned packet; the current packet will either be duplicated or removed from the packetsync structure |
Definition at line 257 of file packetsync.c.
Referenced by ff_packetsync_dualinput_get().
| int ff_packetsync_activate | ( | FFPacketSync * | fs | ) |
Examine the packets in the filter's input and try to produce output.
This function can be the complete implementation of the activate method of a filter using packetsync.
Definition at line 340 of file packetsync.c.
Referenced by activate().
| int ff_packetsync_init_dualinput | ( | FFPacketSync * | fs, |
| AVBitStreamFilterContext * | parent | ||
| ) |
Initialize a packet sync structure for dualinput.
Compared to generic packetsync, dualinput assumes the first input is the main one and the filtering is performed on it. The first input will be the only one with sync set and generic timeline support will just pass it unchanged when disabled.
Equivalent to ff_packetsync_init(fs, parent, 2) then setting the time base, sync and ext modes on the inputs.
Definition at line 366 of file packetsync.c.
Referenced by config_output().
| int ff_packetsync_dualinput_get | ( | FFPacketSync * | fs, |
| AVPacket ** | f0, | ||
| AVPacket ** | f1 | ||
| ) |
| f0 | used to return the main packet |
| f1 | used to return the second packet, or NULL if disabled |
Definition at line 384 of file packetsync.c.
Referenced by ff_packetsync_dualinput_get_writable(), and lcevc_merge().
| 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.
Definition at line 402 of file packetsync.c.
| const AVClass* ff_packetsync_child_class_iterate | ( | void ** | iter | ) |
Definition at line 64 of file packetsync.c.
| const AVClass ff_packetsync_class |
Definition at line 55 of file packetsync.c.
Referenced by ff_packetsync_child_class_iterate(), and ff_packetsync_preinit().
1.8.17