libs: encoder: h265: ensures profile given format
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Wed, 29 Mar 2017 17:16:50 +0000 (19:16 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Thu, 6 Apr 2017 20:00:05 +0000 (22:00 +0200)
Set the VA profile as GST_VAAPI_PROFILE_H265_MAIN10 if the
configured color format is P010_10LE.

Otherwise, keep GST_VAAPI_PROFILE_H265_MAIN

https://bugzilla.gnome.org/show_bug.cgi?id=771291

gst-libs/gst/vaapi/gstvaapiencoder_h265.c

index 7170bcf..8993e14 100644 (file)
@@ -936,11 +936,16 @@ static gboolean
 ensure_profile (GstVaapiEncoderH265 * encoder)
 {
   GstVaapiProfile profile;
+  const GstVideoFormat format =
+      GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
 
   /* Always start from "Main" profile for maximum
      compatibility */
   profile = GST_VAAPI_PROFILE_H265_MAIN;
 
+  if (format == GST_VIDEO_FORMAT_P010_10LE)
+    profile = GST_VAAPI_PROFILE_H265_MAIN10;
+
   encoder->profile = profile;
   encoder->profile_idc = gst_vaapi_utils_h265_get_profile_idc (profile);
   return TRUE;