rtph264pay: Don't set profile-level-id in out caps

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
This commit is contained in:
Olivier Crête 2010-01-18 14:49:26 -05:00 committed by Wim Taymans
parent 7a0590b1f1
commit c4fa559f15
2 changed files with 6 additions and 17 deletions

View file

@ -151,8 +151,7 @@ gst_rtp_h264_pay_class_init (GstRtpH264PayClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), g_object_class_install_property (G_OBJECT_CLASS (klass),
PROP_PROFILE_LEVEL_ID, g_param_spec_string ("profile-level-id", PROP_PROFILE_LEVEL_ID, g_param_spec_string ("profile-level-id",
"profile-level-id", "profile-level-id",
"The base64 profile-level-id to set in out caps (set to NULL to " "The base64 profile-level-id to set in the sink caps (deprecated)",
"extract from stream)",
DEFAULT_PROFILE_LEVEL_ID, DEFAULT_PROFILE_LEVEL_ID,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); 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); gst_rtp_h264_pay_clear_sps_pps (rtph264pay);
g_free (rtph264pay->profile_level_id);
g_free (rtph264pay->sprop_parameter_sets); g_free (rtph264pay->sprop_parameter_sets);
G_OBJECT_CLASS (parent_class)->finalize (object); 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 is 24 bit. Force it to respect the limit */
profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff); profile = g_strdup_printf ("%06x", payloader->profile & 0xffffff);
/* combine into output caps */ /* combine into output caps */
res = gst_basertppayload_set_outcaps (basepayload, "profile-level-id", res = gst_basertppayload_set_outcaps (basepayload,
G_TYPE_STRING, profile,
"sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL); "sprop-parameter-sets", G_TYPE_STRING, sprops->str, NULL);
g_string_free (sprops, TRUE); g_string_free (sprops, TRUE);
g_free (profile); 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, GST_DEBUG_OBJECT (basepayload, "found next start at %u of size %u", next,
nal_len); nal_len);
if (rtph264pay->profile_level_id != NULL && if (rtph264pay->sprop_parameter_sets != NULL) {
rtph264pay->sprop_parameter_sets != NULL) {
/* explicitly set profile and sprop, use those */ /* explicitly set profile and sprop, use those */
if (rtph264pay->update_caps) { if (rtph264pay->update_caps) {
if (!gst_basertppayload_set_outcaps (basepayload, "profile-level-id", if (!gst_basertppayload_set_outcaps (basepayload,
G_TYPE_STRING, rtph264pay->profile_level_id,
"sprop-parameter-sets", G_TYPE_STRING, "sprop-parameter-sets", G_TYPE_STRING,
rtph264pay->sprop_parameter_sets, NULL)) rtph264pay->sprop_parameter_sets, NULL))
goto caps_rejected; goto caps_rejected;
rtph264pay->update_caps = FALSE; rtph264pay->update_caps = FALSE;
GST_DEBUG GST_DEBUG ("outcaps udpate: sprop-parameter-sets=%s",
("outcaps udpate: profile-level-id=%s, sprop-parameter-sets=%s", rtph264pay->sprop_parameter_sets);
rtph264pay->profile_level_id, rtph264pay->sprop_parameter_sets);
} }
} else { } else {
/* We know our stream is a valid H264 NAL packet, /* 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) { switch (prop_id) {
case PROP_PROFILE_LEVEL_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; break;
case PROP_SPROP_PARAMETER_SETS: case PROP_SPROP_PARAMETER_SETS:
g_free (rtph264pay->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) { switch (prop_id) {
case PROP_PROFILE_LEVEL_ID: case PROP_PROFILE_LEVEL_ID:
g_value_set_string (value, rtph264pay->profile_level_id);
break; break;
case PROP_SPROP_PARAMETER_SETS: case PROP_SPROP_PARAMETER_SETS:
g_value_set_string (value, rtph264pay->sprop_parameter_sets); g_value_set_string (value, rtph264pay->sprop_parameter_sets);

View file

@ -57,7 +57,6 @@ struct _GstRtpH264Pay
guint nal_length_size; guint nal_length_size;
GArray *queue; GArray *queue;
gchar *profile_level_id;
gchar *sprop_parameter_sets; gchar *sprop_parameter_sets;
gboolean update_caps; gboolean update_caps;
GstH264ScanMode scan_mode; GstH264ScanMode scan_mode;