[FFmpeg-cvslog] lavfi/vaapi: Fix build with libva 2.1 and 2.2

Mark Thompson git at videolan.org
Fri Jun 7 23:18:34 EEST 2019


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Fri Jun  7 21:15:29 2019 +0100| [a53f9fde45e6fd4007a85b39eab0a693900cd936] | committer: Mark Thompson

lavfi/vaapi: Fix build with libva 2.1 and 2.2

While the VAProcColorProperties structure was added in libva 2.1, the
colour primaries/transfer/space fields were not added until libva 2.3.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a53f9fde45e6fd4007a85b39eab0a693900cd936
---

 libavfilter/vaapi_vpp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c
index 0486c295cb..b5b245c8af 100644
--- a/libavfilter/vaapi_vpp.c
+++ b/libavfilter/vaapi_vpp.c
@@ -273,7 +273,7 @@ static void vaapi_vpp_fill_colour_standard(VAAPIColourProperties *props,
     int i, j, score, best_score, worst_score;
     VAProcColorStandardType best_standard;
 
-#if VA_CHECK_VERSION(1, 1, 0)
+#if VA_CHECK_VERSION(1, 3, 0)
     // If the driver supports explicit use of the standard values then just
     // use them and avoid doing any mapping.  (The driver may not support
     // some particular code point, but it still has enough information to
@@ -463,7 +463,7 @@ static int vaapi_vpp_colour_properties(AVFilterContext *avctx,
 
     // If the properties weren't filled completely in the output frame and
     // we chose a fixed standard then fill the known values in here.
-#if VA_CHECK_VERSION(1, 1, 0)
+#if VA_CHECK_VERSION(1, 3, 0)
     if (output_props.va_color_standard != VAProcColorStandardExplicit)
 #endif
     {
@@ -492,16 +492,20 @@ static int vaapi_vpp_colour_properties(AVFilterContext *avctx,
     params->input_color_properties = (VAProcColorProperties) {
         .chroma_sample_location   = input_props.va_chroma_sample_location,
         .color_range              = input_props.va_color_range,
+#if VA_CHECK_VERSION(1, 3, 0)
         .colour_primaries         = input_props.color_primaries,
         .transfer_characteristics = input_props.color_trc,
         .matrix_coefficients      = input_props.colorspace,
+#endif
     };
     params->output_color_properties = (VAProcColorProperties) {
         .chroma_sample_location   = output_props.va_chroma_sample_location,
         .color_range              = output_props.va_color_range,
+#if VA_CHECK_VERSION(1, 3, 0)
         .colour_primaries         = output_props.color_primaries,
         .transfer_characteristics = output_props.color_trc,
         .matrix_coefficients      = output_props.colorspace,
+#endif
     };
 #endif
 



More information about the ffmpeg-cvslog mailing list