Go to the documentation of this file.
45 int i, j,
ret, marker;
46 int is_superframe = !!
s->buffer_pkt->data;
48 if (!
s->buffer_pkt->data) {
58 if ((marker & 0xe0) == 0xc0) {
59 int length_size = 1 + ((marker >> 3) & 0x3);
60 int nb_frames = 1 + (marker & 0x7);
61 int idx_size = 2 + nb_frames * length_size;
63 if (in->
size >= idx_size && in->
data[in->
size - idx_size] == marker) {
65 int64_t total_size = 0;
68 nb_frames * length_size);
70 for (
i = 0;
i < nb_frames;
i++) {
72 for (j = 0; j < length_size; j++)
73 frame_size |= bytestream2_get_byte(&bc) << (j * 8);
76 if (frame_size <= 0 || total_size > in->
size - idx_size) {
78 "Invalid frame size in a superframe: %d\n",
frame_size);
84 s->nb_frames = nb_frames;
86 s->next_frame_offset = 0;
100 out->data +=
s->next_frame_offset;
101 out->size =
s->sizes[
s->next_frame];
103 s->next_frame_offset +=
out->size;
106 if (
s->next_frame >=
s->nb_frames)
163 .
p.
name =
"vp9_superframe_split",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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
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
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
The bitstream filter state.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int vp9_superframe_split_init(AVBSFContext *ctx)
int(* init)(AVBSFContext *ctx)
static unsigned int get_bits1(GetBitContext *s)
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVCodecID
Identify the syntax and semantics of the bitstream.
AVBitStreamFilter p
The public AVBitStreamFilter.
#define AV_NOPTS_VALUE
Undefined timestamp value.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
#define i(width, name, range_min, range_max)
const FFBitStreamFilter ff_vp9_superframe_split_bsf
static void vp9_superframe_split_flush(AVBSFContext *ctx)
static int vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)
void(* flush)(AVBSFContext *ctx)
This structure stores compressed data.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
static void vp9_superframe_split_uninit(AVBSFContext *ctx)
void * priv_data
Format private data.