summaryrefslogtreecommitdiff
path: root/libavcodec/dump_extradata_bsf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/dump_extradata_bsf.c')
-rw-r--r--libavcodec/dump_extradata_bsf.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/libavcodec/dump_extradata_bsf.c b/libavcodec/dump_extradata_bsf.c
index c960d6a233..188a1c619b 100644
--- a/libavcodec/dump_extradata_bsf.c
+++ b/libavcodec/dump_extradata_bsf.c
@@ -1,20 +1,20 @@
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -34,16 +34,17 @@ enum DumpFreq {
typedef struct DumpExtradataContext {
const AVClass *class;
+ AVPacket pkt;
int freq;
} DumpExtradataContext;
static int dump_extradata(AVBSFContext *ctx, AVPacket *out)
{
DumpExtradataContext *s = ctx->priv_data;
- AVPacket *in;
+ AVPacket *in = &s->pkt;
int ret = 0;
- ret = ff_bsf_get_packet(ctx, &in);
+ ret = ff_bsf_get_packet_ref(ctx, in);
if (ret < 0)
return ret;
@@ -72,17 +73,20 @@ static int dump_extradata(AVBSFContext *ctx, AVPacket *out)
}
fail:
- av_packet_free(&in);
+ av_packet_unref(in);
return ret;
}
#define OFFSET(x) offsetof(DumpExtradataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
static const AVOption options[] = {
{ "freq", "When do dump extradata", OFFSET(freq), AV_OPT_TYPE_INT,
- { .i64 = DUMP_FREQ_KEYFRAME }, DUMP_FREQ_KEYFRAME, DUMP_FREQ_ALL, 0, "freq" },
- { "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME }, .unit = "freq" },
- { "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL }, .unit = "freq" },
+ { .i64 = DUMP_FREQ_KEYFRAME }, DUMP_FREQ_KEYFRAME, DUMP_FREQ_ALL, FLAGS, "freq" },
+ { "k", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME }, .flags = FLAGS, .unit = "freq" },
+ { "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME }, .flags = FLAGS, .unit = "freq" },
+ { "e", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL }, .flags = FLAGS, .unit = "freq" },
+ { "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL }, .flags = FLAGS, .unit = "freq" },
{ NULL },
};
@@ -90,7 +94,7 @@ static const AVClass dump_extradata_class = {
.class_name = "dump_extradata bsf",
.item_name = av_default_item_name,
.option = options,
- .version = LIBAVUTIL_VERSION_MAJOR,
+ .version = LIBAVUTIL_VERSION_INT,
};
const AVBitStreamFilter ff_dump_extradata_bsf = {