Skip to content
  • Sebastian Dröge's avatar
    rtpsession: Also start the RTCP send thread when receiving RTP or RTCP · 17d90b45
    Sebastian Dröge authored
    Before we only started it when either:
    - there is no send RTP stream
    or
    - we received an RTP packet for sending
    
    This could mean that if the send RTP pads are connected but never receive any
    RTP data, and the same session is also used for receiving RTP/RTCP, we would
    never start the RTCP thread and would never send RTCP for the receiving part
    of the session.
    
    This can be reproduced with a pipeline like:
    
    gst-launch-1.0 rtpbin name=rtpbin \
    udpsrc port=5000 ! "application/x-rtp, media=video, clock-rate=90000, encoding-name=H264" ! rtpbin.recv_rtp_sink_0 \
    udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
    rtpbin.send_rtcp_src_0 ! fakesink name=rtcp_fakesink silent=false async=false sync=false \
    rtpbin.recv_rtp_src_0_2553225531_96 ! decodebin ! xvimagesink \
    fakesrc ! valve drop=true ! rtpbin.send_rtp_sink_0 \
    rtpbin.send_rtp_src_0 ! fakesink name=rtp_fakesink silent=false async=false sync=false -v
    
    Before this change the rtcp_fakesink would never send RTCP for the receiving
    part of the session (i.e. no receiver reports!), after the change it does.
    
    And before and after this change it would send RTCP for the receiving part of
    the session if the sender part was omitted (the last two lines).
    17d90b45