Revert "rtspsrc: Fix up sendonly/recvonly attribute handling"

This reverts commit af273b4de9.

While RFC 3264 (SDP) says that sendonly/recvonly are from the point of view of
the requester, the actual RTSP RFCs (RFC 2326 / 7826) disagree and say
the opposite, just like the ONVIF standard.

Let's follow those RFCs as we're doing RTSP here, and add a property at
a later time if needed to switch to the SDP RFC behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=793964
This commit is contained in:
Sebastian Dröge 2018-04-17 17:57:16 +03:00
parent 336a97157c
commit 6d92fcd043
2 changed files with 8 additions and 8 deletions

View file

@ -1772,10 +1772,10 @@ gst_rtspsrc_collect_payloads (GstRTSPSrc * src, const GstSDPMessage * sdp,
else
goto unknown_proto;
if (gst_sdp_media_get_attribute_val (media, "recvonly") != NULL &&
if (gst_sdp_media_get_attribute_val (media, "sendonly") != NULL &&
/* We want to setup caps for streams configured as backchannel */
!stream->is_backchannel && src->backchannel != BACKCHANNEL_NONE)
goto recvonly_media;
goto sendonly_media;
/* Parse global SDP attributes once */
global_caps = gst_caps_new_empty_simple ("application/x-unknown");
@ -1846,9 +1846,9 @@ unknown_proto:
GST_ERROR_OBJECT (src, "unknown proto in media: '%s'", proto);
return;
}
recvonly_media:
sendonly_media:
{
GST_WARNING_OBJECT (src, "recvonly media ignored, no backchannel");
GST_DEBUG_OBJECT (src, "sendonly media ignored, no backchannel");
return;
}
}
@ -1913,8 +1913,8 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx,
g_mutex_init (&stream->conninfo.recv_lock);
g_array_set_clear_func (stream->ptmap, (GDestroyNotify) clear_ptmap_item);
/* stream is recvonly and onvif backchannel is requested */
if (gst_sdp_media_get_attribute_val (media, "recvonly") != NULL &&
/* stream is sendonly and onvif backchannel is requested */
if (gst_sdp_media_get_attribute_val (media, "sendonly") != NULL &&
src->backchannel != BACKCHANNEL_NONE)
stream->is_backchannel = TRUE;
@ -3046,7 +3046,7 @@ new_manager_pad (GstElement * manager, GstPad * pad, GstRTSPSrc * src)
gst_pad_set_active (stream->srcpad, TRUE);
gst_pad_sticky_events_foreach (pad, copy_sticky_events, stream->srcpad);
/* don't add the srcpad if this is a recvonly stream */
/* don't add the srcpad if this is a sendonly stream */
if (stream->is_backchannel)
add_backchannel_fakesink (src, stream, stream->srcpad);
else

View file

@ -62,7 +62,7 @@ find_backchannel (GstElement * rtspsrc, guint idx, GstCaps * caps,
g_free (caps_str);
s = gst_caps_get_structure (caps, 0);
if (gst_structure_has_field (s, "a-recvonly")) {
if (gst_structure_has_field (s, "a-sendonly")) {
stream_id = idx;
caps = gst_caps_new_empty ();
s = gst_structure_copy (s);