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:
commit
052f4f859c
59
ffmpeg.c
59
ffmpeg.c
@ -306,6 +306,7 @@ typedef struct OutputStream {
|
||||
int64_t *forced_kf_pts;
|
||||
int forced_kf_count;
|
||||
int forced_kf_index;
|
||||
char *forced_keyframes;
|
||||
|
||||
/* audio only */
|
||||
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;
|
||||
|
||||
av_freep(&output_streams[i]->forced_keyframes);
|
||||
av_freep(&output_streams[i]->filtered_frame);
|
||||
av_freep(&output_streams[i]->avfilter);
|
||||
av_freep(&output_streams[i]);
|
||||
@ -2763,6 +2765,29 @@ static InputStream *get_input_stream(OutputStream *ost)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
if (ost->forced_keyframes)
|
||||
parse_forced_key_frames(ost->forced_keyframes, ost,
|
||||
ost->st->codec);
|
||||
break;
|
||||
case AVMEDIA_TYPE_SUBTITLE:
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
AVIOContext *line;
|
||||
@ -4596,7 +4601,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
|
||||
if (!ost->stream_copy) {
|
||||
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 *intra_matrix = NULL, *inter_matrix = 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);
|
||||
if (forced_key_frames)
|
||||
parse_forced_key_frames(forced_key_frames, ost);
|
||||
MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
|
||||
if (ost->forced_keyframes)
|
||||
ost->forced_keyframes = av_strdup(ost->forced_keyframes);
|
||||
|
||||
MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st);
|
||||
|
||||
|
@ -38,7 +38,7 @@ typedef struct {
|
||||
struct SwrContext *swr;
|
||||
} 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;
|
||||
char *arg, *ptr = NULL;
|
||||
|
@ -81,7 +81,7 @@ static int get_sample_rate(const char *samplerate)
|
||||
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;
|
||||
int ret;
|
||||
|
@ -288,7 +288,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
|
||||
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;
|
||||
int ret, i;
|
||||
|
@ -473,7 +473,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *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;
|
||||
int i, ret;
|
||||
|
@ -41,7 +41,7 @@ typedef struct {
|
||||
int req_fullfilled;
|
||||
} 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;
|
||||
int ret = 0;
|
||||
|
@ -54,7 +54,7 @@ static const AVOption asetnsamples_options[] = {
|
||||
|
||||
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;
|
||||
int err;
|
||||
|
@ -33,7 +33,7 @@ typedef struct {
|
||||
unsigned int frame;
|
||||
} 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;
|
||||
showinfo->frame = 0;
|
||||
|
@ -60,7 +60,7 @@ typedef struct {
|
||||
|
||||
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;
|
||||
const char *expr = args0 ? args0 : default_expr;
|
||||
|
@ -51,7 +51,7 @@ static const AVOption asyncts_options[] = {
|
||||
|
||||
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;
|
||||
int ret;
|
||||
|
@ -948,7 +948,7 @@ static int yae_flush(ATempoContext *atempo,
|
||||
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;
|
||||
|
||||
|
@ -118,8 +118,7 @@ static int get_channel(char **map, uint64_t *ch, char delim)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int channelmap_init(AVFilterContext *ctx, const char *args,
|
||||
void *opaque)
|
||||
static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
|
||||
{
|
||||
ChannelMapContext *s = ctx->priv;
|
||||
int ret;
|
||||
|
@ -47,7 +47,7 @@ static const AVOption channelsplit_options[] = {
|
||||
|
||||
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;
|
||||
int nb_channels;
|
||||
|
@ -184,7 +184,7 @@ static int parse_maps(AVFilterContext *ctx)
|
||||
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;
|
||||
int ret, i;
|
||||
|
@ -96,7 +96,7 @@ static void skip_spaces(char **arg)
|
||||
*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;
|
||||
char *arg, *arg0, *tokenizer, *args = av_strdup(args0);
|
||||
|
@ -52,7 +52,7 @@ static const AVOption silencedetect_options[] = {
|
||||
|
||||
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;
|
||||
char *tail;
|
||||
|
@ -35,7 +35,7 @@ typedef struct {
|
||||
int volume_i;
|
||||
} 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;
|
||||
char *tail;
|
||||
|
@ -80,7 +80,7 @@ static const AVOption aevalsrc_options[]= {
|
||||
|
||||
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;
|
||||
char *args1 = av_strdup(args);
|
||||
|
@ -56,7 +56,7 @@ static const AVOption anullsrc_options[]= {
|
||||
|
||||
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;
|
||||
int ret;
|
||||
|
@ -547,7 +547,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
|
||||
int ret=0;
|
||||
|
||||
if (filter->filter->init)
|
||||
ret = filter->filter->init(filter, args, opaque);
|
||||
ret = filter->filter->init(filter, args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -568,10 +568,8 @@ typedef struct AVFilter {
|
||||
/**
|
||||
* Filter initialization function. Args contains the user-supplied
|
||||
* 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
|
||||
|
@ -213,7 +213,7 @@ static const AVOption buffer_options[] = {
|
||||
|
||||
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;
|
||||
char pix_fmt_str[128], sws_param[256] = "", *colon, *equal;
|
||||
@ -280,7 +280,7 @@ static const AVOption abuffer_options[] = {
|
||||
|
||||
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;
|
||||
int ret = 0;
|
||||
|
@ -50,7 +50,7 @@ typedef struct {
|
||||
int allocated_samples; ///< number of samples buf_out was allocated for
|
||||
} 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;
|
||||
fifo->last = &fifo->root;
|
||||
|
@ -163,12 +163,15 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
|
||||
|
||||
#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;
|
||||
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,
|
||||
"No opaque field provided\n");
|
||||
buf->pixel_fmts = NULL;
|
||||
@ -228,10 +231,13 @@ static void filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
|
||||
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;
|
||||
AVABufferSinkParams *params = opaque;
|
||||
AVABufferSinkParams *params = NULL;
|
||||
|
||||
// if(args && !strcmp(args, "opaque"))
|
||||
// params = (AVABufferSinkParams *)(args+7);
|
||||
|
||||
if (params && params->sample_fmts) {
|
||||
buf->sample_fmts = ff_copy_int_list (params->sample_fmts);
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "internal.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;
|
||||
|
||||
|
@ -82,7 +82,7 @@ static const AVOption movie_options[]= {
|
||||
|
||||
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)
|
||||
{
|
||||
MovieContext *movie = ctx->priv;
|
||||
@ -198,12 +198,12 @@ static av_cold void movie_common_uninit(AVFilterContext *ctx)
|
||||
|
||||
#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;
|
||||
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;
|
||||
|
||||
movie->w = movie->codec_ctx->width;
|
||||
@ -345,12 +345,12 @@ AVFilter avfilter_vsrc_movie = {
|
||||
|
||||
#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;
|
||||
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;
|
||||
|
||||
movie->bps = av_get_bytes_per_sample(movie->codec_ctx->sample_fmt);
|
||||
|
@ -33,7 +33,7 @@ typedef struct {
|
||||
AVRational ratio;
|
||||
} 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;
|
||||
aspect->ratio = (AVRational) {0, 1};
|
||||
|
@ -79,7 +79,7 @@ static void ass_log(int ass_level, const char *fmt, va_list args, void *ctx)
|
||||
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;
|
||||
int ret;
|
||||
|
@ -34,7 +34,7 @@ typedef struct {
|
||||
int vsub, hsub;
|
||||
} 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;
|
||||
bbox->frame = 0;
|
||||
|
@ -80,7 +80,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
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;
|
||||
BlackDetectContext *blackdetect = ctx->priv;
|
||||
|
@ -53,7 +53,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
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;
|
||||
|
||||
|
@ -77,7 +77,7 @@ typedef struct {
|
||||
#define V 2
|
||||
#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;
|
||||
int e;
|
||||
|
@ -145,7 +145,7 @@ static int get_color_mode_index(const char *name)
|
||||
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;
|
||||
|
||||
|
@ -120,7 +120,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
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;
|
||||
|
||||
|
@ -80,7 +80,7 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i
|
||||
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;
|
||||
|
||||
|
@ -166,7 +166,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
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;
|
||||
int ret = 0;
|
||||
|
@ -331,7 +331,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
||||
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;
|
||||
char filename[256] = {0};
|
||||
|
@ -40,7 +40,7 @@ typedef struct {
|
||||
int vsub, hsub; ///< chroma subsampling
|
||||
} 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;
|
||||
char color_str[1024] = "black";
|
||||
|
@ -379,7 +379,7 @@ static int load_font(AVFilterContext *ctx)
|
||||
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;
|
||||
DrawTextContext *dtext = ctx->priv;
|
||||
@ -574,7 +574,7 @@ static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char
|
||||
int ret;
|
||||
uninit(ctx);
|
||||
dtext->reinit = 1;
|
||||
if ((ret = init(ctx, arg, NULL)) < 0)
|
||||
if ((ret = init(ctx, arg)) < 0)
|
||||
return ret;
|
||||
return config_input(ctx->inputs[0]);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ static const AVOption fade_options[] = {
|
||||
|
||||
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;
|
||||
int ret = 0;
|
||||
|
@ -38,7 +38,7 @@ typedef struct
|
||||
int line_size[4]; ///< bytes of pixel data per line for each plane
|
||||
} 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;
|
||||
|
||||
|
@ -40,7 +40,7 @@ typedef struct {
|
||||
|
||||
#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;
|
||||
const char *cur, *sep;
|
||||
|
@ -62,7 +62,7 @@ static const AVOption fps_options[] = {
|
||||
|
||||
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;
|
||||
int ret;
|
||||
|
@ -278,7 +278,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
|
||||
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;
|
||||
char dl_name[1024], c;
|
||||
@ -381,7 +381,7 @@ AVFilter avfilter_vf_frei0r = {
|
||||
{ .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;
|
||||
char dl_name[1024], c;
|
||||
|
@ -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;
|
||||
float thresh = 1.2;
|
||||
|
@ -197,7 +197,7 @@ static void PrecalcCoefs(int *Ct, double Dist25)
|
||||
#define PARAM2_DEFAULT 3.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;
|
||||
double LumSpac, LumTmp, ChromSpac, ChromTmp;
|
||||
|
@ -292,7 +292,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
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;
|
||||
|
||||
|
@ -71,7 +71,7 @@ static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
int (*init)(AVFilterContext *ctx, const char *args, void *opaque);
|
||||
int (*init)(AVFilterContext *ctx, const char *args);
|
||||
void (*uninit)(AVFilterContext *ctx);
|
||||
void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
|
||||
void *priv;
|
||||
@ -83,7 +83,7 @@ typedef struct {
|
||||
double param3, param4;
|
||||
} 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;
|
||||
SmoothContext *smooth = ocv->priv;
|
||||
@ -249,7 +249,7 @@ typedef struct {
|
||||
IplConvKernel *kernel;
|
||||
} 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;
|
||||
DilateContext *dilate = ocv->priv;
|
||||
@ -303,7 +303,7 @@ static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplIma
|
||||
typedef struct {
|
||||
const char *name;
|
||||
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 (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
|
||||
} OCVFilterEntry;
|
||||
@ -314,7 +314,7 @@ static OCVFilterEntry ocv_filter_entries[] = {
|
||||
{ "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;
|
||||
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)))
|
||||
return AVERROR(ENOMEM);
|
||||
return ocv->init(ctx, priv_args, opaque);
|
||||
return ocv->init(ctx, priv_args);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ static const AVOption lut_options[] = {
|
||||
|
||||
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;
|
||||
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
|
||||
|
||||
static int negate_init(AVFilterContext *ctx, const char *args, void *opaque)
|
||||
static int negate_init(AVFilterContext *ctx, const char *args)
|
||||
{
|
||||
LutContext *lut = ctx->priv;
|
||||
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",
|
||||
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);
|
||||
|
@ -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;
|
||||
char name[256];
|
||||
|
@ -105,7 +105,7 @@ static const AVOption overlay_options[] = {
|
||||
|
||||
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;
|
||||
char *args1 = av_strdup(args);
|
||||
|
@ -90,7 +90,7 @@ typedef struct {
|
||||
int needs_copy;
|
||||
} 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;
|
||||
char color_string[128] = "black";
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
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;
|
||||
int ***mask;
|
||||
|
@ -84,7 +84,7 @@ typedef struct {
|
||||
char h_expr[256]; ///< height expression string
|
||||
} 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;
|
||||
const char *p;
|
||||
|
@ -124,7 +124,7 @@ typedef struct {
|
||||
AVFifoBuffer *pending_frames; ///< FIFO buffer of video frames
|
||||
} 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;
|
||||
int ret;
|
||||
|
@ -37,7 +37,7 @@ typedef struct {
|
||||
enum SetFieldMode mode;
|
||||
} 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;
|
||||
|
||||
|
@ -61,7 +61,7 @@ typedef struct {
|
||||
double var_values[VAR_VARS_NB];
|
||||
} 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;
|
||||
int ret;
|
||||
|
@ -48,7 +48,7 @@ typedef struct {
|
||||
double var_values[VAR_VARS_NB];
|
||||
} 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;
|
||||
av_strlcpy(settb->tb_expr, "intb", sizeof(settb->tb_expr));
|
||||
|
@ -34,7 +34,7 @@ typedef struct {
|
||||
unsigned int frame;
|
||||
} 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;
|
||||
showinfo->frame = 0;
|
||||
|
@ -35,7 +35,7 @@ typedef struct {
|
||||
int use_random_h; ///< enable the use of random slice height values
|
||||
} 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;
|
||||
|
||||
|
@ -44,7 +44,7 @@ typedef struct {
|
||||
int dir;
|
||||
} 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;
|
||||
trans->dir = 0;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
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;
|
||||
int lmsize_x = 5, cmsize_x = 5;
|
||||
|
@ -397,7 +397,7 @@ static int query_formats(AVFilterContext *ctx)
|
||||
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;
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
@ -61,7 +61,7 @@ static const AVOption color_options[]= {
|
||||
|
||||
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;
|
||||
char color_string[128] = "black";
|
||||
|
@ -72,7 +72,7 @@ static const AVOption testsrc_options[]= {
|
||||
{ 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;
|
||||
AVRational frame_rate_q;
|
||||
@ -167,13 +167,13 @@ static const AVClass nullsrc_class = {
|
||||
|
||||
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;
|
||||
|
||||
test->class = &nullsrc_class;
|
||||
test->fill_picture_fn = nullsrc_fill_picture;
|
||||
return init(ctx, args, opaque);
|
||||
return init(ctx, args);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
test->class = &testsrc_class;
|
||||
test->fill_picture_fn = test_fill_picture;
|
||||
return init(ctx, args, opaque);
|
||||
return init(ctx, args);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
test->class = &rgbtestsrc_class;
|
||||
test->fill_picture_fn = rgbtest_fill_picture;
|
||||
return init(ctx, args, opaque);
|
||||
return init(ctx, args);
|
||||
}
|
||||
|
||||
static int rgbtest_query_formats(AVFilterContext *ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user