rtph264pay: Add 'set-outcaps-before-handle-buffer' property 24/314624/2 accepted/tizen/unified/20240718.143626 accepted/tizen/unified/dev/20240722.073448 accepted/tizen/unified/x/20240719.012640
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 16 Jul 2024 08:32:11 +0000 (17:32 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 17 Jul 2024 02:10:40 +0000 (11:10 +0900)
In _setcaps(), without codec_data from the caps, it is considered as
bytestream and it defers setting outcaps until a buffer is coming.
This new property enables to set outcaps with default one before handling
a buffer.

[Version] 1.22.8-12
[Issue Type] Improvement

Change-Id: Ib7818e5cdfd16063877b26edd0a09c64b7625ae5
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/gstreamer.spec
subprojects/gst-plugins-good/gst/rtp/gstrtph264pay.c
subprojects/gst-plugins-good/gst/rtp/gstrtph264pay.h
subprojects/gst-plugins-good/meson.build

index 82fea0271cba5abd399b8e632ee5b4c6406abe50..070affe50a21058068637077d2358db55460b996 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.22.8
-Release:        11
+Release:        12
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index de476e64e934d4d27240fee466d5ab6f2b688a72..95839ada22cd0790fa50fec41fd09b5d16fbe4b7 100644 (file)
@@ -108,6 +108,9 @@ enum
   PROP_SPROP_PARAMETER_SETS,
   PROP_CONFIG_INTERVAL,
   PROP_AGGREGATE_MODE,
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+  PROP_SET_OUTCAPS_BEFORE_HANDLE_BUFFER_WHEN_BYTESTREAM,
+#endif
 };
 
 static void gst_rtp_h264_pay_finalize (GObject * object);
@@ -193,6 +196,15 @@ gst_rtp_h264_pay_class_init (GstRtpH264PayClass * klass)
           DEFAULT_AGGREGATE_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
       );
 
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+  g_object_class_install_property (G_OBJECT_CLASS (klass),
+      PROP_SET_OUTCAPS_BEFORE_HANDLE_BUFFER_WHEN_BYTESTREAM,
+      g_param_spec_boolean ("set-outcaps-before-handle-buffer",
+          "Set outcaps before handling buffer",
+          "Configure outcaps before handling buffer in case of bytestream",
+          FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
+      );
+#endif
   gobject_class->finalize = gst_rtp_h264_pay_finalize;
 
   gst_element_class_add_static_pad_template (gstelement_class,
@@ -233,6 +245,9 @@ gst_rtp_h264_pay_init (GstRtpH264Pay * rtph264pay)
   rtph264pay->aggregate_mode = DEFAULT_AGGREGATE_MODE;
   rtph264pay->delta_unit = FALSE;
   rtph264pay->discont = FALSE;
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+  rtph264pay->set_outcaps_before_handle_buffer = FALSE;
+#endif
 
   rtph264pay->adapter = gst_adapter_new ();
 
@@ -682,6 +697,10 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps)
     gst_buffer_unmap (buffer, &map);
   } else {
     GST_DEBUG_OBJECT (rtph264pay, "have bytestream h264");
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+    if (rtph264pay->set_outcaps_before_handle_buffer)
+      gst_rtp_base_payload_set_outcaps (basepayload, NULL);
+#endif
   }
 
   return TRUE;
@@ -1798,6 +1817,11 @@ gst_rtp_h264_pay_set_property (GObject * object, guint prop_id,
     case PROP_AGGREGATE_MODE:
       rtph264pay->aggregate_mode = g_value_get_enum (value);
       break;
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+    case PROP_SET_OUTCAPS_BEFORE_HANDLE_BUFFER_WHEN_BYTESTREAM:
+      rtph264pay->set_outcaps_before_handle_buffer = g_value_get_boolean (value);
+      break;
+#endif
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1822,6 +1846,11 @@ gst_rtp_h264_pay_get_property (GObject * object, guint prop_id,
     case PROP_AGGREGATE_MODE:
       g_value_set_enum (value, rtph264pay->aggregate_mode);
       break;
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+    case PROP_SET_OUTCAPS_BEFORE_HANDLE_BUFFER_WHEN_BYTESTREAM:
+      g_value_set_boolean(value, rtph264pay->set_outcaps_before_handle_buffer);
+      break;
+#endif
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
index c983a9251a4dd1b49de213654cda60c5c3b8818d..e9ca255b790974388e9958e16ab91c2788c50ebd 100644 (file)
@@ -95,6 +95,9 @@ struct _GstRtpH264Pay
   guint bundle_size;
   gboolean bundle_contains_vcl;
   GstRTPH264AggregateMode aggregate_mode;
+#ifdef TIZEN_FEATURE_RTPH264PAY_MODIFICATION
+  gboolean set_outcaps_before_handle_buffer;
+#endif
 };
 
 struct _GstRtpH264PayClass
index 5caccb3f0fa4896f1ec4a23247ac37b3b0d26ca4..45f80d686ad0de741530654c9470f7fb6a9af2da 100644 (file)
@@ -481,6 +481,7 @@ cdata.set('TIZEN_FEATURE_POST_VARIANT_INFO', true)
 cdata.set('TIZEN_FEATURE_ADAPTIVE_VARIANT_LIMIT', true)
 cdata.set('TIZEN_FEATURE_BUG_FIX', true)
 cdata.set('TIZEN_FEATURE_V4L2_ENCODER_SET_MAX_LEVEL', true)
+cdata.set('TIZEN_FEATURE_RTPH264PAY_MODIFICATION', true)
 
 if get_option('tv-profile')
   cdata.set('TIZEN_PROFILE_TV', true)