rtph264pay: Don't set profile-level-id in out caps
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>
Mon, 18 Jan 2010 19:49:26 +0000 (14:49 -0500)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 19 Jan 2010 12:47:38 +0000 (13:47 +0100)
The profile-level-id represents restrictions on what can be sent, it does not
describe the stream. So it should be reflected in the sink caps of the
payloader, not the src caps.

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

gst/rtp/gstrtph264pay.c
gst/rtp/gstrtph264pay.h

index 3876e3bca87431131a1e6f2ee47259326fc4af44..2efbbab9deedab8112ebd15b8bca99491d1976a1 100644 (file)
@@ -151,8 +151,7 @@ gst_rtp_h264_pay_class_init (GstRtpH264PayClass * klass)
   g_object_class_install_property (G_OBJECT_CLASS (klass),
       PROP_PROFILE_LEVEL_ID, g_param_spec_string ("profile-level-id",
           "profile-level-id",
-          "The base64 profile-level-id to set in out caps (set to NULL to "
-          "extract from stream)",
+          "The base64 profile-level-id to set in the sink caps (deprecated)",
           DEFAULT_PROFILE_LEVEL_ID,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
@@ -230,7 +229,6 @@ gst_rtp_h264_pay_finalize (GObject * object)
 
   gst_rtp_h264_pay_clear_sps_pps (rtph264pay);
 
-  g_free (rtph264pay->profile_level_id);
   g_free (rtph264pay->sprop_parameter_sets);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -275,8 +273,7 @@ gst_rtp_h264_pay_set_sps_pps (GstBaseRTPPayload * basepayload)
   /* profile is 24 bit. Force it to respect the limit */
   profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
   /* combine into output caps */
-  res = gst_basertppayload_set_outcaps (basepayload, "profile-level-id",
-      G_TYPE_STRING, profile,
+  res = gst_basertppayload_set_outcaps (basepayload,
       "sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
   g_string_free (sprops, TRUE);
   g_free (profile);
@@ -945,21 +942,18 @@ gst_rtp_h264_pay_handle_buffer (GstBaseRTPPayload * basepayload,
       GST_DEBUG_OBJECT (basepayload, "found next start at %u of size %u", next,
           nal_len);
 
-      if (rtph264pay->profile_level_id != NULL &&
-          rtph264pay->sprop_parameter_sets != NULL) {
+      if (rtph264pay->sprop_parameter_sets != NULL) {
         /* explicitly set profile and sprop, use those */
         if (rtph264pay->update_caps) {
-          if (!gst_basertppayload_set_outcaps (basepayload, "profile-level-id",
-                  G_TYPE_STRING, rtph264pay->profile_level_id,
+          if (!gst_basertppayload_set_outcaps (basepayload,
                   "sprop-parameter-sets", G_TYPE_STRING,
                   rtph264pay->sprop_parameter_sets, NULL))
             goto caps_rejected;
 
           rtph264pay->update_caps = FALSE;
 
-          GST_DEBUG
-              ("outcaps udpate: profile-level-id=%s, sprop-parameter-sets=%s",
-              rtph264pay->profile_level_id, rtph264pay->sprop_parameter_sets);
+          GST_DEBUG ("outcaps udpate: sprop-parameter-sets=%s",
+              rtph264pay->sprop_parameter_sets);
         }
       } else {
         /* We know our stream is a valid H264 NAL packet,
@@ -1025,9 +1019,6 @@ gst_rtp_h264_pay_set_property (GObject * object, guint prop_id,
 
   switch (prop_id) {
     case PROP_PROFILE_LEVEL_ID:
-      g_free (rtph264pay->profile_level_id);
-      rtph264pay->profile_level_id = g_value_dup_string (value);
-      rtph264pay->update_caps = TRUE;
       break;
     case PROP_SPROP_PARAMETER_SETS:
       g_free (rtph264pay->sprop_parameter_sets);
@@ -1059,7 +1050,6 @@ gst_rtp_h264_pay_get_property (GObject * object, guint prop_id,
 
   switch (prop_id) {
     case PROP_PROFILE_LEVEL_ID:
-      g_value_set_string (value, rtph264pay->profile_level_id);
       break;
     case PROP_SPROP_PARAMETER_SETS:
       g_value_set_string (value, rtph264pay->sprop_parameter_sets);
index 3522d83dfe488e86c47cb5d9dd655e350b53a0f9..823756fe4d049fd4a7e8709179ce7210d1c7aa5e 100644 (file)
@@ -57,7 +57,6 @@ struct _GstRtpH264Pay
   guint nal_length_size;
   GArray *queue;
 
-  gchar *profile_level_id;
   gchar *sprop_parameter_sets;
   gboolean update_caps;
   GstH264ScanMode scan_mode;