1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit 'a5e8c41c28f907d98d2a739db08f7aef4cbfcf3a'

* commit 'a5e8c41c28f907d98d2a739db08f7aef4cbfcf3a':
  lavfi: remove 'opaque' parameter from AVFilter.init()
  mov: do not try to read total disc/track number if data atom is too short.
  avconv: fix -force_key_frames
  dxva2_h264: fix signaling of mbaff frames
  x86: fft: elf64: fix PIC build

Conflicts:
	ffmpeg.c
	libavcodec/v210dec.h
	libavfilter/asrc_anullsrc.c
	libavfilter/buffersrc.c
	libavfilter/src_movie.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_overlay.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_testsrc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-26 23:27:59 +02:00
commit 052f4f859c
65 changed files with 126 additions and 118 deletions

View File

@ -306,6 +306,7 @@ typedef struct OutputStream {
int64_t *forced_kf_pts; int64_t *forced_kf_pts;
int forced_kf_count; int forced_kf_count;
int forced_kf_index; int forced_kf_index;
char *forced_keyframes;
/* audio only */ /* audio only */
int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */ int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */
@ -1383,6 +1384,7 @@ void av_noreturn exit_program(int ret)
} }
output_streams[i]->bitstream_filters = NULL; output_streams[i]->bitstream_filters = NULL;
av_freep(&output_streams[i]->forced_keyframes);
av_freep(&output_streams[i]->filtered_frame); av_freep(&output_streams[i]->filtered_frame);
av_freep(&output_streams[i]->avfilter); av_freep(&output_streams[i]->avfilter);
av_freep(&output_streams[i]); av_freep(&output_streams[i]);
@ -2763,6 +2765,29 @@ static InputStream *get_input_stream(OutputStream *ost)
return NULL; return NULL;
} }
static void parse_forced_key_frames(char *kf, OutputStream *ost,
AVCodecContext *avctx)
{
char *p;
int n = 1, i;
int64_t t;
for (p = kf; *p; p++)
if (*p == ',')
n++;
ost->forced_kf_count = n;
ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n);
if (!ost->forced_kf_pts) {
av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
exit_program(1);
}
for (i = 0; i < n; i++) {
p = i ? strchr(p, ',') + 1 : kf;
t = parse_time_or_die("force_key_frames", p, 1);
ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
}
}
static int transcode_init(void) static int transcode_init(void)
{ {
int ret = 0, i, j, k; int ret = 0, i, j, k;
@ -2997,6 +3022,9 @@ static int transcode_init(void)
codec->bits_per_raw_sample = frame_bits_per_raw_sample; codec->bits_per_raw_sample = frame_bits_per_raw_sample;
} }
if (ost->forced_keyframes)
parse_forced_key_frames(ost->forced_keyframes, ost,
ost->st->codec);
break; break;
case AVMEDIA_TYPE_SUBTITLE: case AVMEDIA_TYPE_SUBTITLE:
codec->time_base = (AVRational){1, 1000}; codec->time_base = (AVRational){1, 1000};
@ -4362,29 +4390,6 @@ static int opt_input_file(OptionsContext *o, const char *opt, const char *filena
return 0; return 0;
} }
static void parse_forced_key_frames(char *kf, OutputStream *ost)
{
char *p;
int n = 1, i;
for (p = kf; *p; p++)
if (*p == ',')
n++;
ost->forced_kf_count = n;
ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n);
if (!ost->forced_kf_pts) {
av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
exit_program(1);
}
p = kf;
for (i = 0; i < n; i++) {
char *next = strchr(p, ',');
if (next) *next++ = 0;
ost->forced_kf_pts[i] = parse_time_or_die("force_key_frames", p, 1);
p = next;
}
}
static uint8_t *get_line(AVIOContext *s) static uint8_t *get_line(AVIOContext *s)
{ {
AVIOContext *line; AVIOContext *line;
@ -4596,7 +4601,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
if (!ost->stream_copy) { if (!ost->stream_copy) {
const char *p = NULL; const char *p = NULL;
char *forced_key_frames = NULL, *frame_size = NULL; char *frame_size = NULL;
char *frame_aspect_ratio = NULL, *frame_pix_fmt = NULL; char *frame_aspect_ratio = NULL, *frame_pix_fmt = NULL;
char *intra_matrix = NULL, *inter_matrix = NULL; char *intra_matrix = NULL, *inter_matrix = NULL;
const char *filters = "null"; const char *filters = "null";
@ -4694,9 +4699,9 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
} }
} }
MATCH_PER_STREAM_OPT(forced_key_frames, str, forced_key_frames, oc, st); MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
if (forced_key_frames) if (ost->forced_keyframes)
parse_forced_key_frames(forced_key_frames, ost); ost->forced_keyframes = av_strdup(ost->forced_keyframes);
MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st); MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st);

