Bug 1279135 - Reattach Pipeline to PipelineTransport in AttachTransport_s; r=jesup
authorDan Minor <dminor@mozilla.com>
Fri, 29 Jul 2016 11:04:49 -0400
changeset 351452 be822ebbacc0b5e1495b032b1c83194bddc69fc8
parent 351451 315d7872e8293e86fabe878834f99fd1f7e1c83a
child 351453 fe5d0a5fa8fe7447abcd1e2e0dfd1cb478479682
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1279135
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1279135 - Reattach Pipeline to PipelineTransport in AttachTransport_s; r=jesup 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,