FFmpeg
Loading...
Searching...
No Matches
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 <string.h>
20
21#include "config_components.h"
22
23#include "libavutil/avassert.h"
24#include "libavutil/log.h"
25#include "libavutil/mem.h"
26#include "libavutil/opt.h"
27#include "libavutil/avstring.h"
28#include "libavutil/bprint.h"
29
30#include "bsf.h"
31#include "bsf_internal.h"
32#include "codec_desc.h"
33#include "codec_par.h"
34#include "packet_internal.h"
35
41
46
48{
50 FFBSFContext *bsfi;
51
52 if (!pctx || !*pctx)
53 return;
54 ctx = *pctx;
55 bsfi = ffbsfcontext(ctx);
56
57 if (ctx->priv_data) {
58 if (ff_bsf(ctx->filter)->close)
59 ff_bsf(ctx->filter)->close(ctx);
60 if (ctx->filter->priv_class)
61 av_opt_free(ctx->priv_data);
62 av_freep(&ctx->priv_data);
63 }
65
68
69 av_freep(pctx);
70}
71
72static void *bsf_child_next(void *obj, void *prev)
73{
74 AVBSFContext *ctx = obj;
75 if (!prev && ctx->filter->priv_class)
76 return ctx->priv_data;
77 return NULL;
78}
79
80static const char *bsf_to_name(void *bsf)
81{
82 return ((AVBSFContext *)bsf)->filter->name;
83}
84
85static const AVClass bsf_class = {
86 .class_name = "AVBSFContext",
87 .item_name = bsf_to_name,
88 .version = LIBAVUTIL_VERSION_INT,
89 .child_next = bsf_child_next,
90 .child_class_iterate = ff_bsf_child_class_iterate,
92};
93
95{
96 return &bsf_class;
97}
98
100{
102 FFBSFContext *bsfi;
103 int ret;
104
105 if (!ff_bsf(filter)->filter)
106 return AVERROR(ENOTSUP);
107
108 bsfi = av_mallocz(sizeof(*bsfi));
109 if (!bsfi)
110 return AVERROR(ENOMEM);
111 ctx = &bsfi->pub;
112
113 ctx->av_class = &bsf_class;
114 ctx->filter = filter;
115
116 ctx->par_in = avcodec_parameters_alloc();
117 ctx->par_out = avcodec_parameters_alloc();
118 if (!ctx->par_in || !ctx->par_out) {
119 ret = AVERROR(ENOMEM);
120 goto fail;
121 }
122 /* allocate priv data and init private options */
123 if (ff_bsf(filter)->priv_data_size) {
124 ctx->priv_data = av_mallocz(ff_bsf(filter)->priv_data_size);
125 if (!ctx->priv_data) {
126 ret = AVERROR(ENOMEM);
127 goto fail;
128 }
129 if (filter->priv_class) {
130 *(const AVClass **)ctx->priv_data = filter->priv_class;
131 av_opt_set_defaults(ctx->priv_data);
132 }
133 }
134 bsfi->buffer_pkt = av_packet_alloc();
135 if (!bsfi->buffer_pkt) {
136 ret = AVERROR(ENOMEM);
137 goto fail;
138 }
139
140 *pctx = ctx;
141 return 0;
142fail:
144 return ret;
145}
146
148{
149 int ret, i;
150
151 /* check that the codec is supported */
152 if (ctx->filter->codec_ids) {
153 for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++)
154 if (ctx->par_in->codec_id == ctx->filter->codec_ids[i])
155 break;
156 if (ctx->filter->codec_ids[i] == AV_CODEC_ID_NONE) {
157 const AVCodecDescriptor *desc = avcodec_descriptor_get(ctx->par_in->codec_id);
158 av_log(ctx, AV_LOG_ERROR, "Codec '%s' (%d) is not supported by the "
159 "bitstream filter '%s'. Supported codecs are: ",
160 desc ? desc->name : "unknown", ctx->par_in->codec_id, ctx->filter->name);
161 for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++) {
162 enum AVCodecID codec_id = ctx->filter->codec_ids[i];
163 av_log(ctx, AV_LOG_ERROR, "%s (%d) ",
165 }
166 av_log(ctx, AV_LOG_ERROR, "\n");
167 return AVERROR(EINVAL);
168 }
169 }
170
171 /* initialize output parameters to be the same as input
172 * init below might overwrite that */
173 ret = avcodec_parameters_copy(ctx->par_out, ctx->par_in);
174 if (ret < 0)
175 return ret;
176
177 ctx->time_base_out = ctx->time_base_in;
178
179 if (ff_bsf(ctx->filter)->init) {
180 ret = ff_bsf(ctx->filter)->init(ctx);
181 if (ret < 0)
182 return ret;
183 }
184
185 return 0;
186}
187
189{
190 FFBSFContext *const bsfi = ffbsfcontext(ctx);
191
192 bsfi->eof = 0;
193
195
196 if (ff_bsf(ctx->filter)->flush)
197 ff_bsf(ctx->filter)->flush(ctx);
198}
199
201{
202 FFBSFContext *const bsfi = ffbsfcontext(ctx);
203 int ret;
204
205 if (!pkt || AVPACKET_IS_EMPTY(pkt)) {
206 if (pkt)
208 bsfi->eof = 1;
209 return 0;
210 }
211
212 if (bsfi->eof) {
213 av_log(ctx, AV_LOG_ERROR, "A non-NULL packet sent after an EOF.\n");
214 return AVERROR(EINVAL);
215 }
216
217 if (!AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
218 return AVERROR(EAGAIN);
219
221 if (ret < 0)
222 return ret;
224
225 return 0;
226}
227
229{
230 return ff_bsf(ctx->filter)->filter(ctx, pkt);
231}
232
234{
235 FFBSFContext *const bsfi = ffbsfcontext(ctx);
236 AVPacket *tmp_pkt;
237
238 if (bsfi->eof)
239 return AVERROR_EOF;
240
241 if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
242 return AVERROR(EAGAIN);
243
244 tmp_pkt = av_packet_alloc();
245 if (!tmp_pkt)
246 return AVERROR(ENOMEM);
247
248 *pkt = bsfi->buffer_pkt;
249 bsfi->buffer_pkt = tmp_pkt;
250
251 return 0;
252}
253
255{
256 FFBSFContext *const bsfi = ffbsfcontext(ctx);
257
258 if (bsfi->eof)
259 return AVERROR_EOF;
260
261 if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
262 return AVERROR(EAGAIN);
263
265
266 return 0;
267}
268
269typedef struct BSFListContext {
270 const AVClass *class;
271
274
275 unsigned idx; // index of currently processed BSF
276
277 char * item_name;
279
280
282{
283 BSFListContext *lst = bsf->priv_data;
284 int ret, i;
285 const AVCodecParameters *cod_par = bsf->par_in;
286 AVRational tb = bsf->time_base_in;
287
288 for (i = 0; i < lst->nb_bsfs; ++i) {
289 ret = avcodec_parameters_copy(lst->bsfs[i]->par_in, cod_par);
290 if (ret < 0)
291 goto fail;
292
293 lst->bsfs[i]->time_base_in = tb;
294
295 ret = av_bsf_init(lst->bsfs[i]);
296 if (ret < 0)
297 goto fail;
298
299 cod_par = lst->bsfs[i]->par_out;
300 tb = lst->bsfs[i]->time_base_out;
301 }
302
303 bsf->time_base_out = tb;
304 ret = avcodec_parameters_copy(bsf->par_out, cod_par);
305
306fail:
307 return ret;
308}
309
311{
312 BSFListContext *lst = bsf->priv_data;
313 int ret, eof = 0;
314
315 if (!lst->nb_bsfs)
316 return ff_bsf_get_packet_ref(bsf, out);
317
318 while (1) {
319 /* get a packet from the previous filter up the chain */
320 if (lst->idx)
321 ret = av_bsf_receive_packet(lst->bsfs[lst->idx-1], out);
322 else
323 ret = ff_bsf_get_packet_ref(bsf, out);
324 if (ret == AVERROR(EAGAIN)) {
325 if (!lst->idx)
326 return ret;
327 lst->idx--;
328 continue;
329 } else if (ret == AVERROR_EOF) {
330 eof = 1;
331 } else if (ret < 0)
332 return ret;
333
334 /* send it to the next filter down the chain */
335 if (lst->idx < lst->nb_bsfs) {
336 ret = av_bsf_send_packet(lst->bsfs[lst->idx], eof ? NULL : out);
337 av_assert1(ret != AVERROR(EAGAIN));
338 if (ret < 0) {
340 return ret;
341 }
342 lst->idx++;
343 eof = 0;
344 } else if (eof) {
345 return ret;
346 } else {
347 return 0;
348 }
349 }
350}
351
353{
354 BSFListContext *lst = bsf->priv_data;
355
356 for (int i = 0; i < lst->nb_bsfs; i++)
357 av_bsf_flush(lst->bsfs[i]);
358 lst->idx = 0;
359}
360
362{
363 BSFListContext *lst = bsf->priv_data;
364 int i;
365
366 for (i = 0; i < lst->nb_bsfs; ++i)
367 av_bsf_free(&lst->bsfs[i]);
368 av_freep(&lst->bsfs);
369 av_freep(&lst->item_name);
370}
371
372static const char *bsf_list_item_name(void *ctx)
373{
374 static const char *null_filter_name = "null";
375 AVBSFContext *bsf_ctx = ctx;
376 BSFListContext *lst = bsf_ctx->priv_data;
377
378 if (!lst->nb_bsfs)
379 return null_filter_name;
380
381 if (!lst->item_name) {
382 int i;
383 AVBPrint bp;
384 av_bprint_init(&bp, 16, 128);
385
386 av_bprintf(&bp, "bsf_list(");
387 for (i = 0; i < lst->nb_bsfs; i++)
388 av_bprintf(&bp, i ? ",%s" : "%s", lst->bsfs[i]->filter->name);
389 av_bprintf(&bp, ")");
390
391 av_bprint_finalize(&bp, &lst->item_name);
392 }
393
394 return lst->item_name;
395}
396
397static const AVClass bsf_list_class = {
398 .class_name = "bsf_list",
399 .item_name = bsf_list_item_name,
400 .version = LIBAVUTIL_VERSION_INT,
401};
402
404 .p.name = "bsf_list",
405 .p.priv_class = &bsf_list_class,
406 .priv_data_size = sizeof(BSFListContext),
411};
412
417
419{
420 return av_mallocz(sizeof(AVBSFList));
421}
422
424{
425 int i;
426
427 if (!*lst)
428 return;
429
430 for (i = 0; i < (*lst)->nb_bsfs; ++i)
431 av_bsf_free(&(*lst)->bsfs[i]);
432 av_free((*lst)->bsfs);
433 av_freep(lst);
434}
435
437{
438 return av_dynarray_add_nofree(&lst->bsfs, &lst->nb_bsfs, bsf);
439}
440
441static int bsf_list_append_internal(AVBSFList *lst, const char *bsf_name, const char *options, AVDictionary ** options_dict)
442{
443 int ret;
445 AVBSFContext *bsf;
446
447 filter = av_bsf_get_by_name(bsf_name);
448 if (!filter)
450
451 ret = av_bsf_alloc(filter, &bsf);
452 if (ret < 0)
453 return ret;
454
455 if (options && filter->priv_class) {
456 const AVOption *opt = av_opt_next(bsf->priv_data, NULL);
457 const char * shorthand[2] = {NULL};
458
459 if (opt)
460 shorthand[0] = opt->name;
461
462 ret = av_opt_set_from_string(bsf->priv_data, options, shorthand, "=", ":");
463 if (ret < 0)
464 goto end;
465 }
466
467 if (options_dict) {
468 ret = av_opt_set_dict2(bsf, options_dict, AV_OPT_SEARCH_CHILDREN);
469 if (ret < 0)
470 goto end;
471 }
472
473 ret = av_bsf_list_append(lst, bsf);
474
475end:
476 if (ret < 0)
477 av_bsf_free(&bsf);
478
479 return ret;
480}
481
482int av_bsf_list_append2(AVBSFList *lst, const char *bsf_name, AVDictionary ** options)
483{
484 return bsf_list_append_internal(lst, bsf_name, NULL, options);
485}
486
488{
489 int ret = 0;
491
492 if ((*lst)->nb_bsfs == 1) {
493 *bsf = (*lst)->bsfs[0];
494 av_freep(&(*lst)->bsfs);
495 (*lst)->nb_bsfs = 0;
496 goto end;
497 }
498
499 ret = av_bsf_alloc(&list_bsf.p, bsf);
500 if (ret < 0)
501 return ret;
502
503 ctx = (*bsf)->priv_data;
504
505 ctx->bsfs = (*lst)->bsfs;
506 ctx->nb_bsfs = (*lst)->nb_bsfs;
507
508end:
509 av_freep(lst);
510 return ret;
511}
512
513static int bsf_parse_single(char *str, AVBSFList *bsf_lst)
514{
515 char *bsf_name, *bsf_options_str;
516
517 bsf_name = av_strtok(str, "=", &bsf_options_str);
518 if (!bsf_name)
519 return AVERROR(EINVAL);
520
521 return bsf_list_append_internal(bsf_lst, bsf_name, bsf_options_str, NULL);
522}
523
524int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst)
525{
526 AVBSFList *lst;
527 int ret;
528
529 if (!str)
530 return av_bsf_get_null_filter(bsf_lst);
531
532 lst = av_bsf_list_alloc();
533 if (!lst)
534 return AVERROR(ENOMEM);
535
536 do {
537 char *bsf_str = av_get_token(&str, ",");
538 ret = bsf_parse_single(bsf_str, lst);
539 av_free(bsf_str);
540 if (ret < 0)
541 goto end;
542 } while (*str && *++str);
543
544 ret = av_bsf_list_finalize(&lst, bsf_lst);
545end:
546 if (ret < 0)
547 av_bsf_list_free(&lst);
548 return ret;
549}
550
552{
553#if CONFIG_NULL_BSF
554 extern const FFBitStreamFilter ff_null_bsf;
555 return av_bsf_alloc(&ff_null_bsf.p, bsf);
556#else
557 return av_bsf_alloc(&list_bsf.p, bsf);
558#endif
559}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition avassert.h:58
const AVClass * ff_bsf_child_class_iterate(void **opaque)
const FFBitStreamFilter ff_null_bsf
Definition null.c:26
static void * bsf_child_next(void *obj, void *prev)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition bprint.c:122
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition bprint.c:69
AVBPrint public header.
static const AVClass bsf_class
Definition bsf.c:85
static void bsf_list_close(AVBSFContext *bsf)
Definition bsf.c:361
int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt)
Called by the bitstream filters to get the next packet for filtering.
Definition bsf.c:233
static int bsf_list_init(AVBSFContext *bsf)
Definition bsf.c:281
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
Definition bsf.c:254
static const char * bsf_list_item_name(void *ctx)
Definition bsf.c:372
static int bsf_list_append_internal(AVBSFList *lst, const char *bsf_name, const char *options, AVDictionary **options_dict)
Definition bsf.c:441
static const char * bsf_to_name(void *bsf)
Definition bsf.c:80
static void * bsf_child_next(void *obj, void *prev)
Definition bsf.c:72
static const AVClass bsf_list_class
Definition bsf.c:397
static void bsf_list_flush(AVBSFContext *bsf)
Definition bsf.c:352
static av_always_inline FFBSFContext * ffbsfcontext(AVBSFContext *ctx)
Definition bsf.c:42
static const FFBitStreamFilter list_bsf
Definition bsf.c:403
static int bsf_parse_single(char *str, AVBSFList *bsf_lst)
Definition bsf.c:513
static int bsf_list_filter(AVBSFContext *bsf, AVPacket *out)
Definition bsf.c:310
static av_always_inline const FFBitStreamFilter * ff_bsf(const AVBitStreamFilter *bsf)
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
AVCodecParameters * avcodec_parameters_alloc(void)
Definition codec_par.c:57
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Definition codec_par.c:107
void avcodec_parameters_free(AVCodecParameters **ppar)
Definition codec_par.c:67
#define NULL
Definition coverity.c:32
static AVPacket * pkt
void(* flush)(AVBSFContext *ctx)
Definition dts2pts.c:610
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define fail
Definition test.h:479
void av_bsf_free(AVBSFContext **pctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
Definition bsf.c:47
void av_bsf_list_free(AVBSFList **lst)
Free list of bitstream filters.
Definition bsf.c:423
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
Definition bsf.c:147
int av_bsf_list_append(AVBSFList *lst, AVBSFContext *bsf)
Append bitstream filter to the list of bitstream filters.
Definition bsf.c:436
void av_bsf_flush(AVBSFContext *ctx)
Reset the internal bitstream filter state.
Definition bsf.c:188
const AVClass * av_bsf_get_class(void)
Get the AVClass for AVBSFContext.
Definition bsf.c:94
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **pctx)
Allocate a context for a given bitstream filter.
Definition bsf.c:99
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
Definition bsf.c:228
int av_bsf_list_finalize(AVBSFList **lst, AVBSFContext **bsf)
Finalize list of bitstream filters.
Definition bsf.c:487
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
Definition bsf.c:200
AVBSFList * av_bsf_list_alloc(void)
Allocate empty list of bitstream filters.
Definition bsf.c:418
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst)
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole...
Definition bsf.c:524
int av_bsf_get_null_filter(AVBSFContext **bsf)
Get null/pass-through bitstream filter.
Definition bsf.c:551
const AVBitStreamFilter * av_bsf_get_by_name(const char *name)
int av_bsf_list_append2(AVBSFList *lst, const char *bsf_name, AVDictionary **options)
Construct new bitstream filter context given it's name and options and append it to the list of bitst...
Definition bsf.c:482
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
Definition utils.c:421
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition codec_id.h:47
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Definition packet.c:74
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition packet.c:434
int av_packet_make_refcounted(AVPacket *pkt)
Ensure the data described by a given packet is reference counted.
Definition packet.c:497
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
Definition packet.c:491
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
Definition packet.c:63
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition bprint.c:235
#define AVERROR_BSF_NOT_FOUND
Bitstream filter not found.
Definition error.h:51
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem)
Add an element to a dynamic array.
Definition mem.c:313
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
Definition avstring.c:179
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
Definition avstring.c:143
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
Definition opt.h:604
void av_opt_free(void *obj)
Free all allocated objects in obj.
Definition opt.c:2025
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
Definition opt.c:1754
const AVOption * av_opt_next(const void *obj, const AVOption *last)
Iterate over all AVOptions belonging to obj.
Definition opt.c:47
int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
Set all the options from a given dictionary on an object.
Definition opt.c:2038
int av_opt_set_from_string(void *ctx, const char *opts, const char *const *shorthand, const char *key_val_sep, const char *pairs_sep)
Parse the key-value pairs list in opts.
Definition opt.c:1973
#define AVPACKET_IS_EMPTY(pkt)
#define av_always_inline
Definition attributes.h:72
const char * desc
Definition libsvtav1.c:83
@ AV_CLASS_CATEGORY_BITSTREAM_FILTER
Definition log.h:37
Memory handling functions.
AVOptions.
The bitstream filter state.
Definition bsf.h:68
AVRational time_base_out
The timebase used for the timestamps of the output packets.
Definition bsf.h:108
void * priv_data
Opaque filter-specific private data.
Definition bsf.h:83
AVCodecParameters * par_in
Parameters of the input stream.
Definition bsf.h:90
AVCodecParameters * par_out
Parameters of the output stream.
Definition bsf.h:96
AVRational time_base_in
The timebase used for the timestamps of the input packets.
Definition bsf.h:102
const struct AVBitStreamFilter * filter
The bitstream filter this context is an instance of.
Definition bsf.h:77
Structure for chain/list of bitstream filters.
Definition bsf.c:413
int nb_bsfs
Definition bsf.c:415
AVBSFContext ** bsfs
Definition bsf.c:414
const char * name
Definition bsf.h:112
Describe the class of an AVClass context structure.
Definition log.h:76
This struct describes the properties of a single codec described by an AVCodecID.
Definition codec_desc.h:38
This struct describes the properties of an encoded stream.
Definition codec_par.h:49
AVOption.
Definition opt.h:428
const char * name
Definition opt.h:429
This structure stores compressed data.
Definition packet.h:580
Rational number (pair of numerator and denominator).
Definition rational.h:58
char * item_name
Definition bsf.c:277
int nb_bsfs
Definition bsf.c:273
AVBSFContext ** bsfs
Definition bsf.c:272
unsigned idx
Definition bsf.c:275
AVBSFContext pub
Definition bsf.c:37
int eof
Definition bsf.c:39
AVPacket * buffer_pkt
Definition bsf.c:38
int(* init)(AVBSFContext *ctx)
int(* filter)(AVBSFContext *ctx, AVPacket *pkt)
void(* close)(AVBSFContext *ctx)
void(* flush)(AVBSFContext *ctx)
#define av_free(p)
#define av_mallocz(s)
#define av_freep(p)
#define av_log(a,...)
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
enum AVCodecID codec_id