msdkvp9enc: add support for 8 bits 444 input
authorHaihao Xiang <haihao.xiang@intel.com>
Fri, 20 Mar 2020 06:38:12 +0000 (14:38 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Mon, 23 Mar 2020 00:15:21 +0000 (08:15 +0800)
The input format is VUYA in sink pad and the corresponding profile in
src pad is profile 1

sys/msdk/gstmsdkvp9enc.c

index b5fd981..f2d1445 100644 (file)
@@ -40,7 +40,7 @@
 GST_DEBUG_CATEGORY_EXTERN (gst_msdkvp9enc_debug);
 #define GST_CAT_DEFAULT gst_msdkvp9enc_debug
 
-#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE }"
+#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA }"
 
 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
@@ -54,7 +54,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_STATIC_CAPS ("video/x-vp9, "
         "framerate = (fraction) [0/1, MAX], "
         "width = (int) [ 1, MAX ], height = (int) [ 1, MAX ], "
-        "profile = (string) { 0, 2 } ")
+        "profile = (string) { 0, 1, 2 } ")
     );
 
 #define gst_msdkvp9enc_parent_class parent_class
@@ -93,6 +93,8 @@ gst_msdkvp9enc_set_format (GstMsdkEnc * encoder)
     if (profile) {
       if (!strcmp (profile, "2")) {
         thiz->profile = MFX_PROFILE_VP9_2;
+      } else if (!strcmp (profile, "1")) {
+        thiz->profile = MFX_PROFILE_VP9_1;
       } else if (!strcmp (profile, "0")) {
         thiz->profile = MFX_PROFILE_VP9_0;
       } else {
@@ -130,6 +132,10 @@ gst_msdkvp9enc_configure (GstMsdkEnc * encoder)
       encoder->param.mfx.CodecProfile = MFX_PROFILE_VP9_2;
       break;
 
+    case MFX_FOURCC_AYUV:
+      encoder->param.mfx.CodecProfile = MFX_PROFILE_VP9_1;
+      break;
+
     default:
       encoder->param.mfx.CodecProfile = MFX_PROFILE_VP9_0;
       break;
@@ -166,6 +172,8 @@ profile_to_string (gint profile)
   switch (profile) {
     case MFX_PROFILE_VP9_2:
       return "2";
+    case MFX_PROFILE_VP9_1:
+      return "1";
     case MFX_PROFILE_VP9_0:
       return "0";
     default: