You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Merge commit 'e4a7b2177d14678ae240edcabaacfe2b14619b7b'
* commit 'e4a7b2177d14678ae240edcabaacfe2b14619b7b': vf_showinfo: remove its useless init function AVOptions: fix using named constants with child contexts. Conflicts: libavutil/opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -35,13 +35,6 @@ typedef struct {
|
|||||||
unsigned int frame;
|
unsigned int frame;
|
||||||
} ShowInfoContext;
|
} ShowInfoContext;
|
||||||
|
|
||||||
static av_cold int init(AVFilterContext *ctx, const char *args)
|
|
||||||
{
|
|
||||||
ShowInfoContext *showinfo = ctx->priv;
|
|
||||||
showinfo->frame = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
@@ -111,7 +104,6 @@ AVFilter avfilter_vf_showinfo = {
|
|||||||
.description = NULL_IF_CONFIG_SMALL("Show textual information for each video frame."),
|
.description = NULL_IF_CONFIG_SMALL("Show textual information for each video frame."),
|
||||||
|
|
||||||
.priv_size = sizeof(ShowInfoContext),
|
.priv_size = sizeof(ShowInfoContext),
|
||||||
.init = init,
|
|
||||||
|
|
||||||
.inputs = avfilter_vf_showinfo_inputs,
|
.inputs = avfilter_vf_showinfo_inputs,
|
||||||
|
|
||||||
|
@@ -177,7 +177,7 @@ static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **d
|
|||||||
opt->type == AV_OPT_TYPE_INT) ? \
|
opt->type == AV_OPT_TYPE_INT) ? \
|
||||||
opt->default_val.i64 : opt->default_val.dbl)
|
opt->default_val.i64 : opt->default_val.dbl)
|
||||||
|
|
||||||
static int set_string_number(void *obj, const AVOption *o, const char *val, void *dst)
|
static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)
|
||||||
{
|
{
|
||||||
int ret = 0, notfirst = 0;
|
int ret = 0, notfirst = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -200,7 +200,7 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
|
|||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
const AVOption *o_named = av_opt_find(obj, buf, o->unit, 0, 0);
|
const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);
|
||||||
if (o_named && o_named->type == AV_OPT_TYPE_CONST)
|
if (o_named && o_named->type == AV_OPT_TYPE_CONST)
|
||||||
d = DEFAULT_NUMVAL(o_named);
|
d = DEFAULT_NUMVAL(o_named);
|
||||||
else if (!strcmp(buf, "default")) d = DEFAULT_NUMVAL(o);
|
else if (!strcmp(buf, "default")) d = DEFAULT_NUMVAL(o);
|
||||||
@@ -268,7 +268,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
|
|||||||
case AV_OPT_TYPE_INT64:
|
case AV_OPT_TYPE_INT64:
|
||||||
case AV_OPT_TYPE_FLOAT:
|
case AV_OPT_TYPE_FLOAT:
|
||||||
case AV_OPT_TYPE_DOUBLE:
|
case AV_OPT_TYPE_DOUBLE:
|
||||||
case AV_OPT_TYPE_RATIONAL: return set_string_number(obj, o, val, dst);
|
case AV_OPT_TYPE_RATIONAL: return set_string_number(obj, target_obj, o, val, dst);
|
||||||
case AV_OPT_TYPE_IMAGE_SIZE:
|
case AV_OPT_TYPE_IMAGE_SIZE:
|
||||||
if (!val || !strcmp(val, "none")) {
|
if (!val || !strcmp(val, "none")) {
|
||||||
*(int *)dst = *((int *)dst + 1) = 0;
|
*(int *)dst = *((int *)dst + 1) = 0;
|
||||||
@@ -321,7 +321,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
|
|||||||
{\
|
{\
|
||||||
if (!o || o->type != opttype)\
|
if (!o || o->type != opttype)\
|
||||||
return AVERROR(EINVAL);\
|
return AVERROR(EINVAL);\
|
||||||
return set_string_number(obj, o, val, name ## _out);\
|
return set_string_number(obj, obj, o, val, name ## _out);\
|
||||||
}
|
}
|
||||||
|
|
||||||
OPT_EVAL_NUMBER(flags, AV_OPT_TYPE_FLAGS, int)
|
OPT_EVAL_NUMBER(flags, AV_OPT_TYPE_FLAGS, int)
|
||||||
|
Reference in New Issue
Block a user