View File

@ -38,7 +38,7 @@ typedef struct {
struct SwrContext *swr; struct SwrContext *swr;
} AConvertContext; } AConvertContext;
static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args0)
{ {
AConvertContext *aconvert = ctx->priv; AConvertContext *aconvert = ctx->priv;
char *arg, *ptr = NULL; char *arg, *ptr = NULL;

View File

@ -81,7 +81,7 @@ static int get_sample_rate(const char *samplerate)
return FFMAX(ret, 0); return FFMAX(ret, 0);
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
AFormatContext *s = ctx->priv; AFormatContext *s = ctx->priv;
int ret; int ret;

View File

@ -288,7 +288,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
ff_filter_samples(ctx->outputs[0], outbuf); ff_filter_samples(ctx->outputs[0], outbuf);
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
AMergeContext *am = ctx->priv; AMergeContext *am = ctx->priv;
int ret, i; int ret, i;

View File

@ -473,7 +473,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
avfilter_unref_buffer(buf); avfilter_unref_buffer(buf);
} }
static int init(AVFilterContext *ctx, const char *args, void *opaque) static int init(AVFilterContext *ctx, const char *args)
{ {
MixContext *s = ctx->priv; MixContext *s = ctx->priv;
int i, ret; int i, ret;

View File

@ -41,7 +41,7 @@ typedef struct {
int req_fullfilled; int req_fullfilled;
} AResampleContext; } AResampleContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
AResampleContext *aresample = ctx->priv; AResampleContext *aresample = ctx->priv;
int ret = 0; int ret = 0;

View File

@ -54,7 +54,7 @@ static const AVOption asetnsamples_options[] = {
AVFILTER_DEFINE_CLASS(asetnsamples); AVFILTER_DEFINE_CLASS(asetnsamples);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
ASNSContext *asns = ctx->priv; ASNSContext *asns = ctx->priv;
int err; int err;

View File

@ -33,7 +33,7 @@ typedef struct {
unsigned int frame; unsigned int frame;
} ShowInfoContext; } ShowInfoContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
ShowInfoContext *showinfo = ctx->priv; ShowInfoContext *showinfo = ctx->priv;
showinfo->frame = 0; showinfo->frame = 0;

View File

@ -60,7 +60,7 @@ typedef struct {
static const char *default_expr = "t1-t2"; static const char *default_expr = "t1-t2";
static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args0)
{ {
AStreamSyncContext *as = ctx->priv; AStreamSyncContext *as = ctx->priv;
const char *expr = args0 ? args0 : default_expr; const char *expr = args0 ? args0 : default_expr;

View File

@ -51,7 +51,7 @@ static const AVOption asyncts_options[] = {
AVFILTER_DEFINE_CLASS(asyncts); AVFILTER_DEFINE_CLASS(asyncts);
static int init(AVFilterContext *ctx, const char *args, void *opaque) static int init(AVFilterContext *ctx, const char *args)
{ {
ASyncContext *s = ctx->priv; ASyncContext *s = ctx->priv;
int ret; int ret;

View File

@ -948,7 +948,7 @@ static int yae_flush(ATempoContext *atempo,
return atempo->position[1] == stop_here ? 0 : AVERROR(EAGAIN); return atempo->position[1] == stop_here ? 0 : AVERROR(EAGAIN);
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
ATempoContext *atempo = ctx->priv; ATempoContext *atempo = ctx->priv;

View File

@ -118,8 +118,7 @@ static int get_channel(char **map, uint64_t *ch, char delim)
return 0; return 0;
} }
static av_cold int channelmap_init(AVFilterContext *ctx, const char *args, static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
void *opaque)
{ {
ChannelMapContext *s = ctx->priv; ChannelMapContext *s = ctx->priv;
int ret; int ret;

View File

@ -47,7 +47,7 @@ static const AVOption channelsplit_options[] = {
AVFILTER_DEFINE_CLASS(channelsplit); AVFILTER_DEFINE_CLASS(channelsplit);
static int init(AVFilterContext *ctx, const char *arg, void *opaque) static int init(AVFilterContext *ctx, const char *arg)
{ {
ChannelSplitContext *s = ctx->priv; ChannelSplitContext *s = ctx->priv;
int nb_channels; int nb_channels;

View File

@ -184,7 +184,7 @@ static int parse_maps(AVFilterContext *ctx)
return 0; return 0;
} }
static int join_init(AVFilterContext *ctx, const char *args, void *opaque) static int join_init(AVFilterContext *ctx, const char *args)
{ {
JoinContext *s = ctx->priv; JoinContext *s = ctx->priv;
int ret, i; int ret, i;

View File

@ -96,7 +96,7 @@ static void skip_spaces(char **arg)
*arg += len; *arg += len;
} }
static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args0)
{ {
PanContext *const pan = ctx->priv; PanContext *const pan = ctx->priv;
char *arg, *arg0, *tokenizer, *args = av_strdup(args0); char *arg, *arg0, *tokenizer, *args = av_strdup(args0);

View File

@ -52,7 +52,7 @@ static const AVOption silencedetect_options[] = {
AVFILTER_DEFINE_CLASS(silencedetect); AVFILTER_DEFINE_CLASS(silencedetect);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
int ret; int ret;
char *tail; char *tail;

View File

@ -35,7 +35,7 @@ typedef struct {
int volume_i; int volume_i;
} VolumeContext; } VolumeContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
VolumeContext *vol = ctx->priv; VolumeContext *vol = ctx->priv;
char *tail; char *tail;

View File

@ -80,7 +80,7 @@ static const AVOption aevalsrc_options[]= {
AVFILTER_DEFINE_CLASS(aevalsrc); AVFILTER_DEFINE_CLASS(aevalsrc);
static int init(AVFilterContext *ctx, const char *args, void *opaque) static int init(AVFilterContext *ctx, const char *args)
{ {
EvalContext *eval = ctx->priv; EvalContext *eval = ctx->priv;
char *args1 = av_strdup(args); char *args1 = av_strdup(args);

View File

@ -56,7 +56,7 @@ static const AVOption anullsrc_options[]= {
AVFILTER_DEFINE_CLASS(anullsrc); AVFILTER_DEFINE_CLASS(anullsrc);
static int init(AVFilterContext *ctx, const char *args, void *opaque) static int init(AVFilterContext *ctx, const char *args)
{ {
ANullContext *null = ctx->priv; ANullContext *null = ctx->priv;
int ret; int ret;

View File

@ -547,7 +547,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
int ret=0; int ret=0;
if (filter->filter->init) if (filter->filter->init)
ret = filter->filter->init(filter, args, opaque); ret = filter->filter->init(filter, args);
return ret; return ret;
} }

View File

@ -568,10 +568,8 @@ typedef struct AVFilter {
/** /**
* Filter initialization function. Args contains the user-supplied * Filter initialization function. Args contains the user-supplied
* parameters. FIXME: maybe an AVOption-based system would be better? * parameters. FIXME: maybe an AVOption-based system would be better?
* opaque is data provided by the code requesting creation of the filter,
* and is used to pass data to the filter.
*/ */
int (*init)(AVFilterContext *ctx, const char *args, void *opaque); int (*init)(AVFilterContext *ctx, const char *args);
/** /**
* Filter uninitialization function. Should deallocate any memory held * Filter uninitialization function. Should deallocate any memory held

View File

@ -213,7 +213,7 @@ static const AVOption buffer_options[] = {
AVFILTER_DEFINE_CLASS(buffer); AVFILTER_DEFINE_CLASS(buffer);
static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init_video(AVFilterContext *ctx, const char *args)
{ {
BufferSourceContext *c = ctx->priv; BufferSourceContext *c = ctx->priv;
char pix_fmt_str[128], sws_param[256] = "", *colon, *equal; char pix_fmt_str[128], sws_param[256] = "", *colon, *equal;
@ -280,7 +280,7 @@ static const AVOption abuffer_options[] = {
AVFILTER_DEFINE_CLASS(abuffer); AVFILTER_DEFINE_CLASS(abuffer);
static av_cold int init_audio(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init_audio(AVFilterContext *ctx, const char *args)
{ {
BufferSourceContext *s = ctx->priv; BufferSourceContext *s = ctx->priv;
int ret = 0; int ret = 0;

View File

@ -50,7 +50,7 @@ typedef struct {
int allocated_samples; ///< number of samples buf_out was allocated for int allocated_samples; ///< number of samples buf_out was allocated for
} FifoContext; } FifoContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
FifoContext *fifo = ctx->priv; FifoContext *fifo = ctx->priv;
fifo->last = &fifo->root; fifo->last = &fifo->root;

View File

@ -163,12 +163,15 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
#if CONFIG_BUFFERSINK_FILTER #if CONFIG_BUFFERSINK_FILTER
static av_cold int vsink_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int vsink_init(AVFilterContext *ctx, const char *args)
{ {
BufferSinkContext *buf = ctx->priv; BufferSinkContext *buf = ctx->priv;
AVBufferSinkParams *params = (AVBufferSinkParams *)opaque; AVBufferSinkParams *params = NULL;
if (!opaque) { // if(args && !strcmp(args, "opaque"))
// params = (AVBufferSinkParams *)(args+7);
if (!params) {
av_log(ctx, AV_LOG_WARNING, av_log(ctx, AV_LOG_WARNING,
"No opaque field provided\n"); "No opaque field provided\n");
buf->pixel_fmts = NULL; buf->pixel_fmts = NULL;
@ -228,10 +231,13 @@ static void filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
end_frame(link); end_frame(link);
} }
static av_cold int asink_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int asink_init(AVFilterContext *ctx, const char *args)
{ {
BufferSinkContext *buf = ctx->priv; BufferSinkContext *buf = ctx->priv;
AVABufferSinkParams *params = opaque; AVABufferSinkParams *params = NULL;
// if(args && !strcmp(args, "opaque"))
// params = (AVABufferSinkParams *)(args+7);
if (params && params->sample_fmts) { if (params && params->sample_fmts) {
buf->sample_fmts = ff_copy_int_list (params->sample_fmts); buf->sample_fmts = ff_copy_int_list (params->sample_fmts);

View File

@ -28,7 +28,7 @@
#include "internal.h" #include "internal.h"
#include "video.h" #include "video.h"
static int split_init(AVFilterContext *ctx, const char *args, void *opaque) static int split_init(AVFilterContext *ctx, const char *args)
{ {
int i, nb_outputs = 2; int i, nb_outputs = 2;

View File

@ -82,7 +82,7 @@ static const AVOption movie_options[]= {
AVFILTER_DEFINE_CLASS(movie); AVFILTER_DEFINE_CLASS(movie);
static av_cold int movie_common_init(AVFilterContext *ctx, const char *args, void *opaque, static av_cold int movie_common_init(AVFilterContext *ctx, const char *args,
enum AVMediaType type) enum AVMediaType type)
{ {
MovieContext *movie = ctx->priv; MovieContext *movie = ctx->priv;
@ -198,12 +198,12 @@ static av_cold void movie_common_uninit(AVFilterContext *ctx)
#if CONFIG_MOVIE_FILTER #if CONFIG_MOVIE_FILTER
static av_cold int movie_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int movie_init(AVFilterContext *ctx, const char *args)
{ {
MovieContext *movie = ctx->priv; MovieContext *movie = ctx->priv;
int ret; int ret;
if ((ret = movie_common_init(ctx, args, opaque, AVMEDIA_TYPE_VIDEO)) < 0) if ((ret = movie_common_init(ctx, args, AVMEDIA_TYPE_VIDEO)) < 0)
return ret; return ret;
movie->w = movie->codec_ctx->width; movie->w = movie->codec_ctx->width;
@ -345,12 +345,12 @@ AVFilter avfilter_vsrc_movie = {
#if CONFIG_AMOVIE_FILTER #if CONFIG_AMOVIE_FILTER
static av_cold int amovie_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int amovie_init(AVFilterContext *ctx, const char *args)
{ {
MovieContext *movie = ctx->priv; MovieContext *movie = ctx->priv;
int ret; int ret;
if ((ret = movie_common_init(ctx, args, opaque, AVMEDIA_TYPE_AUDIO)) < 0) if ((ret = movie_common_init(ctx, args, AVMEDIA_TYPE_AUDIO)) < 0)
return ret; return ret;
movie->bps = av_get_bytes_per_sample(movie->codec_ctx->sample_fmt); movie->bps = av_get_bytes_per_sample(movie->codec_ctx->sample_fmt);

View File

@ -33,7 +33,7 @@ typedef struct {
AVRational ratio; AVRational ratio;
} AspectContext; } AspectContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
AspectContext *aspect = ctx->priv; AspectContext *aspect = ctx->priv;
aspect->ratio = (AVRational) {0, 1}; aspect->ratio = (AVRational) {0, 1};

View File

@ -79,7 +79,7 @@ static void ass_log(int ass_level, const char *fmt, va_list args, void *ctx)
av_log(ctx, level, "\n"); av_log(ctx, level, "\n");
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
AssContext *ass = ctx->priv; AssContext *ass = ctx->priv;
int ret; int ret;

View File

@ -34,7 +34,7 @@ typedef struct {
int vsub, hsub; int vsub, hsub;
} BBoxContext; } BBoxContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
BBoxContext *bbox = ctx->priv; BBoxContext *bbox = ctx->priv;
bbox->frame = 0; bbox->frame = 0;

View File

@ -80,7 +80,7 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
int ret; int ret;
BlackDetectContext *blackdetect = ctx->priv; BlackDetectContext *blackdetect = ctx->priv;

View File

@ -53,7 +53,7 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
BlackFrameContext *blackframe = ctx->priv; BlackFrameContext *blackframe = ctx->priv;

View File

@ -77,7 +77,7 @@ typedef struct {
#define V 2 #define V 2
#define A 3 #define A 3
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
BoxBlurContext *boxblur = ctx->priv; BoxBlurContext *boxblur = ctx->priv;
int e; int e;

View File

@ -145,7 +145,7 @@ static int get_color_mode_index(const char *name)
return -1; return -1;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
ColorMatrixContext *color = ctx->priv; ColorMatrixContext *color = ctx->priv;

View File

@ -120,7 +120,7 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
CropContext *crop = ctx->priv; CropContext *crop = ctx->priv;

View File

@ -80,7 +80,7 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i
return total; return total;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
CropDetectContext *cd = ctx->priv; CropDetectContext *cd = ctx->priv;

View File

@ -166,7 +166,7 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
DelogoContext *delogo = ctx->priv; DelogoContext *delogo = ctx->priv;
int ret = 0; int ret = 0;

View File

@ -331,7 +331,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
av_free(angles); av_free(angles);
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
DeshakeContext *deshake = ctx->priv; DeshakeContext *deshake = ctx->priv;
char filename[256] = {0}; char filename[256] = {0};

View File

@ -40,7 +40,7 @@ typedef struct {
int vsub, hsub; ///< chroma subsampling int vsub, hsub; ///< chroma subsampling
} DrawBoxContext; } DrawBoxContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
DrawBoxContext *drawbox= ctx->priv; DrawBoxContext *drawbox= ctx->priv;
char color_str[1024] = "black"; char color_str[1024] = "black";

View File

@ -379,7 +379,7 @@ static int load_font(AVFilterContext *ctx)
return err; return err;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
int err; int err;
DrawTextContext *dtext = ctx->priv; DrawTextContext *dtext = ctx->priv;
@ -574,7 +574,7 @@ static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char
int ret; int ret;
uninit(ctx); uninit(ctx);
dtext->reinit = 1; dtext->reinit = 1;
if ((ret = init(ctx, arg, NULL)) < 0) if ((ret = init(ctx, arg)) < 0)
return ret; return ret;
return config_input(ctx->inputs[0]); return config_input(ctx->inputs[0]);
} }

View File

@ -73,7 +73,7 @@ static const AVOption fade_options[] = {
AVFILTER_DEFINE_CLASS(fade); AVFILTER_DEFINE_CLASS(fade);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
FadeContext *fade = ctx->priv; FadeContext *fade = ctx->priv;
int ret = 0; int ret = 0;

View File

@ -38,7 +38,7 @@ typedef struct
int line_size[4]; ///< bytes of pixel data per line for each plane int line_size[4]; ///< bytes of pixel data per line for each plane
} FieldOrderContext; } FieldOrderContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
FieldOrderContext *fieldorder = ctx->priv; FieldOrderContext *fieldorder = ctx->priv;

View File

@ -40,7 +40,7 @@ typedef struct {
#define PIX_FMT_NAME_MAXSIZE 32 #define PIX_FMT_NAME_MAXSIZE 32
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
FormatContext *format = ctx->priv; FormatContext *format = ctx->priv;
const char *cur, *sep; const char *cur, *sep;

View File

@ -62,7 +62,7 @@ static const AVOption fps_options[] = {
AVFILTER_DEFINE_CLASS(fps); AVFILTER_DEFINE_CLASS(fps);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
FPSContext *s = ctx->priv; FPSContext *s = ctx->priv;
int ret; int ret;

View File

@ -278,7 +278,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
return 0; return 0;
} }
static av_cold int filter_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int filter_init(AVFilterContext *ctx, const char *args)
{ {
Frei0rContext *frei0r = ctx->priv; Frei0rContext *frei0r = ctx->priv;
char dl_name[1024], c; char dl_name[1024], c;
@ -381,7 +381,7 @@ AVFilter avfilter_vf_frei0r = {
{ .name = NULL}}, { .name = NULL}},
}; };
static av_cold int source_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int source_init(AVFilterContext *ctx, const char *args)
{ {
Frei0rContext *frei0r = ctx->priv; Frei0rContext *frei0r = ctx->priv;
char dl_name[1024], c; char dl_name[1024], c;

View File

@ -118,7 +118,7 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi
} }
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
GradFunContext *gf = ctx->priv; GradFunContext *gf = ctx->priv;
float thresh = 1.2; float thresh = 1.2;

View File

@ -197,7 +197,7 @@ static void PrecalcCoefs(int *Ct, double Dist25)
#define PARAM2_DEFAULT 3.0 #define PARAM2_DEFAULT 3.0
#define PARAM3_DEFAULT 6.0 #define PARAM3_DEFAULT 6.0
static int init(AVFilterContext *ctx, const char *args, void *opaque) static int init(AVFilterContext *ctx, const char *args)
{ {
HQDN3DContext *hqdn3d = ctx->priv; HQDN3DContext *hqdn3d = ctx->priv;
double LumSpac, LumTmp, ChromSpac, ChromTmp; double LumSpac, LumTmp, ChromSpac, ChromTmp;

View File

@ -292,7 +292,7 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
IDETContext *idet = ctx->priv; IDETContext *idet = ctx->priv;

View File

@ -71,7 +71,7 @@ static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
typedef struct { typedef struct {
const char *name; const char *name;
int (*init)(AVFilterContext *ctx, const char *args, void *opaque); int (*init)(AVFilterContext *ctx, const char *args);
void (*uninit)(AVFilterContext *ctx); void (*uninit)(AVFilterContext *ctx);
void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
void *priv; void *priv;
@ -83,7 +83,7 @@ typedef struct {
double param3, param4; double param3, param4;
} SmoothContext; } SmoothContext;
static av_cold int smooth_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int smooth_init(AVFilterContext *ctx, const char *args)
{ {
OCVContext *ocv = ctx->priv; OCVContext *ocv = ctx->priv;
SmoothContext *smooth = ocv->priv; SmoothContext *smooth = ocv->priv;
@ -249,7 +249,7 @@ typedef struct {
IplConvKernel *kernel; IplConvKernel *kernel;
} DilateContext; } DilateContext;
static av_cold int dilate_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int dilate_init(AVFilterContext *ctx, const char *args)
{ {
OCVContext *ocv = ctx->priv; OCVContext *ocv = ctx->priv;
DilateContext *dilate = ocv->priv; DilateContext *dilate = ocv->priv;
@ -303,7 +303,7 @@ static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplIma
typedef struct { typedef struct {
const char *name; const char *name;
size_t priv_size; size_t priv_size;
int (*init)(AVFilterContext *ctx, const char *args, void *opaque); int (*init)(AVFilterContext *ctx, const char *args);
void (*uninit)(AVFilterContext *ctx); void (*uninit)(AVFilterContext *ctx);
void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
} OCVFilterEntry; } OCVFilterEntry;
@ -314,7 +314,7 @@ static OCVFilterEntry ocv_filter_entries[] = {
{ "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter }, { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter },
}; };
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
OCVContext *ocv = ctx->priv; OCVContext *ocv = ctx->priv;
char name[128], priv_args[1024]; char name[128], priv_args[1024];
@ -333,7 +333,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
if (!(ocv->priv = av_mallocz(entry->priv_size))) if (!(ocv->priv = av_mallocz(entry->priv_size)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
return ocv->init(ctx, priv_args, opaque); return ocv->init(ctx, priv_args);
} }
} }

View File

@ -93,7 +93,7 @@ static const AVOption lut_options[] = {
AVFILTER_DEFINE_CLASS(lut); AVFILTER_DEFINE_CLASS(lut);
static int init(AVFilterContext *ctx, const char *args, void *opaque) static int init(AVFilterContext *ctx, const char *args)
{ {
LutContext *lut = ctx->priv; LutContext *lut = ctx->priv;
int ret; int ret;
@ -368,7 +368,7 @@ DEFINE_LUT_FILTER(lutrgb, "Compute and apply a lookup table to the RGB input vid
#if CONFIG_NEGATE_FILTER #if CONFIG_NEGATE_FILTER
static int negate_init(AVFilterContext *ctx, const char *args, void *opaque) static int negate_init(AVFilterContext *ctx, const char *args)
{ {
LutContext *lut = ctx->priv; LutContext *lut = ctx->priv;
char lut_params[64]; char lut_params[64];
@ -381,7 +381,7 @@ static int negate_init(AVFilterContext *ctx, const char *args, void *opaque)
snprintf(lut_params, sizeof(lut_params), "c0=negval:c1=negval:c2=negval:a=%s", snprintf(lut_params, sizeof(lut_params), "c0=negval:c1=negval:c2=negval:a=%s",
lut->negate_alpha ? "negval" : "val"); lut->negate_alpha ? "negval" : "val");
return init(ctx, lut_params, opaque); return init(ctx, lut_params);
} }
DEFINE_LUT_FILTER(negate, "Negate input video.", negate_init); DEFINE_LUT_FILTER(negate, "Negate input video.", negate_init);

View File

@ -699,7 +699,7 @@ static int vf_default_query_format(struct vf_instance *vf, unsigned int fmt){
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
MPContext *m = ctx->priv; MPContext *m = ctx->priv;
char name[256]; char name[256];

View File

@ -105,7 +105,7 @@ static const AVOption overlay_options[] = {
AVFILTER_DEFINE_CLASS(overlay); AVFILTER_DEFINE_CLASS(overlay);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
OverlayContext *over = ctx->priv; OverlayContext *over = ctx->priv;
char *args1 = av_strdup(args); char *args1 = av_strdup(args);

View File

@ -90,7 +90,7 @@ typedef struct {
int needs_copy; int needs_copy;
} PadContext; } PadContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
PadContext *pad = ctx->priv; PadContext *pad = ctx->priv;
char color_string[128] = "black"; char color_string[128] = "black";

View File

@ -263,7 +263,7 @@ static void generate_half_size_image(const uint8_t *src_data, int src_linesize,
src_w/2, src_h/2, 0, max_mask_size); src_w/2, src_h/2, 0, max_mask_size);
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
RemovelogoContext *removelogo = ctx->priv; RemovelogoContext *removelogo = ctx->priv;
int ***mask; int ***mask;

View File

@ -84,7 +84,7 @@ typedef struct {
char h_expr[256]; ///< height expression string char h_expr[256]; ///< height expression string
} ScaleContext; } ScaleContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
ScaleContext *scale = ctx->priv; ScaleContext *scale = ctx->priv;
const char *p; const char *p;

View File

@ -124,7 +124,7 @@ typedef struct {
AVFifoBuffer *pending_frames; ///< FIFO buffer of video frames AVFifoBuffer *pending_frames; ///< FIFO buffer of video frames
} SelectContext; } SelectContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
SelectContext *select = ctx->priv; SelectContext *select = ctx->priv;
int ret; int ret;

View File

@ -37,7 +37,7 @@ typedef struct {
enum SetFieldMode mode; enum SetFieldMode mode;
} SetFieldContext; } SetFieldContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
SetFieldContext *setfield = ctx->priv; SetFieldContext *setfield = ctx->priv;

View File

@ -61,7 +61,7 @@ typedef struct {
double var_values[VAR_VARS_NB]; double var_values[VAR_VARS_NB];
} SetPTSContext; } SetPTSContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
SetPTSContext *setpts = ctx->priv; SetPTSContext *setpts = ctx->priv;
int ret; int ret;

View File

@ -48,7 +48,7 @@ typedef struct {
double var_values[VAR_VARS_NB]; double var_values[VAR_VARS_NB];
} SetTBContext; } SetTBContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
SetTBContext *settb = ctx->priv; SetTBContext *settb = ctx->priv;
av_strlcpy(settb->tb_expr, "intb", sizeof(settb->tb_expr)); av_strlcpy(settb->tb_expr, "intb", sizeof(settb->tb_expr));

View File

@ -34,7 +34,7 @@ typedef struct {
unsigned int frame; unsigned int frame;
} ShowInfoContext; } ShowInfoContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
ShowInfoContext *showinfo = ctx->priv; ShowInfoContext *showinfo = ctx->priv;
showinfo->frame = 0; showinfo->frame = 0;

View File

@ -35,7 +35,7 @@ typedef struct {
int use_random_h; ///< enable the use of random slice height values int use_random_h; ///< enable the use of random slice height values
} SliceContext; } SliceContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
SliceContext *slice = ctx->priv; SliceContext *slice = ctx->priv;

View File

@ -44,7 +44,7 @@ typedef struct {
int dir; int dir;
} TransContext; } TransContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
TransContext *trans = ctx->priv; TransContext *trans = ctx->priv;
trans->dir = 0; trans->dir = 0;

View File

@ -132,7 +132,7 @@ static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, double a
fp->halfscale = 1 << (fp->scalebits - 1); fp->halfscale = 1 << (fp->scalebits - 1);
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
UnsharpContext *unsharp = ctx->priv; UnsharpContext *unsharp = ctx->priv;
int lmsize_x = 5, cmsize_x = 5; int lmsize_x = 5, cmsize_x = 5;

View File

@ -397,7 +397,7 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
YADIFContext *yadif = ctx->priv; YADIFContext *yadif = ctx->priv;
int cpu_flags = av_get_cpu_flags(); int cpu_flags = av_get_cpu_flags();

View File

@ -61,7 +61,7 @@ static const AVOption color_options[]= {
AVFILTER_DEFINE_CLASS(color); AVFILTER_DEFINE_CLASS(color);
static av_cold int color_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int color_init(AVFilterContext *ctx, const char *args)
{ {
ColorContext *color = ctx->priv; ColorContext *color = ctx->priv;
char color_string[128] = "black"; char color_string[128] = "black";

View File

@ -72,7 +72,7 @@ static const AVOption testsrc_options[]= {
{ NULL }, { NULL },
}; };
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
TestSourceContext *test = ctx->priv; TestSourceContext *test = ctx->priv;
AVRational frame_rate_q; AVRational frame_rate_q;
@ -167,13 +167,13 @@ static const AVClass nullsrc_class = {
static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { } static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { }
static av_cold int nullsrc_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int nullsrc_init(AVFilterContext *ctx, const char *args)
{ {
TestSourceContext *test = ctx->priv; TestSourceContext *test = ctx->priv;
test->class = &nullsrc_class; test->class = &nullsrc_class;
test->fill_picture_fn = nullsrc_fill_picture; test->fill_picture_fn = nullsrc_fill_picture;
return init(ctx, args, opaque); return init(ctx, args);
} }
AVFilter avfilter_vsrc_nullsrc = { AVFilter avfilter_vsrc_nullsrc = {
@ -373,13 +373,13 @@ static void test_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
} }
} }
static av_cold int test_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int test_init(AVFilterContext *ctx, const char *args)
{ {
TestSourceContext *test = ctx->priv; TestSourceContext *test = ctx->priv;
test->class = &testsrc_class; test->class = &testsrc_class;
test->fill_picture_fn = test_fill_picture; test->fill_picture_fn = test_fill_picture;
return init(ctx, args, opaque); return init(ctx, args);
} }
static int test_query_formats(AVFilterContext *ctx) static int test_query_formats(AVFilterContext *ctx)
@ -476,13 +476,13 @@ static void rgbtest_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref
} }
} }
static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args)
{ {
TestSourceContext *test = ctx->priv; TestSourceContext *test = ctx->priv;
test->class = &rgbtestsrc_class; test->class = &rgbtestsrc_class;
test->fill_picture_fn = rgbtest_fill_picture; test->fill_picture_fn = rgbtest_fill_picture;
return init(ctx, args, opaque); return init(ctx, args);
} }
static int rgbtest_query_formats(AVFilterContext *ctx) static int rgbtest_query_formats(AVFilterContext *ctx)