]> git.sesse.net Git - casparcg/commitdiff
2.0.2: ffmpeg/filter: Don't trust libavfitler to choose optimal pix_fmt.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 4 Dec 2011 15:46:11 +0000 (15:46 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 4 Dec 2011 15:46:11 +0000 (15:46 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.2@1784 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/ffmpeg/producer/filter/filter.cpp

index e9c998e856e3c0d382a35a32290f58cce66dc1bd..3e9c35171d13c5a4869495ca959b8d9d6b8d04ad 100644 (file)
@@ -95,6 +95,13 @@ static int query_formats_411(AVFilterContext *ctx)
     return 0;\r
 }\r
 \r
+static int query_formats_410(AVFilterContext *ctx)\r
+{\r
+    static const int pix_fmts[] = {PIX_FMT_YUV410P, PIX_FMT_NONE};\r
+    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));\r
+    return 0;\r
+}\r
+\r
 struct filter::implementation\r
 {\r
        std::wstring                                    filters_;\r
@@ -182,16 +189,26 @@ struct filter::implementation
 \r
                                        BOOST_FOREACH(auto filter_ctx, boost::make_iterator_range(graph_->filters, graph_->filters + graph_->filter_count) | yadif_filter)\r
                                        {\r
+                                               // Don't trust libavfilter format choice.\r
                                                filter_ctx->filter->query_formats = [&]() -> int (*)(AVFilterContext*)\r
                                                {\r
                                                        switch(frame->format)\r
                                                        {\r
+                                                       case PIX_FMT_YUV410P:   return query_formats_410;\r
+                                                       case PIX_FMT_YUV411P:   return query_formats_411;\r
+                                                       case PIX_FMT_YUV420P:   return query_formats_420;\r
+                                                       case PIX_FMT_YUV422P:   return query_formats_422;\r
+                                                       case PIX_FMT_YUV444P:   return query_formats_444;\r
+                                                       case PIX_FMT_YUVA420P:  return query_formats_420a;\r
                                                        case PIX_FMT_UYVY422:   return query_formats_422;\r
                                                        case PIX_FMT_YUYV422:   return query_formats_422;\r
                                                        case PIX_FMT_UYYVYY411: return query_formats_411;\r
                                                        case PIX_FMT_YUV420P10: return query_formats_420;\r
                                                        case PIX_FMT_YUV422P10: return query_formats_422;\r
                                                        case PIX_FMT_YUV444P10: return query_formats_444;\r
+                                                       case PIX_FMT_YUV420P16: return query_formats_420;\r
+                                                       case PIX_FMT_YUV422P16: return query_formats_422;\r
+                                                       case PIX_FMT_YUV444P16: return query_formats_444;\r
                                                        case PIX_FMT_YUV420P9:  return query_formats_420;\r
                                                        case PIX_FMT_YUV422P9:  return query_formats_422;\r
                                                        case PIX_FMT_YUV444P9:  return query_formats_444;\r