Bug 1279135 - Reattach Pipeline to PipelineTransport in AttachTransport_s; r=jesup a=lizzard
authorDan Minor <dminor@mozilla.com>
Fri, 29 Jul 2016 11:04:49 -0400
changeset 349698 deb2509ac6d9baf072376204f6111d0f4bc5f2a6
parent 349697 e40ae26e776c825f2255fc15e54d4af759c88d37
child 349699 858abdc854851e153a60b414e09f3a2375963bdc
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lizzard
bugs1279135
milestone50.0a2
Bug 1279135 - Reattach Pipeline to PipelineTransport in AttachTransport_s; r=jesup a=lizzard When we call MediaPipeline::UpdateTransport_s we in turn call DetachTransport_s which detaches the pipeline from PipelineTransport. The subsequent call to AttachTransport_s does not currently reattach the pipeline, causing subsequent sends to fail due to a detached pipeline. Since PipelineTransport::SendRtpRtcpPacket_s returns NS_OK if a send fails due to a detached pipeline, this failure is not straightforward to detect. This patch adds an Attach() method to PipelineTransport and calls it from AttachTransport_s. MozReview-Commit-ID: Kfc3TH1YOno
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -558,16 +558,19 @@ MediaPipeline::AttachTransport_s()
   }
 
   if (rtcp_.transport_ != rtp_.transport_) {
     res = ConnectTransport_s(rtcp_);
     if (NS_FAILED(res)) {
       return res;
     }
   }
+
+  transport_->Attach(this);
+
   return NS_OK;
 }
 
 void
 MediaPipeline::UpdateTransport_m(int level,
                                  RefPtr<TransportFlow> rtp_transport,
                                  RefPtr<TransportFlow> rtcp_transport,
                                  nsAutoPtr<MediaPipelineFilter> filter)
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
@@ -161,16 +161,17 @@ class MediaPipeline : public sigslot::ha
   // Separate class to allow ref counting
   class PipelineTransport : public TransportInterface {
    public:
     // Implement the TransportInterface functions
     explicit PipelineTransport(MediaPipeline *pipeline)
         : pipeline_(pipeline),
           sts_thread_(pipeline->sts_thread_) {}
 
+    void Attach(MediaPipeline *pipeline) { pipeline_ = pipeline; }
     void Detach() { pipeline_ = nullptr; }
     MediaPipeline *pipeline() const { return pipeline_; }
 
     virtual nsresult SendRtpPacket(const void* data, int len);
     virtual nsresult SendRtcpPacket(const void* data, int len);
 
    private:
     nsresult SendRtpRtcpPacket_s(nsAutoPtr<DataBuffer> data,