v4l2videodec: Add removed tizen feature code by conflict 74/287374/1
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 27 Jan 2023 08:47:13 +0000 (17:47 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Fri, 27 Jan 2023 08:47:13 +0000 (17:47 +0900)
- It fixes failure of player API.

Change-Id: Id9e0820daf65fa398755c24b39945e1a8e399142
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/gstreamer.spec
subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c

index e4dfabb..08dcd5e 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.22.0
-Release:        44
+Release:        2
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index e784e93..cfb95ae 100644 (file)
@@ -622,6 +622,11 @@ gst_v4l2_video_dec_setup_capture (GstVideoDecoder * decoder)
   GstStructure *st;
   GstBufferPool *cpool;
   gboolean active;
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+  GstStructure *structure = NULL;
+  const gchar *caps_format = NULL;
+  GstMessage *msg = NULL;
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   if (G_UNLIKELY (!GST_V4L2_IS_ACTIVE (self->v4l2capture))) {
     /* init capture fps according to output */
@@ -676,6 +681,19 @@ gst_v4l2_video_dec_setup_capture (GstVideoDecoder * decoder)
     caps = gst_caps_fixate (caps);
 
     GST_DEBUG_OBJECT (self, "Chosen decoded caps: %" GST_PTR_FORMAT, caps);
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+    structure = gst_caps_get_structure (caps, 0);
+    caps_format = gst_structure_get_string (structure, "format");
+
+    if (!strcmp (caps_format, "I420")) {
+      GST_INFO_OBJECT (self, "I420 -> S420");
+      gst_caps_set_simple (caps, "format", G_TYPE_STRING, "S420", NULL);
+    } else if (!strcmp (caps_format, "NV12")) {
+      GST_INFO_OBJECT (self, "NV12 -> SN12");
+      gst_caps_set_simple (caps, "format", G_TYPE_STRING, "SN12", NULL);
+    }
+    GST_INFO_OBJECT (self, "Updated decoded caps: %" GST_PTR_FORMAT, caps);
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
     /* Try to set negotiated format, on success replace acquired format */
     if (gst_v4l2_object_set_format (self->v4l2capture, caps, &error))
@@ -711,6 +729,16 @@ gst_v4l2_video_dec_setup_capture (GstVideoDecoder * decoder)
       gst_object_unref (cpool);
     if (!active)
       goto activate_failed;
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+    msg = gst_message_new_element (GST_OBJECT_CAST (decoder),
+        gst_structure_new ("prepare-decode-buffers",
+            "num_buffers", G_TYPE_INT, GST_V4L2_BUFFER_POOL (cpool)->num_allocated,
+            "extra_num_buffers", G_TYPE_INT, GST_V4L2_BUFFER_POOL (cpool)->num_allocated - 2, NULL));
+
+    gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
+
+    GST_WARNING_OBJECT (self, "output buffer[%d]", GST_V4L2_BUFFER_POOL (cpool)->num_allocated);
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   }
 
   return GST_FLOW_OK;