FFmpeg
extract_extradata_bsf.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <stdint.h>
20 
21 #include "libavutil/log.h"
22 #include "libavutil/opt.h"
23 
24 #include "av1.h"
25 #include "av1_parse.h"
26 #include "bsf.h"
27 #include "bsf_internal.h"
28 #include "bytestream.h"
29 #include "h2645_parse.h"
30 #include "h264.h"
31 #include "hevc.h"
32 #include "startcode.h"
33 #include "vc1_common.h"
34 
35 typedef struct ExtractExtradataContext {
36  const AVClass *class;
37 
39  uint8_t **data, int *size);
40 
41  /* AV1 specific fields */
43 
44  /* H264/HEVC specific fields */
46 
47  /* AVOptions */
48  int remove;
50 
51 static int val_in_array(const int *arr, int len, int val)
52 {
53  int i;
54  for (i = 0; i < len; i++)
55  if (arr[i] == val)
56  return 1;
57  return 0;
58 }
59 
61  uint8_t **data, int *size)
62 {
63  static const int extradata_obu_types[] = {
65  };
67 
68  int extradata_size = 0, filtered_size = 0;
69  int nb_extradata_obu_types = FF_ARRAY_ELEMS(extradata_obu_types);
70  int i, has_seq = 0, ret = 0;
71 
72  ret = ff_av1_packet_split(&s->av1_pkt, pkt->data, pkt->size, ctx);
73  if (ret < 0)
74  return ret;
75 
76  for (i = 0; i < s->av1_pkt.nb_obus; i++) {
77  AV1OBU *obu = &s->av1_pkt.obus[i];
78  if (val_in_array(extradata_obu_types, nb_extradata_obu_types, obu->type)) {
79  extradata_size += obu->raw_size;
80  if (obu->type == AV1_OBU_SEQUENCE_HEADER)
81  has_seq = 1;
82  } else if (s->remove) {
83  filtered_size += obu->raw_size;
84  }
85  }
86 
87  if (extradata_size && has_seq) {
88  AVBufferRef *filtered_buf = NULL;
89  PutByteContext pb_filtered_data, pb_extradata;
90  uint8_t *extradata;
91 
92  if (s->remove) {
93  filtered_buf = av_buffer_alloc(filtered_size + AV_INPUT_BUFFER_PADDING_SIZE);
94  if (!filtered_buf) {
95  return AVERROR(ENOMEM);
96  }
97  memset(filtered_buf->data + filtered_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
98  }
99 
100  extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
101  if (!extradata) {
102  av_buffer_unref(&filtered_buf);
103  return AVERROR(ENOMEM);
104  }
105 
106  *data = extradata;
107  *size = extradata_size;
108 
109  bytestream2_init_writer(&pb_extradata, extradata, extradata_size);
110  if (s->remove)
111  bytestream2_init_writer(&pb_filtered_data, filtered_buf->data, filtered_size);
112 
113  for (i = 0; i < s->av1_pkt.nb_obus; i++) {
114  AV1OBU *obu = &s->av1_pkt.obus[i];
115  if (val_in_array(extradata_obu_types, nb_extradata_obu_types,
116  obu->type)) {
117  bytestream2_put_bufferu(&pb_extradata, obu->raw_data, obu->raw_size);
118  } else if (s->remove) {
119  bytestream2_put_bufferu(&pb_filtered_data, obu->raw_data, obu->raw_size);
120  }
121  }
122 
123  if (s->remove) {
125  pkt->buf = filtered_buf;
126  pkt->data = filtered_buf->data;
127  pkt->size = filtered_size;
128  }
129  }
130 
131  return 0;
132 }
133 
135  uint8_t **data, int *size)
136 {
137  static const int extradata_nal_types_hevc[] = {
139  };
140  static const int extradata_nal_types_h264[] = {
142  };
143 
145 
146  int extradata_size = 0, filtered_size = 0;
147  const int *extradata_nal_types;
148  int nb_extradata_nal_types;
149  int i, has_sps = 0, has_vps = 0, ret = 0;
150 
151  if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {
152  extradata_nal_types = extradata_nal_types_hevc;
153  nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_hevc);
154  } else {
155  extradata_nal_types = extradata_nal_types_h264;
156  nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_h264);
157  }
158 
159  ret = ff_h2645_packet_split(&s->h2645_pkt, pkt->data, pkt->size,
160  ctx, 0, 0, ctx->par_in->codec_id, 1, 0);
161  if (ret < 0)
162  return ret;
163 
164  for (i = 0; i < s->h2645_pkt.nb_nals; i++) {
165  H2645NAL *nal = &s->h2645_pkt.nals[i];
166  if (val_in_array(extradata_nal_types, nb_extradata_nal_types, nal->type)) {
167  extradata_size += nal->raw_size + 3;
168  if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {
169  if (nal->type == HEVC_NAL_SPS) has_sps = 1;
170  if (nal->type == HEVC_NAL_VPS) has_vps = 1;
171  } else {
172  if (nal->type == H264_NAL_SPS) has_sps = 1;
173  }
174  } else if (s->remove) {
175  filtered_size += nal->raw_size + 3;
176  }
177  }
178 
179  if (extradata_size &&
180  ((ctx->par_in->codec_id == AV_CODEC_ID_HEVC && has_sps && has_vps) ||
181  (ctx->par_in->codec_id == AV_CODEC_ID_H264 && has_sps))) {
182  AVBufferRef *filtered_buf = NULL;
183  PutByteContext pb_filtered_data, pb_extradata;
184  uint8_t *extradata;
185 
186  if (s->remove) {
187  filtered_buf = av_buffer_alloc(filtered_size + AV_INPUT_BUFFER_PADDING_SIZE);
188  if (!filtered_buf) {
189  return AVERROR(ENOMEM);
190  }
191  memset(filtered_buf->data + filtered_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
192  }
193 
194  extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
195  if (!extradata) {
196  av_buffer_unref(&filtered_buf);
197  return AVERROR(ENOMEM);
198  }
199 
200  *data = extradata;
201  *size = extradata_size;
202 
203  bytestream2_init_writer(&pb_extradata, extradata, extradata_size);
204  if (s->remove)
205  bytestream2_init_writer(&pb_filtered_data, filtered_buf->data, filtered_size);
206 
207  for (i = 0; i < s->h2645_pkt.nb_nals; i++) {
208  H2645NAL *nal = &s->h2645_pkt.nals[i];
209  if (val_in_array(extradata_nal_types, nb_extradata_nal_types,
210  nal->type)) {
211  bytestream2_put_be24u(&pb_extradata, 1); //startcode
212  bytestream2_put_bufferu(&pb_extradata, nal->raw_data, nal->raw_size);
213  } else if (s->remove) {
214  bytestream2_put_be24u(&pb_filtered_data, 1); // startcode
215  bytestream2_put_bufferu(&pb_filtered_data, nal->raw_data, nal->raw_size);
216  }
217  }
218 
219  if (s->remove) {
221  pkt->buf = filtered_buf;
222  pkt->data = filtered_buf->data;
223  pkt->size = filtered_size;
224  }
225  }
226 
227  return 0;
228 }
229 
231  uint8_t **data, int *size)
232 {
234  const uint8_t *ptr = pkt->data, *end = pkt->data + pkt->size;
235  uint32_t state = UINT32_MAX;
236  int has_extradata = 0, extradata_size = 0;
237 
238  while (ptr < end) {
239  ptr = avpriv_find_start_code(ptr, end, &state);
241  has_extradata = 1;
242  } else if (has_extradata && IS_MARKER(state)) {
243  extradata_size = ptr - 4 - pkt->data;
244  break;
245  }
246  }
247 
248  if (extradata_size) {
249  *data = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
250  if (!*data)
251  return AVERROR(ENOMEM);
252 
253  memcpy(*data, pkt->data, extradata_size);
254  *size = extradata_size;
255 
256  if (s->remove) {
257  pkt->data += extradata_size;
258  pkt->size -= extradata_size;
259  }
260  }
261 
262  return 0;
263 }
264 
266  uint8_t **data, int *size)
267 {
269  uint32_t state = UINT32_MAX;
270  int i, found = 0;
271 
272  for (i = 0; i < pkt->size; i++) {
273  state = (state << 8) | pkt->data[i];
274  if (state == 0x1B3)
275  found = 1;
276  else if (found && state != 0x1B5 && state < 0x200 && state >= 0x100) {
277  *size = i - 3;
279  if (!*data)
280  return AVERROR(ENOMEM);
281 
282  memcpy(*data, pkt->data, *size);
283 
284  if (s->remove) {
285  pkt->data += *size;
286  pkt->size -= *size;
287  }
288  break;
289  }
290  }
291  return 0;
292 }
293 
295  uint8_t **data, int *size)
296 {
298  const uint8_t *ptr = pkt->data, *end = pkt->data + pkt->size;
299  uint32_t state = UINT32_MAX;
300 
301  while (ptr < end) {
302  ptr = avpriv_find_start_code(ptr, end, &state);
303  if (state == 0x1B3 || state == 0x1B6) {
304  if (ptr - pkt->data > 4) {
305  *size = ptr - 4 - pkt->data;
307  if (!*data)
308  return AVERROR(ENOMEM);
309 
310  memcpy(*data, pkt->data, *size);
311 
312  if (s->remove) {
313  pkt->data += *size;
314  pkt->size -= *size;
315  }
316  }
317  break;
318  }
319  }
320  return 0;
321 }
322 
323 static const struct {
324  enum AVCodecID id;
326  uint8_t **data, int *size);
327 } extract_tab[] = {
338 };
339 
341 {
343  int i;
344 
345  for (i = 0; i < FF_ARRAY_ELEMS(extract_tab); i++) {
346  if (extract_tab[i].id == ctx->par_in->codec_id) {
347  s->extract = extract_tab[i].extract;
348  break;
349  }
350  }
351  if (!s->extract)
352  return AVERROR_BUG;
353 
354  return 0;
355 }
356 
358 {
360  uint8_t *extradata = NULL;
361  int extradata_size;
362  int ret = 0;
363 
365  if (ret < 0)
366  return ret;
367 
368  ret = s->extract(ctx, pkt, &extradata, &extradata_size);
369  if (ret < 0)
370  goto fail;
371 
372  if (extradata) {
373  memset(extradata + extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
375  extradata, extradata_size);
376  if (ret < 0) {
377  av_freep(&extradata);
378  goto fail;
379  }
380  }
381 
382  return 0;
383 
384 fail:
386  return ret;
387 }
388 
390 {
392  ff_av1_packet_uninit(&s->av1_pkt);
393  ff_h2645_packet_uninit(&s->h2645_pkt);
394 }
395 
396 static const enum AVCodecID codec_ids[] = {
408 };
409 
410 #define OFFSET(x) offsetof(ExtractExtradataContext, x)
411 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
412 static const AVOption options[] = {
413  { "remove", "remove the extradata from the bitstream", OFFSET(remove), AV_OPT_TYPE_INT,
414  { .i64 = 0 }, 0, 1, FLAGS },
415  { NULL },
416 };
417 
419  .class_name = "extract_extradata",
420  .item_name = av_default_item_name,
421  .option = options,
422  .version = LIBAVUTIL_VERSION_INT,
423 };
424 
426  .p.name = "extract_extradata",
427  .p.codec_ids = codec_ids,
428  .p.priv_class = &extract_extradata_class,
429  .priv_data_size = sizeof(ExtractExtradataContext),
432  .close = extract_extradata_close,
433 };
av_packet_unref
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: avpacket.c:422
ExtractExtradataContext::h2645_pkt
H2645Packet h2645_pkt
Definition: extract_extradata_bsf.c:45
h2645_parse.h
AVERROR
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
bsf_internal.h
opt.h
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:90
AVBitStreamFilter::name
const char * name
Definition: bsf.h:112
AV_CODEC_ID_MPEG4
@ AV_CODEC_ID_MPEG4
Definition: codec_id.h:62
extract_extradata_h2645
static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:134
extract_extradata_class
static const AVClass extract_extradata_class
Definition: extract_extradata_bsf.c:418
AVPacket::data
uint8_t * data
Definition: packet.h:374
AVOption
AVOption.
Definition: opt.h:251
ff_h2645_packet_uninit
void ff_h2645_packet_uninit(H2645Packet *pkt)
Free all the allocated memory in the packet.
Definition: h2645_parse.c:528
AV_CODEC_ID_AVS2
@ AV_CODEC_ID_AVS2
Definition: codec_id.h:244
data
const char data[16]
Definition: mxf.c:143
AV1OBU
Definition: av1_parse.h:37
ExtractExtradataContext::av1_pkt
AV1Packet av1_pkt
Definition: extract_extradata_bsf.c:42
filter
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
Definition: filter_design.txt:228
ExtractExtradataContext::remove
int remove
Definition: extract_extradata_bsf.c:48
AVBSFContext
The bitstream filter state.
Definition: bsf.h:68
ff_av1_packet_split
int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, void *logctx)
Split an input packet into OBUs.
Definition: av1_parse.c:56
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
init
static int init
Definition: av_tx.c:47
av1_parse.h
bsf.h
av_packet_add_side_data
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as a packet side data.
Definition: avpacket.c:196
AV1Packet
An input packet split into OBUs.
Definition: av1_parse.h:62
fail
#define fail()
Definition: checkasm.h:131
ExtractExtradataContext::extract
int(* extract)(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:38
extract_extradata_filter
static int extract_extradata_filter(AVBSFContext *ctx, AVPacket *pkt)
Definition: extract_extradata_bsf.c:357
val
static double val(void *priv, double ch)
Definition: aeval.c:77
extract_extradata_mpeg12
static int extract_extradata_mpeg12(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:265
H264_NAL_PPS
@ H264_NAL_PPS
Definition: h264.h:42
pkt
AVPacket * pkt
Definition: movenc.c:59
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
bytestream2_init_writer
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
Definition: bytestream.h:147
s
#define s(width, name)
Definition: cbs_vp9.c:256
ctx
AVFormatContext * ctx
Definition: movenc.c:48
codec_ids
static enum AVCodecID codec_ids[]
Definition: extract_extradata_bsf.c:396
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:77
H2645NAL::type
int type
NAL unit type.
Definition: h2645_parse.h:52
FLAGS
#define FLAGS
Definition: extract_extradata_bsf.c:411
if
if(ret)
Definition: filter_design.txt:179
AV_CODEC_ID_AVS3
@ AV_CODEC_ID_AVS3
Definition: codec_id.h:246
AVPacket::buf
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
Definition: packet.h:357
H2645NAL::raw_size
int raw_size
Definition: h2645_parse.h:44
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
FFBitStreamFilter
Definition: bsf_internal.h:27
av_buffer_unref
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition: buffer.c:139
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:279
HEVC_NAL_PPS
@ HEVC_NAL_PPS
Definition: hevc.h:63
VC1_CODE_SEQHDR
@ VC1_CODE_SEQHDR
Definition: vc1_common.h:40
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
IS_MARKER
#define IS_MARKER(state)
Definition: dca_parser.c:51
OFFSET
#define OFFSET(x)
Definition: extract_extradata_bsf.c:410
VC1_CODE_ENTRYPOINT
@ VC1_CODE_ENTRYPOINT
Definition: vc1_common.h:39
avpriv_find_start_code
const uint8_t * avpriv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state)
H264_NAL_SPS
@ H264_NAL_SPS
Definition: h264.h:41
AV_CODEC_ID_MPEG1VIDEO
@ AV_CODEC_ID_MPEG1VIDEO
Definition: codec_id.h:51
AVCodecID
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: codec_id.h:47
PutByteContext
Definition: bytestream.h:37
startcode.h
FFBitStreamFilter::p
AVBitStreamFilter p
The public AVBitStreamFilter.
Definition: bsf_internal.h:31
extract
int(* extract)(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:325
AVPacket::size
int size
Definition: packet.h:375
id
enum AVCodecID id
Definition: extract_extradata_bsf.c:324
size
int size
Definition: twinvq_data.h:10344
state
static struct @327 state
H2645NAL
Definition: h2645_parse.h:34
AV1_OBU_SEQUENCE_HEADER
@ AV1_OBU_SEQUENCE_HEADER
Definition: av1.h:30
extract_extradata_init
static int extract_extradata_init(AVBSFContext *ctx)
Definition: extract_extradata_bsf.c:340
options
static const AVOption options[]
Definition: extract_extradata_bsf.c:412
av1.h
ff_h2645_packet_split
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, void *logctx, int is_nalff, int nal_length_size, enum AVCodecID codec_id, int small_padding, int use_ref)
Split an input packet into NAL units.
Definition: h2645_parse.c:396
AV1OBU::raw_size
int raw_size
Size of entire OBU, including header.
Definition: av1_parse.h:49
extract_extradata_close
static void extract_extradata_close(AVBSFContext *ctx)
Definition: extract_extradata_bsf.c:389
av_buffer_alloc
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
Definition: buffer.c:77
vc1_common.h
log.h
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
AV_CODEC_ID_CAVS
@ AV_CODEC_ID_CAVS
Definition: codec_id.h:137
AV1OBU::raw_data
const uint8_t * raw_data
Definition: av1_parse.h:50
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:224
ff_av1_packet_uninit
void ff_av1_packet_uninit(AV1Packet *pkt)
Free all the allocated memory in the packet.
Definition: av1_parse.c:106
AV_CODEC_ID_VC1
@ AV_CODEC_ID_VC1
Definition: codec_id.h:120
len
int len
Definition: vorbis_enc_data.h:426
hevc.h
HEVC_NAL_VPS
@ HEVC_NAL_VPS
Definition: hevc.h:61
ret
ret
Definition: filter_design.txt:187
H2645NAL::raw_data
const uint8_t * raw_data
Definition: h2645_parse.h:45
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: defs.h:40
ExtractExtradataContext
Definition: extract_extradata_bsf.c:35
AV_PKT_DATA_NEW_EXTRADATA
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Definition: packet.h:56
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
extract_extradata_mpeg4
static int extract_extradata_mpeg4(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:294
AV1OBU::type
int type
Definition: av1_parse.h:55
extract_extradata_vc1
static int extract_extradata_vc1(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:230
val_in_array
static int val_in_array(const int *arr, int len, int val)
Definition: extract_extradata_bsf.c:51
HEVC_NAL_SPS
@ HEVC_NAL_SPS
Definition: hevc.h:62
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
bytestream2_put_bufferu
static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p, const uint8_t *src, unsigned int size)
Definition: bytestream.h:301
AVPacket
This structure stores compressed data.
Definition: packet.h:351
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
bytestream.h
h264.h
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:52
ff_bsf_get_packet_ref
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
Definition: bsf.c:257
ff_extract_extradata_bsf
const FFBitStreamFilter ff_extract_extradata_bsf
Definition: extract_extradata_bsf.c:425
extract_extradata_av1
static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata_bsf.c:60
int
int
Definition: ffmpeg_filter.c:153
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:52
H2645Packet
Definition: h2645_parse.h:82
AVFormatContext::priv_data
void * priv_data
Format private data.
Definition: avformat.h:1241
AV1_OBU_METADATA
@ AV1_OBU_METADATA
Definition: av1.h:34
extract_tab
static const struct @57 extract_tab[]