34 int *pos_p,
int *nb_vop,
int *pos_vop2) {
44 for (
int i = 0;
i < 255 && pos +
i + 1 <
end;
i++) {
45 if (pos[
i] ==
'p' && pos[
i + 1] ==
'\0') {
46 *pos_p = pos +
i - buf;
52 if (*nb_vop == 2 && pos_vop2) {
53 *pos_vop2 = pos - buf - 4;
62 int pos_p = -1, nb_vop = 0, pos_vop2 = -1,
ret = 0;
74 "Missing one N-VOP packet, discarding one B-frame.\n");
89 "Found %d VOP headers in one packet, only unpacking one.\n", nb_vop);
112 }
else if (nb_vop >= 2) {
114 pkt->
size = pos_vop2;
115 }
else if (pos_p >= 0) {
121 pkt->
data[pos_p] =
'\0';
138 if (pos_p_ext >= 0) {
140 "Updating DivX userdata (remove trailing 'p') in extradata.\n");
159 .
name =
"mpeg4_unpack_bframes",
AVCodecParameters * par_out
Parameters of the output stream.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
static void flush(AVCodecContext *avctx)
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
The bitstream filter state.
void * priv_data
Opaque filter-specific private data.
#define USER_DATA_STARTCODE
const AVBitStreamFilter ff_mpeg4_unpack_bframes_bsf
static av_cold int end(AVCodecContext *avctx)
static int mpeg4_unpack_bframes_filter(AVBSFContext *ctx, AVPacket *pkt)
const uint8_t * avpriv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state)
int av_packet_make_writable(AVPacket *pkt)
Create a writable reference for the data described by a given packet, avoiding data copy if possible...
AVCodecID
Identify the syntax and semantics of the bitstream.
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 then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int extradata_size
Size of the extradata content in bytes.
static void mpeg4_unpack_bframes_close_flush(AVBSFContext *bsfc)
static int mpeg4_unpack_bframes_init(AVBSFContext *ctx)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * data
The data buffer.
static void scan_buffer(const uint8_t *buf, int buf_size, int *pos_p, int *nb_vop, int *pos_vop2)
int size
Size of data in bytes.
static enum AVCodecID codec_ids[]
AVBufferRef * b_frame_ref
A reference to a data buffer.
common internal api header.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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
This structure stores compressed data.
AVCodecParameters * par_in
Parameters of the input stream.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.