]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/vaapi: Fix build with libva 2.1 and 2.2
authorMark Thompson <sw@jkqxz.net>
Fri, 7 Jun 2019 20:15:29 +0000 (21:15 +0100)
committerMark Thompson <sw@jkqxz.net>
Fri, 7 Jun 2019 20:15:29 +0000 (21:15 +0100)
While the VAProcColorProperties structure was added in libva 2.1, the
colour primaries/transfer/space fields were not added until libva 2.3.

libavfilter/vaapi_vpp.c

index 0486c295cb332aa28855d55ddeb0890e77c0fbb2..b5b245c8afeb8ec69d062da49ab84225cf10038f 100644 (file)
@@ -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