* 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
Unified · Split
| @@ -306,6 +306,7 @@ typedef struct OutputStream { · 305 unmodified lines | |||
| 306 | int64_t *forced_kf_pts; | 306 | int64_t *forced_kf_pts; |
| 307 | int forced_kf_count; | 307 | int forced_kf_count; |
| 308 | int forced_kf_index; | 308 | int forced_kf_index; |
| 309 | char *forced_keyframes; | ||
| 309 | 310 | ||
| 310 | /* audio only */ | 311 | /* audio only */ |
| 311 | int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */ | 312 | 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) · 1071 unmodified lines | |||
| 1383 | } | 1384 | } |
| 1384 | output_streams[i]->bitstream_filters = NULL; | 1385 | output_streams[i]->bitstream_filters = NULL; |
| 1385 | 1386 | ||
| 1387 | av_freep(&output_streams[i]->forced_keyframes); | ||
| 1386 | av_freep(&output_streams[i]->filtered_frame); | 1388 | av_freep(&output_streams[i]->filtered_frame); |
| 1387 | av_freep(&output_streams[i]->avfilter); | 1389 | av_freep(&output_streams[i]->avfilter); |
| 1388 | av_freep(&output_streams[i]); | 1390 | av_freep(&output_streams[i]); |
| @@ -2763,6 +2765,29 @@ static InputStream *get_input_stream(OutputStream *ost) · 1374 unmodified lines | |||
| 2763 | return NULL; | 2765 | return NULL; |
| 2764 | } | 2766 | } |
| 2765 | 2767 | ||
| 2768 | static void parse_forced_key_frames(char *kf, OutputStream *ost, | ||
| 2769 | AVCodecContext *avctx) | ||
| 2770 | { | ||
| 2771 | char *p; | ||
| 2772 | int n = 1, i; | ||
| 2773 | int64_t t; | ||
| 2774 | |||
| 2775 | for (p = kf; *p; p++) | ||
| 2776 | if (*p == ',') | ||
| 2777 | n++; | ||
| 2778 | ost->forced_kf_count = n; | ||
| 2779 | ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n); | ||
| 2780 | if (!ost->forced_kf_pts) { | ||
| 2781 | av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); | ||
| 2782 | exit_program(1); | ||
| 2783 | } | ||
| 2784 | for (i = 0; i < n; i++) { | ||
| 2785 | p = i ? strchr(p, ',') + 1 : kf; | ||
| 2786 | t = parse_time_or_die("force_key_frames", p, 1); | ||
| 2787 | ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base); | ||
| 2788 | } | ||
| 2789 | } | ||
| 2790 | |||
| 2766 | static int transcode_init(void) | 2791 | static int transcode_init(void) |
| 2767 | { | 2792 | { |
| 2768 | int ret = 0, i, j, k; | 2793 | int ret = 0, i, j, k; |
| @@ -2997,6 +3022,9 @@ static int transcode_init(void) · 228 unmodified lines | |||
| 2997 | codec->bits_per_raw_sample = frame_bits_per_raw_sample; | 3022 | codec->bits_per_raw_sample = frame_bits_per_raw_sample; |
| 2998 | } | 3023 | } |
| 2999 | 3024 | ||
| 3025 | if (ost->forced_keyframes) | ||
| 3026 | parse_forced_key_frames(ost->forced_keyframes, ost, | ||
| 3027 | ost->st->codec); | ||
| 3000 | break; | 3028 | break; |
| 3001 | case AVMEDIA_TYPE_SUBTITLE: | 3029 | case AVMEDIA_TYPE_SUBTITLE: |
| 3002 | codec->time_base = (AVRational){1, 1000}; | 3030 | codec->time_base = (AVRational){1, 1000}; |
| @@ -4362,29 +4390,6 @@ static int opt_input_file(OptionsContext *o, const char *opt, const char *filena · 1359 unmodified lines | |||
| 4362 | return 0; | 4390 | return 0; |
| 4363 | } | 4391 | } |
| 4364 | 4392 | ||
| 4365 | static void parse_forced_key_frames(char *kf, OutputStream *ost) | ||
| 4366 | { | ||
| 4367 | char *p; | ||
| 4368 | int n = 1, i; | ||
| 4369 | |||
| 4370 | for (p = kf; *p; p++) | ||
| 4371 | if (*p == ',') | ||
| 4372 | n++; | ||
| 4373 | ost->forced_kf_count = n; | ||
| 4374 | ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n); | ||
| 4375 | if (!ost->forced_kf_pts) { | ||
| 4376 | av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); | ||
| 4377 | exit_program(1); | ||
| 4378 | } | ||
| 4379 | p = kf; | ||
| 4380 | for (i = 0; i < n; i++) { | ||
| 4381 | char *next = strchr(p, ','); | ||
| 4382 | if (next) *next++ = 0; | ||
| 4383 | ost->forced_kf_pts[i] = parse_time_or_die("force_key_frames", p, 1); | ||
| 4384 | p = next; | ||
| 4385 | } | ||
| 4386 | } | ||
| 4387 | |||
| 4388 | static uint8_t *get_line(AVIOContext *s) | 4393 | static uint8_t *get_line(AVIOContext *s) |
| 4389 | { | 4394 | { |
| 4390 | AVIOContext *line; | 4395 | AVIOContext *line; |
| @@ -4596,7 +4601,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in · 205 unmodified lines | |||
| 4596 | 4601 | ||
| 4597 | if (!ost->stream_copy) { | 4602 | if (!ost->stream_copy) { |
| 4598 | const char *p = NULL; | 4603 | const char *p = NULL; |
| 4599 | char *forced_key_frames = NULL, *frame_size = NULL; | 4604 | char *frame_size = NULL; |
| 4600 | char *frame_aspect_ratio = NULL, *frame_pix_fmt = NULL; | 4605 | char *frame_aspect_ratio = NULL, *frame_pix_fmt = NULL; |
| 4601 | char *intra_matrix = NULL, *inter_matrix = NULL; | 4606 | char *intra_matrix = NULL, *inter_matrix = NULL; |
| 4602 | const char *filters = "null"; | 4607 | const char *filters = "null"; |
| @@ -4694,9 +4699,9 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in · 91 unmodified lines | |||
| 4694 | } | 4699 | } |
| 4695 | } | 4700 | } |
| 4696 | 4701 | ||
| 4697 | MATCH_PER_STREAM_OPT(forced_key_frames, str, forced_key_frames, oc, st); | 4702 | MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st); |
| 4698 | if (forced_key_frames) | 4703 | if (ost->forced_keyframes) |
| 4699 | parse_forced_key_frames(forced_key_frames, ost); | 4704 | ost->forced_keyframes = av_strdup(ost->forced_keyframes); |
| 4700 | 4705 | ||
| 4701 | MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st); | 4706 | MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st); |
| 4702 | 4707 | ||
| @@ -38,7 +38,7 @@ typedef struct { · 37 unmodified lines | |||
| 38 | struct SwrContext *swr; | 38 | struct SwrContext *swr; |
| 39 | } AConvertContext; | 39 | } AConvertContext; |
| 40 | 40 | ||
| 41 | static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque) | 41 | static av_cold int init(AVFilterContext *ctx, const char *args0) |
| 42 | { | 42 | { |
| 43 | AConvertContext *aconvert = ctx->priv; | 43 | AConvertContext *aconvert = ctx->priv; |
| 44 | char *arg, *ptr = NULL; | 44 | char *arg, *ptr = NULL; |
| @@ -81,7 +81,7 @@ static int get_sample_rate(const char *samplerate) · 80 unmodified lines | |||
| 81 | return FFMAX(ret, 0); | 81 | return FFMAX(ret, 0); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 84 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 85 | { | 85 | { |
| 86 | AFormatContext *s = ctx->priv; | 86 | AFormatContext *s = ctx->priv; |
| 87 | int ret; | 87 | int ret; |
| @@ -288,7 +288,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 287 unmodified lines | |||
| 288 | ff_filter_samples(ctx->outputs[0], outbuf); | 288 | ff_filter_samples(ctx->outputs[0], outbuf); |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 291 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 292 | { | 292 | { |
| 293 | AMergeContext *am = ctx->priv; | 293 | AMergeContext *am = ctx->priv; |
| 294 | int ret, i; | 294 | int ret, i; |
| @@ -473,7 +473,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 472 unmodified lines | |||
| 473 | avfilter_unref_buffer(buf); | 473 | avfilter_unref_buffer(buf); |
| 474 | } | 474 | } |
| 475 | 475 | ||
| 476 | static int init(AVFilterContext *ctx, const char *args, void *opaque) | 476 | static int init(AVFilterContext *ctx, const char *args) |
| 477 | { | 477 | { |
| 478 | MixContext *s = ctx->priv; | 478 | MixContext *s = ctx->priv; |
| 479 | int i, ret; | 479 | int i, ret; |
| @@ -41,7 +41,7 @@ typedef struct { · 40 unmodified lines | |||
| 41 | int req_fullfilled; | 41 | int req_fullfilled; |
| 42 | } AResampleContext; | 42 | } AResampleContext; |
| 43 | 43 | ||
| 44 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 44 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 45 | { | 45 | { |
| 46 | AResampleContext *aresample = ctx->priv; | 46 | AResampleContext *aresample = ctx->priv; |
| 47 | int ret = 0; | 47 | int ret = 0; |
| @@ -54,7 +54,7 @@ static const AVOption asetnsamples_options[] = { · 53 unmodified lines | |||
| 54 | 54 | ||
| 55 | AVFILTER_DEFINE_CLASS(asetnsamples); | 55 | AVFILTER_DEFINE_CLASS(asetnsamples); |
| 56 | 56 | ||
| 57 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 57 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 58 | { | 58 | { |
| 59 | ASNSContext *asns = ctx->priv; | 59 | ASNSContext *asns = ctx->priv; |
| 60 | int err; | 60 | int err; |
| @@ -33,7 +33,7 @@ typedef struct { · 32 unmodified lines | |||
| 33 | unsigned int frame; | 33 | unsigned int frame; |
| 34 | } ShowInfoContext; | 34 | } ShowInfoContext; |
| 35 | 35 | ||
| 36 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 36 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 37 | { | 37 | { |
| 38 | ShowInfoContext *showinfo = ctx->priv; | 38 | ShowInfoContext *showinfo = ctx->priv; |
| 39 | showinfo->frame = 0; | 39 | showinfo->frame = 0; |
| @@ -60,7 +60,7 @@ typedef struct { · 59 unmodified lines | |||
| 60 | 60 | ||
| 61 | static const char *default_expr = "t1-t2"; | 61 | static const char *default_expr = "t1-t2"; |
| 62 | 62 | ||
| 63 | static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque) | 63 | static av_cold int init(AVFilterContext *ctx, const char *args0) |
| 64 | { | 64 | { |
| 65 | AStreamSyncContext *as = ctx->priv; | 65 | AStreamSyncContext *as = ctx->priv; |
| 66 | const char *expr = args0 ? args0 : default_expr; | 66 | const char *expr = args0 ? args0 : default_expr; |
| @@ -51,7 +51,7 @@ static const AVOption asyncts_options[] = { · 50 unmodified lines | |||
| 51 | 51 | ||
| 52 | AVFILTER_DEFINE_CLASS(asyncts); | 52 | AVFILTER_DEFINE_CLASS(asyncts); |
| 53 | 53 | ||
| 54 | static int init(AVFilterContext *ctx, const char *args, void *opaque) | 54 | static int init(AVFilterContext *ctx, const char *args) |
| 55 | { | 55 | { |
| 56 | ASyncContext *s = ctx->priv; | 56 | ASyncContext *s = ctx->priv; |
| 57 | int ret; | 57 | int ret; |
| @@ -948,7 +948,7 @@ static int yae_flush(ATempoContext *atempo, · 947 unmodified lines | |||
| 948 | return atempo->position[1] == stop_here ? 0 : AVERROR(EAGAIN); | 948 | return atempo->position[1] == stop_here ? 0 : AVERROR(EAGAIN); |
| 949 | } | 949 | } |
| 950 | 950 | ||
| 951 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 951 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 952 | { | 952 | { |
| 953 | ATempoContext *atempo = ctx->priv; | 953 | ATempoContext *atempo = ctx->priv; |
| 954 | 954 | ||
| @@ -118,8 +118,7 @@ static int get_channel(char **map, uint64_t *ch, char delim) · 117 unmodified lines | |||
| 118 | return 0; | 118 | return 0; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | static av_cold int channelmap_init(AVFilterContext *ctx, const char *args, | 121 | static av_cold int channelmap_init(AVFilterContext *ctx, const char *args) |
| 122 | void *opaque) | ||
| 123 | { | 122 | { |
| 124 | ChannelMapContext *s = ctx->priv; | 123 | ChannelMapContext *s = ctx->priv; |
| 125 | int ret; | 124 | int ret; |
| @@ -47,7 +47,7 @@ static const AVOption channelsplit_options[] = { · 46 unmodified lines | |||
| 47 | 47 | ||
| 48 | AVFILTER_DEFINE_CLASS(channelsplit); | 48 | AVFILTER_DEFINE_CLASS(channelsplit); |
| 49 | 49 | ||
| 50 | static int init(AVFilterContext *ctx, const char *arg, void *opaque) | 50 | static int init(AVFilterContext *ctx, const char *arg) |
| 51 | { | 51 | { |
| 52 | ChannelSplitContext *s = ctx->priv; | 52 | ChannelSplitContext *s = ctx->priv; |
| 53 | int nb_channels; | 53 | int nb_channels; |
| @@ -184,7 +184,7 @@ static int parse_maps(AVFilterContext *ctx) · 183 unmodified lines | |||
| 184 | return 0; | 184 | return 0; |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | static int join_init(AVFilterContext *ctx, const char *args, void *opaque) | 187 | static int join_init(AVFilterContext *ctx, const char *args) |
| 188 | { | 188 | { |
| 189 | JoinContext *s = ctx->priv; | 189 | JoinContext *s = ctx->priv; |
| 190 | int ret, i; | 190 | int ret, i; |
| @@ -96,7 +96,7 @@ static void skip_spaces(char **arg) · 95 unmodified lines | |||
| 96 | *arg += len; | 96 | *arg += len; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque) | 99 | static av_cold int init(AVFilterContext *ctx, const char *args0) |
| 100 | { | 100 | { |
| 101 | PanContext *const pan = ctx->priv; | 101 | PanContext *const pan = ctx->priv; |
| 102 | char *arg, *arg0, *tokenizer, *args = av_strdup(args0); | 102 | char *arg, *arg0, *tokenizer, *args = av_strdup(args0); |
| @@ -52,7 +52,7 @@ static const AVOption silencedetect_options[] = { · 51 unmodified lines | |||
| 52 | 52 | ||
| 53 | AVFILTER_DEFINE_CLASS(silencedetect); | 53 | AVFILTER_DEFINE_CLASS(silencedetect); |
| 54 | 54 | ||
| 55 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 55 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 56 | { | 56 | { |
| 57 | int ret; | 57 | int ret; |
| 58 | char *tail; | 58 | char *tail; |
| @@ -35,7 +35,7 @@ typedef struct { · 34 unmodified lines | |||
| 35 | int volume_i; | 35 | int volume_i; |
| 36 | } VolumeContext; | 36 | } VolumeContext; |
| 37 | 37 | ||
| 38 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 38 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 39 | { | 39 | { |
| 40 | VolumeContext *vol = ctx->priv; | 40 | VolumeContext *vol = ctx->priv; |
| 41 | char *tail; | 41 | char *tail; |
| @@ -80,7 +80,7 @@ static const AVOption aevalsrc_options[]= { · 79 unmodified lines | |||
| 80 | 80 | ||
| 81 | AVFILTER_DEFINE_CLASS(aevalsrc); | 81 | AVFILTER_DEFINE_CLASS(aevalsrc); |
| 82 | 82 | ||
| 83 | static int init(AVFilterContext *ctx, const char *args, void *opaque) | 83 | static int init(AVFilterContext *ctx, const char *args) |
| 84 | { | 84 | { |
| 85 | EvalContext *eval = ctx->priv; | 85 | EvalContext *eval = ctx->priv; |
| 86 | char *args1 = av_strdup(args); | 86 | char *args1 = av_strdup(args); |
| @@ -56,7 +56,7 @@ static const AVOption anullsrc_options[]= { · 55 unmodified lines | |||
| 56 | 56 | ||
| 57 | AVFILTER_DEFINE_CLASS(anullsrc); | 57 | AVFILTER_DEFINE_CLASS(anullsrc); |
| 58 | 58 | ||
| 59 | static int init(AVFilterContext *ctx, const char *args, void *opaque) | 59 | static int init(AVFilterContext *ctx, const char *args) |
| 60 | { | 60 | { |
| 61 | ANullContext *null = ctx->priv; | 61 | ANullContext *null = ctx->priv; |
| 62 | int ret; | 62 | int ret; |
| @@ -547,7 +547,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 546 unmodified lines | |||
| 547 | int ret=0; | 547 | int ret=0; |
| 548 | 548 | ||
| 549 | if (filter->filter->init) | 549 | if (filter->filter->init) |
| 550 | ret = filter->filter->init(filter, args, opaque); | 550 | ret = filter->filter->init(filter, args); |
| 551 | return ret; | 551 | return ret; |
| 552 | } | 552 | } |
| 553 | 553 | ||
| @@ -568,10 +568,8 @@ typedef struct AVFilter { · 567 unmodified lines | |||
| 568 | /** | 568 | /** |
| 569 | * Filter initialization function. Args contains the user-supplied | 569 | * Filter initialization function. Args contains the user-supplied |
| 570 | * parameters. FIXME: maybe an AVOption-based system would be better? | 570 | * parameters. FIXME: maybe an AVOption-based system would be better? |
| 571 | * opaque is data provided by the code requesting creation of the filter, | ||
| 572 | * and is used to pass data to the filter. | ||
| 573 | */ | 571 | */ |
| 574 | int (*init)(AVFilterContext *ctx, const char *args, void *opaque); | 572 | int (*init)(AVFilterContext *ctx, const char *args); |
| 575 | 573 | ||
| 576 | /** | 574 | /** |
| 577 | * Filter uninitialization function. Should deallocate any memory held | 575 | * Filter uninitialization function. Should deallocate any memory held |
| @@ -213,7 +213,7 @@ static const AVOption buffer_options[] = { · 212 unmodified lines | |||
| 213 | 213 | ||
| 214 | AVFILTER_DEFINE_CLASS(buffer); | 214 | AVFILTER_DEFINE_CLASS(buffer); |
| 215 | 215 | ||
| 216 | static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaque) | 216 | static av_cold int init_video(AVFilterContext *ctx, const char *args) |
| 217 | { | 217 | { |
| 218 | BufferSourceContext *c = ctx->priv; | 218 | BufferSourceContext *c = ctx->priv; |
| 219 | char pix_fmt_str[128], sws_param[256] = "", *colon, *equal; | 219 | char pix_fmt_str[128], sws_param[256] = "", *colon, *equal; |
| @@ -280,7 +280,7 @@ static const AVOption abuffer_options[] = { · 60 unmodified lines | |||
| 280 | 280 | ||
| 281 | AVFILTER_DEFINE_CLASS(abuffer); | 281 | AVFILTER_DEFINE_CLASS(abuffer); |
| 282 | 282 | ||
| 283 | static av_cold int init_audio(AVFilterContext *ctx, const char *args, void *opaque) | 283 | static av_cold int init_audio(AVFilterContext *ctx, const char *args) |
| 284 | { | 284 | { |
| 285 | BufferSourceContext *s = ctx->priv; | 285 | BufferSourceContext *s = ctx->priv; |
| 286 | int ret = 0; | 286 | int ret = 0; |
| @@ -50,7 +50,7 @@ typedef struct { · 49 unmodified lines | |||
| 50 | int allocated_samples; ///< number of samples buf_out was allocated for | 50 | int allocated_samples; ///< number of samples buf_out was allocated for |
| 51 | } FifoContext; | 51 | } FifoContext; |
| 52 | 52 | ||
| 53 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 53 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 54 | { | 54 | { |
| 55 | FifoContext *fifo = ctx->priv; | 55 | FifoContext *fifo = ctx->priv; |
| 56 | fifo->last = &fifo->root; | 56 | fifo->last = &fifo->root; |
| @@ -163,12 +163,15 @@ int av_buffersink_poll_frame(AVFilterContext *ctx) · 162 unmodified lines | |||
| 163 | 163 | ||
| 164 | #if CONFIG_BUFFERSINK_FILTER | 164 | #if CONFIG_BUFFERSINK_FILTER |
| 165 | 165 | ||
| 166 | static av_cold int vsink_init(AVFilterContext *ctx, const char *args, void *opaque) | 166 | static av_cold int vsink_init(AVFilterContext *ctx, const char *args) |
| 167 | { | 167 | { |
| 168 | BufferSinkContext *buf = ctx->priv; | 168 | BufferSinkContext *buf = ctx->priv; |
| 169 | AVBufferSinkParams *params = (AVBufferSinkParams *)opaque; | 169 | AVBufferSinkParams *params = NULL; |
| 170 | 170 | ||
| 171 | if (!opaque) { | 171 | // if(args && !strcmp(args, "opaque")) |
| 172 | // params = (AVBufferSinkParams *)(args+7); | ||
| 173 | |||
| 174 | if (!params) { | ||
| 172 | av_log(ctx, AV_LOG_WARNING, | 175 | av_log(ctx, AV_LOG_WARNING, |
| 173 | "No opaque field provided\n"); | 176 | "No opaque field provided\n"); |
| 174 | buf->pixel_fmts = NULL; | 177 | buf->pixel_fmts = NULL; |
| @@ -228,10 +231,13 @@ static void filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 53 unmodified lines | |||
| 228 | end_frame(link); | 231 | end_frame(link); |
| 229 | } | 232 | } |
| 230 | 233 | ||
| 231 | static av_cold int asink_init(AVFilterContext *ctx, const char *args, void *opaque) | 234 | static av_cold int asink_init(AVFilterContext *ctx, const char *args) |
| 232 | { | 235 | { |
| 233 | BufferSinkContext *buf = ctx->priv; | 236 | BufferSinkContext *buf = ctx->priv; |
| 234 | AVABufferSinkParams *params = opaque; | 237 | AVABufferSinkParams *params = NULL; |
| 238 | |||
| 239 | // if(args && !strcmp(args, "opaque")) | ||
| 240 | // params = (AVABufferSinkParams *)(args+7); | ||
| 235 | 241 | ||
| 236 | if (params && params->sample_fmts) { | 242 | if (params && params->sample_fmts) { |
| 237 | buf->sample_fmts = ff_copy_int_list (params->sample_fmts); | 243 | buf->sample_fmts = ff_copy_int_list (params->sample_fmts); |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include "internal.h" | 28 | #include "internal.h" |
| 29 | #include "video.h" | 29 | #include "video.h" |
| 30 | 30 | ||
| 31 | static int split_init(AVFilterContext *ctx, const char *args, void *opaque) | 31 | static int split_init(AVFilterContext *ctx, const char *args) |
| 32 | { | 32 | { |
| 33 | int i, nb_outputs = 2; | 33 | int i, nb_outputs = 2; |
| 34 | 34 | ||
| @@ -82,7 +82,7 @@ static const AVOption movie_options[]= { · 81 unmodified lines | |||
| 82 | 82 | ||
| 83 | AVFILTER_DEFINE_CLASS(movie); | 83 | AVFILTER_DEFINE_CLASS(movie); |
| 84 | 84 | ||
| 85 | static av_cold int movie_common_init(AVFilterContext *ctx, const char *args, void *opaque, | 85 | static av_cold int movie_common_init(AVFilterContext *ctx, const char *args, |
| 86 | enum AVMediaType type) | 86 | enum AVMediaType type) |
| 87 | { | 87 | { |
| 88 | MovieContext *movie = ctx->priv; | 88 | MovieContext *movie = ctx->priv; |
| @@ -198,12 +198,12 @@ static av_cold void movie_common_uninit(AVFilterContext *ctx) · 109 unmodified lines | |||
| 198 | 198 | ||
| 199 | #if CONFIG_MOVIE_FILTER | 199 | #if CONFIG_MOVIE_FILTER |
| 200 | 200 | ||
| 201 | static av_cold int movie_init(AVFilterContext *ctx, const char *args, void *opaque) | 201 | static av_cold int movie_init(AVFilterContext *ctx, const char *args) |
| 202 | { | 202 | { |
| 203 | MovieContext *movie = ctx->priv; | 203 | MovieContext *movie = ctx->priv; |
| 204 | int ret; | 204 | int ret; |
| 205 | 205 | ||
| 206 | if ((ret = movie_common_init(ctx, args, opaque, AVMEDIA_TYPE_VIDEO)) < 0) | 206 | if ((ret = movie_common_init(ctx, args, AVMEDIA_TYPE_VIDEO)) < 0) |
| 207 | return ret; | 207 | return ret; |
| 208 | 208 | ||
| 209 | movie->w = movie->codec_ctx->width; | 209 | movie->w = movie->codec_ctx->width; |
| @@ -345,12 +345,12 @@ AVFilter avfilter_vsrc_movie = { · 135 unmodified lines | |||
| 345 | 345 | ||
| 346 | #if CONFIG_AMOVIE_FILTER | 346 | #if CONFIG_AMOVIE_FILTER |
| 347 | 347 | ||
| 348 | static av_cold int amovie_init(AVFilterContext *ctx, const char *args, void *opaque) | 348 | static av_cold int amovie_init(AVFilterContext *ctx, const char *args) |
| 349 | { | 349 | { |
| 350 | MovieContext *movie = ctx->priv; | 350 | MovieContext *movie = ctx->priv; |
| 351 | int ret; | 351 | int ret; |
| 352 | 352 | ||
| 353 | if ((ret = movie_common_init(ctx, args, opaque, AVMEDIA_TYPE_AUDIO)) < 0) | 353 | if ((ret = movie_common_init(ctx, args, AVMEDIA_TYPE_AUDIO)) < 0) |
| 354 | return ret; | 354 | return ret; |
| 355 | 355 | ||
| 356 | movie->bps = av_get_bytes_per_sample(movie->codec_ctx->sample_fmt); | 356 | movie->bps = av_get_bytes_per_sample(movie->codec_ctx->sample_fmt); |
| @@ -33,7 +33,7 @@ typedef struct { · 32 unmodified lines | |||
| 33 | AVRational ratio; | 33 | AVRational ratio; |
| 34 | } AspectContext; | 34 | } AspectContext; |
| 35 | 35 | ||
| 36 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 36 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 37 | { | 37 | { |
| 38 | AspectContext *aspect = ctx->priv; | 38 | AspectContext *aspect = ctx->priv; |
| 39 | aspect->ratio = (AVRational) {0, 1}; | 39 | aspect->ratio = (AVRational) {0, 1}; |
| @@ -79,7 +79,7 @@ static void ass_log(int ass_level, const char *fmt, va_list args, void *ctx) · 78 unmodified lines | |||
| 79 | av_log(ctx, level, "\n"); | 79 | av_log(ctx, level, "\n"); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 82 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 83 | { | 83 | { |
| 84 | AssContext *ass = ctx->priv; | 84 | AssContext *ass = ctx->priv; |
| 85 | int ret; | 85 | int ret; |
| @@ -34,7 +34,7 @@ typedef struct { · 33 unmodified lines | |||
| 34 | int vsub, hsub; | 34 | int vsub, hsub; |
| 35 | } BBoxContext; | 35 | } BBoxContext; |
| 36 | 36 | ||
| 37 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 37 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 38 | { | 38 | { |
| 39 | BBoxContext *bbox = ctx->priv; | 39 | BBoxContext *bbox = ctx->priv; |
| 40 | bbox->frame = 0; | 40 | bbox->frame = 0; |
| @@ -80,7 +80,7 @@ static int query_formats(AVFilterContext *ctx) · 79 unmodified lines | |||
| 80 | return 0; | 80 | return 0; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 83 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 84 | { | 84 | { |
| 85 | int ret; | 85 | int ret; |
| 86 | BlackDetectContext *blackdetect = ctx->priv; | 86 | BlackDetectContext *blackdetect = ctx->priv; |
| @@ -53,7 +53,7 @@ static int query_formats(AVFilterContext *ctx) · 52 unmodified lines | |||
| 53 | return 0; | 53 | return 0; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 56 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 57 | { | 57 | { |
| 58 | BlackFrameContext *blackframe = ctx->priv; | 58 | BlackFrameContext *blackframe = ctx->priv; |
| 59 | 59 | ||
| @@ -77,7 +77,7 @@ typedef struct { · 76 unmodified lines | |||
| 77 | #define V 2 | 77 | #define V 2 |
| 78 | #define A 3 | 78 | #define A 3 |
| 79 | 79 | ||
| 80 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 80 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 81 | { | 81 | { |
| 82 | BoxBlurContext *boxblur = ctx->priv; | 82 | BoxBlurContext *boxblur = ctx->priv; |
| 83 | int e; | 83 | int e; |
| @@ -145,7 +145,7 @@ static int get_color_mode_index(const char *name) · 144 unmodified lines | |||
| 145 | return -1; | 145 | return -1; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 148 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 149 | { | 149 | { |
| 150 | ColorMatrixContext *color = ctx->priv; | 150 | ColorMatrixContext *color = ctx->priv; |
| 151 | 151 | ||
| @@ -120,7 +120,7 @@ static int query_formats(AVFilterContext *ctx) · 119 unmodified lines | |||
| 120 | return 0; | 120 | return 0; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 123 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 124 | { | 124 | { |
| 125 | CropContext *crop = ctx->priv; | 125 | CropContext *crop = ctx->priv; |
| 126 | 126 | ||
| @@ -80,7 +80,7 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i · 79 unmodified lines | |||
| 80 | return total; | 80 | return total; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 83 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 84 | { | 84 | { |
| 85 | CropDetectContext *cd = ctx->priv; | 85 | CropDetectContext *cd = ctx->priv; |
| 86 | 86 | ||
| @@ -166,7 +166,7 @@ static int query_formats(AVFilterContext *ctx) · 165 unmodified lines | |||
| 166 | return 0; | 166 | return 0; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 169 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 170 | { | 170 | { |
| 171 | DelogoContext *delogo = ctx->priv; | 171 | DelogoContext *delogo = ctx->priv; |
| 172 | int ret = 0; | 172 | int ret = 0; |
| @@ -331,7 +331,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2, · 330 unmodified lines | |||
| 331 | av_free(angles); | 331 | av_free(angles); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 334 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 335 | { | 335 | { |
| 336 | DeshakeContext *deshake = ctx->priv; | 336 | DeshakeContext *deshake = ctx->priv; |
| 337 | char filename[256] = {0}; | 337 | char filename[256] = {0}; |
| @@ -40,7 +40,7 @@ typedef struct { · 39 unmodified lines | |||
| 40 | int vsub, hsub; ///< chroma subsampling | 40 | int vsub, hsub; ///< chroma subsampling |
| 41 | } DrawBoxContext; | 41 | } DrawBoxContext; |
| 42 | 42 | ||
| 43 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 43 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 44 | { | 44 | { |
| 45 | DrawBoxContext *drawbox= ctx->priv; | 45 | DrawBoxContext *drawbox= ctx->priv; |
| 46 | char color_str[1024] = "black"; | 46 | char color_str[1024] = "black"; |
| @@ -379,7 +379,7 @@ static int load_font(AVFilterContext *ctx) · 378 unmodified lines | |||
| 379 | return err; | 379 | return err; |
| 380 | } | 380 | } |
| 381 | 381 | ||
| 382 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 382 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 383 | { | 383 | { |
| 384 | int err; | 384 | int err; |
| 385 | DrawTextContext *dtext = ctx->priv; | 385 | DrawTextContext *dtext = ctx->priv; |
| @@ -574,7 +574,7 @@ static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char · 188 unmodified lines | |||
| 574 | int ret; | 574 | int ret; |
| 575 | uninit(ctx); | 575 | uninit(ctx); |
| 576 | dtext->reinit = 1; | 576 | dtext->reinit = 1; |
| 577 | if ((ret = init(ctx, arg, NULL)) < 0) | 577 | if ((ret = init(ctx, arg)) < 0) |
| 578 | return ret; | 578 | return ret; |
| 579 | return config_input(ctx->inputs[0]); | 579 | return config_input(ctx->inputs[0]); |
| 580 | } | 580 | } |
| @@ -73,7 +73,7 @@ static const AVOption fade_options[] = { · 72 unmodified lines | |||
| 73 | 73 | ||
| 74 | AVFILTER_DEFINE_CLASS(fade); | 74 | AVFILTER_DEFINE_CLASS(fade); |
| 75 | 75 | ||
| 76 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 76 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 77 | { | 77 | { |
| 78 | FadeContext *fade = ctx->priv; | 78 | FadeContext *fade = ctx->priv; |
| 79 | int ret = 0; | 79 | int ret = 0; |
| @@ -38,7 +38,7 @@ typedef struct · 37 unmodified lines | |||
| 38 | int line_size[4]; ///< bytes of pixel data per line for each plane | 38 | int line_size[4]; ///< bytes of pixel data per line for each plane |
| 39 | } FieldOrderContext; | 39 | } FieldOrderContext; |
| 40 | 40 | ||
| 41 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 41 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 42 | { | 42 | { |
| 43 | FieldOrderContext *fieldorder = ctx->priv; | 43 | FieldOrderContext *fieldorder = ctx->priv; |
| 44 | 44 | ||
| @@ -40,7 +40,7 @@ typedef struct { · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | #define PIX_FMT_NAME_MAXSIZE 32 | 41 | #define PIX_FMT_NAME_MAXSIZE 32 |
| 42 | 42 | ||
| 43 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 43 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 44 | { | 44 | { |
| 45 | FormatContext *format = ctx->priv; | 45 | FormatContext *format = ctx->priv; |
| 46 | const char *cur, *sep; | 46 | const char *cur, *sep; |
| @@ -62,7 +62,7 @@ static const AVOption fps_options[] = { · 61 unmodified lines | |||
| 62 | 62 | ||
| 63 | AVFILTER_DEFINE_CLASS(fps); | 63 | AVFILTER_DEFINE_CLASS(fps); |
| 64 | 64 | ||
| 65 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 65 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 66 | { | 66 | { |
| 67 | FPSContext *s = ctx->priv; | 67 | FPSContext *s = ctx->priv; |
| 68 | int ret; | 68 | int ret; |
| @@ -278,7 +278,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx, · 277 unmodified lines | |||
| 278 | return 0; | 278 | return 0; |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | static av_cold int filter_init(AVFilterContext *ctx, const char *args, void *opaque) | 281 | static av_cold int filter_init(AVFilterContext *ctx, const char *args) |
| 282 | { | 282 | { |
| 283 | Frei0rContext *frei0r = ctx->priv; | 283 | Frei0rContext *frei0r = ctx->priv; |
| 284 | char dl_name[1024], c; | 284 | char dl_name[1024], c; |
| @@ -381,7 +381,7 @@ AVFilter avfilter_vf_frei0r = { · 96 unmodified lines | |||
| 381 | { .name = NULL}}, | 381 | { .name = NULL}}, |
| 382 | }; | 382 | }; |
| 383 | 383 | ||
| 384 | static av_cold int source_init(AVFilterContext *ctx, const char *args, void *opaque) | 384 | static av_cold int source_init(AVFilterContext *ctx, const char *args) |
| 385 | { | 385 | { |
| 386 | Frei0rContext *frei0r = ctx->priv; | 386 | Frei0rContext *frei0r = ctx->priv; |
| 387 | char dl_name[1024], c; | 387 | char dl_name[1024], c; |
| @@ -118,7 +118,7 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi · 117 unmodified lines | |||
| 118 | } | 118 | } |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 121 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 122 | { | 122 | { |
| 123 | GradFunContext *gf = ctx->priv; | 123 | GradFunContext *gf = ctx->priv; |
| 124 | float thresh = 1.2; | 124 | float thresh = 1.2; |
| @@ -197,7 +197,7 @@ static void PrecalcCoefs(int *Ct, double Dist25) · 196 unmodified lines | |||
| 197 | #define PARAM2_DEFAULT 3.0 | 197 | #define PARAM2_DEFAULT 3.0 |
| 198 | #define PARAM3_DEFAULT 6.0 | 198 | #define PARAM3_DEFAULT 6.0 |
| 199 | 199 | ||
| 200 | static int init(AVFilterContext *ctx, const char *args, void *opaque) | 200 | static int init(AVFilterContext *ctx, const char *args) |
| 201 | { | 201 | { |
| 202 | HQDN3DContext *hqdn3d = ctx->priv; | 202 | HQDN3DContext *hqdn3d = ctx->priv; |
| 203 | double LumSpac, LumTmp, ChromSpac, ChromTmp; | 203 | double LumSpac, LumTmp, ChromSpac, ChromTmp; |
| @@ -292,7 +292,7 @@ static int query_formats(AVFilterContext *ctx) · 291 unmodified lines | |||
| 292 | return 0; | 292 | return 0; |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 295 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 296 | { | 296 | { |
| 297 | IDETContext *idet = ctx->priv; | 297 | IDETContext *idet = ctx->priv; |
| 298 | 298 | ||
| @@ -71,7 +71,7 @@ static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { } · 70 unmodified lines | |||
| 71 | 71 | ||
| 72 | typedef struct { | 72 | typedef struct { |
| 73 | const char *name; | 73 | const char *name; |
| 74 | int (*init)(AVFilterContext *ctx, const char *args, void *opaque); | 74 | int (*init)(AVFilterContext *ctx, const char *args); |
| 75 | void (*uninit)(AVFilterContext *ctx); | 75 | void (*uninit)(AVFilterContext *ctx); |
| 76 | void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); | 76 | void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); |
| 77 | void *priv; | 77 | void *priv; |
| @@ -83,7 +83,7 @@ typedef struct { · 5 unmodified lines | |||
| 83 | double param3, param4; | 83 | double param3, param4; |
| 84 | } SmoothContext; | 84 | } SmoothContext; |
| 85 | 85 | ||
| 86 | static av_cold int smooth_init(AVFilterContext *ctx, const char *args, void *opaque) | 86 | static av_cold int smooth_init(AVFilterContext *ctx, const char *args) |
| 87 | { | 87 | { |
| 88 | OCVContext *ocv = ctx->priv; | 88 | OCVContext *ocv = ctx->priv; |
| 89 | SmoothContext *smooth = ocv->priv; | 89 | SmoothContext *smooth = ocv->priv; |
| @@ -249,7 +249,7 @@ typedef struct { · 159 unmodified lines | |||
| 249 | IplConvKernel *kernel; | 249 | IplConvKernel *kernel; |
| 250 | } DilateContext; | 250 | } DilateContext; |
| 251 | 251 | ||
| 252 | static av_cold int dilate_init(AVFilterContext *ctx, const char *args, void *opaque) | 252 | static av_cold int dilate_init(AVFilterContext *ctx, const char *args) |
| 253 | { | 253 | { |
| 254 | OCVContext *ocv = ctx->priv; | 254 | OCVContext *ocv = ctx->priv; |
| 255 | DilateContext *dilate = ocv->priv; | 255 | DilateContext *dilate = ocv->priv; |
| @@ -303,7 +303,7 @@ static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplIma · 47 unmodified lines | |||
| 303 | typedef struct { | 303 | typedef struct { |
| 304 | const char *name; | 304 | const char *name; |
| 305 | size_t priv_size; | 305 | size_t priv_size; |
| 306 | int (*init)(AVFilterContext *ctx, const char *args, void *opaque); | 306 | int (*init)(AVFilterContext *ctx, const char *args); |
| 307 | void (*uninit)(AVFilterContext *ctx); | 307 | void (*uninit)(AVFilterContext *ctx); |
| 308 | void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); | 308 | void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); |
| 309 | } OCVFilterEntry; | 309 | } OCVFilterEntry; |
| @@ -314,7 +314,7 @@ static OCVFilterEntry ocv_filter_entries[] = { · 4 unmodified lines | |||
| 314 | { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter }, | 314 | { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter }, |
| 315 | }; | 315 | }; |
| 316 | 316 | ||
| 317 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 317 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 318 | { | 318 | { |
| 319 | OCVContext *ocv = ctx->priv; | 319 | OCVContext *ocv = ctx->priv; |
| 320 | char name[128], priv_args[1024]; | 320 | char name[128], priv_args[1024]; |
| @@ -333,7 +333,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 12 unmodified lines | |||
| 333 | 333 | ||
| 334 | if (!(ocv->priv = av_mallocz(entry->priv_size))) | 334 | if (!(ocv->priv = av_mallocz(entry->priv_size))) |
| 335 | return AVERROR(ENOMEM); | 335 | return AVERROR(ENOMEM); |
| 336 | return ocv->init(ctx, priv_args, opaque); | 336 | return ocv->init(ctx, priv_args); |
| 337 | } | 337 | } |
| 338 | } | 338 | } |
| 339 | 339 | ||
| @@ -93,7 +93,7 @@ static const AVOption lut_options[] = { · 92 unmodified lines | |||
| 93 | 93 | ||
| 94 | AVFILTER_DEFINE_CLASS(lut); | 94 | AVFILTER_DEFINE_CLASS(lut); |
| 95 | 95 | ||
| 96 | static int init(AVFilterContext *ctx, const char *args, void *opaque) | 96 | static int init(AVFilterContext *ctx, const char *args) |
| 97 | { | 97 | { |
| 98 | LutContext *lut = ctx->priv; | 98 | LutContext *lut = ctx->priv; |
| 99 | int ret; | 99 | int ret; |
| @@ -368,7 +368,7 @@ DEFINE_LUT_FILTER(lutrgb, "Compute and apply a lookup table to the RGB input vid · 268 unmodified lines | |||
| 368 | 368 | ||
| 369 | #if CONFIG_NEGATE_FILTER | 369 | #if CONFIG_NEGATE_FILTER |
| 370 | 370 | ||
| 371 | static int negate_init(AVFilterContext *ctx, const char *args, void *opaque) | 371 | static int negate_init(AVFilterContext *ctx, const char *args) |
| 372 | { | 372 | { |
| 373 | LutContext *lut = ctx->priv; | 373 | LutContext *lut = ctx->priv; |
| 374 | char lut_params[64]; | 374 | char lut_params[64]; |
| @@ -381,7 +381,7 @@ static int negate_init(AVFilterContext *ctx, const char *args, void *opaque) · 6 unmodified lines | |||
| 381 | snprintf(lut_params, sizeof(lut_params), "c0=negval:c1=negval:c2=negval:a=%s", | 381 | snprintf(lut_params, sizeof(lut_params), "c0=negval:c1=negval:c2=negval:a=%s", |
| 382 | lut->negate_alpha ? "negval" : "val"); | 382 | lut->negate_alpha ? "negval" : "val"); |
| 383 | 383 | ||
| 384 | return init(ctx, lut_params, opaque); | 384 | return init(ctx, lut_params); |
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | DEFINE_LUT_FILTER(negate, "Negate input video.", negate_init); | 387 | 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){ · 698 unmodified lines | |||
| 699 | } | 699 | } |
| 700 | 700 | ||
| 701 | 701 | ||
| 702 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 702 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 703 | { | 703 | { |
| 704 | MPContext *m = ctx->priv; | 704 | MPContext *m = ctx->priv; |
| 705 | char name[256]; | 705 | char name[256]; |
| @@ -105,7 +105,7 @@ static const AVOption overlay_options[] = { · 104 unmodified lines | |||
| 105 | 105 | ||
| 106 | AVFILTER_DEFINE_CLASS(overlay); | 106 | AVFILTER_DEFINE_CLASS(overlay); |
| 107 | 107 | ||
| 108 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 108 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 109 | { | 109 | { |
| 110 | OverlayContext *over = ctx->priv; | 110 | OverlayContext *over = ctx->priv; |
| 111 | char *args1 = av_strdup(args); | 111 | char *args1 = av_strdup(args); |
| @@ -90,7 +90,7 @@ typedef struct { · 89 unmodified lines | |||
| 90 | int needs_copy; | 90 | int needs_copy; |
| 91 | } PadContext; | 91 | } PadContext; |
| 92 | 92 | ||
| 93 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 93 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 94 | { | 94 | { |
| 95 | PadContext *pad = ctx->priv; | 95 | PadContext *pad = ctx->priv; |
| 96 | char color_string[128] = "black"; | 96 | char color_string[128] = "black"; |
| @@ -263,7 +263,7 @@ static void generate_half_size_image(const uint8_t *src_data, int src_linesize, · 262 unmodified lines | |||
| 263 | src_w/2, src_h/2, 0, max_mask_size); | 263 | src_w/2, src_h/2, 0, max_mask_size); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 266 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 267 | { | 267 | { |
| 268 | RemovelogoContext *removelogo = ctx->priv; | 268 | RemovelogoContext *removelogo = ctx->priv; |
| 269 | int ***mask; | 269 | int ***mask; |
| @@ -84,7 +84,7 @@ typedef struct { · 83 unmodified lines | |||
| 84 | char h_expr[256]; ///< height expression string | 84 | char h_expr[256]; ///< height expression string |
| 85 | } ScaleContext; | 85 | } ScaleContext; |
| 86 | 86 | ||
| 87 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 87 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 88 | { | 88 | { |
| 89 | ScaleContext *scale = ctx->priv; | 89 | ScaleContext *scale = ctx->priv; |
| 90 | const char *p; | 90 | const char *p; |
| @@ -124,7 +124,7 @@ typedef struct { · 123 unmodified lines | |||
| 124 | AVFifoBuffer *pending_frames; ///< FIFO buffer of video frames | 124 | AVFifoBuffer *pending_frames; ///< FIFO buffer of video frames |
| 125 | } SelectContext; | 125 | } SelectContext; |
| 126 | 126 | ||
| 127 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 127 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 128 | { | 128 | { |
| 129 | SelectContext *select = ctx->priv; | 129 | SelectContext *select = ctx->priv; |
| 130 | int ret; | 130 | int ret; |
| @@ -37,7 +37,7 @@ typedef struct { · 36 unmodified lines | |||
| 37 | enum SetFieldMode mode; | 37 | enum SetFieldMode mode; |
| 38 | } SetFieldContext; | 38 | } SetFieldContext; |
| 39 | 39 | ||
| 40 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 40 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 41 | { | 41 | { |
| 42 | SetFieldContext *setfield = ctx->priv; | 42 | SetFieldContext *setfield = ctx->priv; |
| 43 | 43 | ||
| @@ -61,7 +61,7 @@ typedef struct { · 60 unmodified lines | |||
| 61 | double var_values[VAR_VARS_NB]; | 61 | double var_values[VAR_VARS_NB]; |
| 62 | } SetPTSContext; | 62 | } SetPTSContext; |
| 63 | 63 | ||
| 64 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 64 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 65 | { | 65 | { |
| 66 | SetPTSContext *setpts = ctx->priv; | 66 | SetPTSContext *setpts = ctx->priv; |
| 67 | int ret; | 67 | int ret; |
| @@ -48,7 +48,7 @@ typedef struct { · 47 unmodified lines | |||
| 48 | double var_values[VAR_VARS_NB]; | 48 | double var_values[VAR_VARS_NB]; |
| 49 | } SetTBContext; | 49 | } SetTBContext; |
| 50 | 50 | ||
| 51 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 51 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 52 | { | 52 | { |
| 53 | SetTBContext *settb = ctx->priv; | 53 | SetTBContext *settb = ctx->priv; |
| 54 | av_strlcpy(settb->tb_expr, "intb", sizeof(settb->tb_expr)); | 54 | av_strlcpy(settb->tb_expr, "intb", sizeof(settb->tb_expr)); |
| @@ -34,7 +34,7 @@ typedef struct { · 33 unmodified lines | |||
| 34 | unsigned int frame; | 34 | unsigned int frame; |
| 35 | } ShowInfoContext; | 35 | } ShowInfoContext; |
| 36 | 36 | ||
| 37 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 37 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 38 | { | 38 | { |
| 39 | ShowInfoContext *showinfo = ctx->priv; | 39 | ShowInfoContext *showinfo = ctx->priv; |
| 40 | showinfo->frame = 0; | 40 | showinfo->frame = 0; |
| @@ -35,7 +35,7 @@ typedef struct { · 34 unmodified lines | |||
| 35 | int use_random_h; ///< enable the use of random slice height values | 35 | int use_random_h; ///< enable the use of random slice height values |
| 36 | } SliceContext; | 36 | } SliceContext; |
| 37 | 37 | ||
| 38 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 38 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 39 | { | 39 | { |
| 40 | SliceContext *slice = ctx->priv; | 40 | SliceContext *slice = ctx->priv; |
| 41 | 41 | ||
| @@ -44,7 +44,7 @@ typedef struct { · 43 unmodified lines | |||
| 44 | int dir; | 44 | int dir; |
| 45 | } TransContext; | 45 | } TransContext; |
| 46 | 46 | ||
| 47 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 47 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 48 | { | 48 | { |
| 49 | TransContext *trans = ctx->priv; | 49 | TransContext *trans = ctx->priv; |
| 50 | trans->dir = 0; | 50 | trans->dir = 0; |
| @@ -132,7 +132,7 @@ static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, double a · 131 unmodified lines | |||
| 132 | fp->halfscale = 1 << (fp->scalebits - 1); | 132 | fp->halfscale = 1 << (fp->scalebits - 1); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 135 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 136 | { | 136 | { |
| 137 | UnsharpContext *unsharp = ctx->priv; | 137 | UnsharpContext *unsharp = ctx->priv; |
| 138 | int lmsize_x = 5, cmsize_x = 5; | 138 | int lmsize_x = 5, cmsize_x = 5; |
| @@ -397,7 +397,7 @@ static int query_formats(AVFilterContext *ctx) · 396 unmodified lines | |||
| 397 | return 0; | 397 | return 0; |
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 400 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 401 | { | 401 | { |
| 402 | YADIFContext *yadif = ctx->priv; | 402 | YADIFContext *yadif = ctx->priv; |
| 403 | int cpu_flags = av_get_cpu_flags(); | 403 | int cpu_flags = av_get_cpu_flags(); |
| @@ -61,7 +61,7 @@ static const AVOption color_options[]= { · 60 unmodified lines | |||
| 61 | 61 | ||
| 62 | AVFILTER_DEFINE_CLASS(color); | 62 | AVFILTER_DEFINE_CLASS(color); |
| 63 | 63 | ||
| 64 | static av_cold int color_init(AVFilterContext *ctx, const char *args, void *opaque) | 64 | static av_cold int color_init(AVFilterContext *ctx, const char *args) |
| 65 | { | 65 | { |
| 66 | ColorContext *color = ctx->priv; | 66 | ColorContext *color = ctx->priv; |
| 67 | char color_string[128] = "black"; | 67 | char color_string[128] = "black"; |
| @@ -72,7 +72,7 @@ static const AVOption testsrc_options[]= { · 71 unmodified lines | |||
| 72 | { NULL }, | 72 | { NULL }, |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | 75 | static av_cold int init(AVFilterContext *ctx, const char *args) |
| 76 | { | 76 | { |
| 77 | TestSourceContext *test = ctx->priv; | 77 | TestSourceContext *test = ctx->priv; |
| 78 | AVRational frame_rate_q; | 78 | AVRational frame_rate_q; |
| @@ -167,13 +167,13 @@ static const AVClass nullsrc_class = { · 88 unmodified lines | |||
| 167 | 167 | ||
| 168 | static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { } | 168 | static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { } |
| 169 | 169 | ||
| 170 | static av_cold int nullsrc_init(AVFilterContext *ctx, const char *args, void *opaque) | 170 | static av_cold int nullsrc_init(AVFilterContext *ctx, const char *args) |
| 171 | { | 171 | { |
| 172 | TestSourceContext *test = ctx->priv; | 172 | TestSourceContext *test = ctx->priv; |
| 173 | 173 | ||
| 174 | test->class = &nullsrc_class; | 174 | test->class = &nullsrc_class; |
| 175 | test->fill_picture_fn = nullsrc_fill_picture; | 175 | test->fill_picture_fn = nullsrc_fill_picture; |
| 176 | return init(ctx, args, opaque); | 176 | return init(ctx, args); |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | AVFilter avfilter_vsrc_nullsrc = { | 179 | AVFilter avfilter_vsrc_nullsrc = { |
| @@ -373,13 +373,13 @@ static void test_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) · 193 unmodified lines | |||
| 373 | } | 373 | } |
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | static av_cold int test_init(AVFilterContext *ctx, const char *args, void *opaque) | 376 | static av_cold int test_init(AVFilterContext *ctx, const char *args) |
| 377 | { | 377 | { |
| 378 | TestSourceContext *test = ctx->priv; | 378 | TestSourceContext *test = ctx->priv; |
| 379 | 379 | ||
| 380 | test->class = &testsrc_class; | 380 | test->class = &testsrc_class; |
| 381 | test->fill_picture_fn = test_fill_picture; | 381 | test->fill_picture_fn = test_fill_picture; |
| 382 | return init(ctx, args, opaque); | 382 | return init(ctx, args); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | static int test_query_formats(AVFilterContext *ctx) | 385 | static int test_query_formats(AVFilterContext *ctx) |
| @@ -476,13 +476,13 @@ static void rgbtest_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref · 90 unmodified lines | |||
| 476 | } | 476 | } |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args, void *opaque) | 479 | static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args) |
| 480 | { | 480 | { |
| 481 | TestSourceContext *test = ctx->priv; | 481 | TestSourceContext *test = ctx->priv; |
| 482 | 482 | ||
| 483 | test->class = &rgbtestsrc_class; | 483 | test->class = &rgbtestsrc_class; |
| 484 | test->fill_picture_fn = rgbtest_fill_picture; | 484 | test->fill_picture_fn = rgbtest_fill_picture; |
| 485 | return init(ctx, args, opaque); | 485 | return init(ctx, args); |
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | static int rgbtest_query_formats(AVFilterContext *ctx) | 488 | static int rgbtest_query_formats(AVFilterContext *ctx) |