diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavdevice/lavfi.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavdevice/lavfi.c')
| -rw-r--r-- | ffmpeg/libavdevice/lavfi.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ffmpeg/libavdevice/lavfi.c b/ffmpeg/libavdevice/lavfi.c index 159832a..a177ad0 100644 --- a/ffmpeg/libavdevice/lavfi.c +++ b/ffmpeg/libavdevice/lavfi.c @@ -60,7 +60,7 @@ static int *create_all_formats(int n) for (i = 0; i < n; i++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i); - if (!(desc->flags & PIX_FMT_HWACCEL)) + if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) count++; } @@ -68,7 +68,7 @@ static int *create_all_formats(int n) return NULL; for (j = 0, i = 0; i < n; i++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i); - if (!(desc->flags & PIX_FMT_HWACCEL)) + if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) fmts[j++] = i; } fmts[j] = -1; @@ -141,7 +141,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) if (!(lavfi->graph = avfilter_graph_alloc())) FAIL(AVERROR(ENOMEM)); - if ((ret = avfilter_graph_parse(lavfi->graph, lavfi->graph_str, + if ((ret = avfilter_graph_parse_ptr(lavfi->graph, lavfi->graph_str, &input_links, &output_links, avctx)) < 0) FAIL(ret); @@ -227,14 +227,11 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) } if (type == AVMEDIA_TYPE_VIDEO) { - AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc(); - - buffersink_params->pixel_fmts = pix_fmts; ret = avfilter_graph_create_filter(&sink, buffersink, inout->name, NULL, - buffersink_params, lavfi->graph); - av_freep(&buffersink_params); - + NULL, lavfi->graph); + if (ret >= 0) + ret = av_opt_set_int_list(sink, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN); if (ret < 0) goto end; } else if (type == AVMEDIA_TYPE_AUDIO) { @@ -243,13 +240,16 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL, -1 }; - AVABufferSinkParams *abuffersink_params = av_abuffersink_params_alloc(); - abuffersink_params->sample_fmts = sample_fmts; ret = avfilter_graph_create_filter(&sink, abuffersink, inout->name, NULL, - abuffersink_params, lavfi->graph); - av_free(abuffersink_params); + NULL, lavfi->graph); + if (ret >= 0) + ret = av_opt_set_int_list(sink, "sample_fmts", sample_fmts, AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN); + if (ret < 0) + goto end; + ret = av_opt_set_int(sink, "all_channel_counts", 1, + AV_OPT_SEARCH_CHILDREN); if (ret < 0) goto end; } @@ -290,7 +290,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) 30); } else if (link->type == AVMEDIA_TYPE_AUDIO) { st->codec->codec_id = av_get_pcm_codec(link->format, -1); - st->codec->channels = av_get_channel_layout_nb_channels(link->channel_layout); + st->codec->channels = avfilter_link_get_channels(link); st->codec->sample_fmt = link->format; st->codec->sample_rate = link->sample_rate; st->codec->time_base = link->time_base; |
