Revert "rtspsrc: Fix up sendonly/recvonly attribute handling"
authorSebastian Dröge <sebastian@centricular.com>
Tue, 17 Apr 2018 14:57:16 +0000 (17:57 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 17 Apr 2018 14:58:01 +0000 (17:58 +0300)
This reverts commit af273b4de9eb292c0b6af63665e10ca015895902.

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

gst/rtsp/gstrtspsrc.c
tests/examples/rtsp/test-onvif.c

index f5fd695..91a0da6 100644 (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
index 671c20f..3a46491 100644 (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);