[v4l2videodecoder] Post message for number of buffers 63/253263/2 accepted/tizen/unified/20210210.052227 submit/tizen/20210209.050024
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 8 Feb 2021 05:16:22 +0000 (14:16 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 8 Feb 2021 05:31:25 +0000 (14:31 +0900)
- Tizen media player framework refers it for buffer management.

[Version] 1.16.2-19
[Issue Type] Update

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

index 3ecb1b66f84167efe36f27a8897020f7636a8400..cc505f576d177ff9184e34837d6cab70f12e2b9c 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:           gst-plugins-good
 Version:        1.16.2
-Release:        18
+Release:        19
 License:        LGPL-2.1+
 Summary:        GStreamer Streaming-Media Framework Plug-Ins
 Url:            http://gstreamer.freedesktop.org/
index b43a6c9b271a045a3b47a4f3ec99b29b699a1ea2..f1c32e81e9889051886b321efb390551d1117603 100644 (file)
@@ -612,6 +612,8 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
 #ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
   GstStructure *structure = NULL;
   const gchar *caps_format = NULL;
+  GstMessage *msg = NULL;
+  GstV4l2BufferPool *capture_pool = NULL;
 #endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
 
   GST_DEBUG_OBJECT (self, "Handling frame %d", frame->system_frame_number);
@@ -751,6 +753,18 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
     if (!gst_buffer_pool_set_active (GST_BUFFER_POOL (self->v4l2capture->pool),
             TRUE))
       goto activate_failed;
+#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+    capture_pool = GST_V4L2_BUFFER_POOL (self->v4l2capture->pool);
+
+    msg = gst_message_new_element (GST_OBJECT_CAST (decoder),
+        gst_structure_new ("prepare-decode-buffers",
+            "num_buffers", G_TYPE_INT, capture_pool->num_allocated,
+            "extra_num_buffers", G_TYPE_INT, capture_pool->num_allocated - 2, NULL));
+
+    gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
+
+    GST_WARNING_OBJECT (self, "output buffer[%d]", capture_pool->num_allocated);
+#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
   }
 
   task_state = gst_pad_get_task_state (GST_VIDEO_DECODER_SRC_PAD (self));