Bug 1282792 - Start transmitting OR receiving if track is active. r=bwc, a=gchang
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Tue, 28 Jun 2016 01:16:08 +0200
changeset 342182 74d0f7c374dca39a6863ceb5083c2fb36c13f43c
parent 342181 07f644f906ca21016f8f6ebbb6e6463af5d88fea
child 342183 7a7e5f80e25ee0922485c64b806650c8209edc3d
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc, gchang
bugs1282792
milestone49.0a2
Bug 1282792 - Start transmitting OR receiving if track is active. r=bwc, a=gchang MozReview-Commit-ID: GaT5v9UN6ox
media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
--- a/media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
@@ -458,20 +458,28 @@ MediaPipelineFactory::CreateOrUpdateMedi
     if (NS_FAILED(rv))
       return rv;
   } else {
     // We've created the TransportFlow, nothing else to do here.
     return NS_OK;
   }
 
   if (aTrack.GetActive()) {
-    auto error = conduit->StartTransmitting();
-    if (error) {
-      MOZ_MTLOG(ML_ERROR, "StartTransmitting failed: " << error);
-      return NS_ERROR_FAILURE;
+    if (receiving) {
+      auto error = conduit->StartReceiving();
+      if (error) {
+        MOZ_MTLOG(ML_ERROR, "StartReceiving failed: " << error);
+        return NS_ERROR_FAILURE;
+      }
+    } else {
+      auto error = conduit->StartTransmitting();
+      if (error) {
+        MOZ_MTLOG(ML_ERROR, "StartTransmitting failed: " << error);
+        return NS_ERROR_FAILURE;
+      }
     }
   }
 
   RefPtr<MediaPipeline> pipeline =
     stream->GetPipelineByTrackId_m(aTrack.GetTrackId());
 
   if (pipeline && pipeline->level() != static_cast<int>(level)) {
     MOZ_MTLOG(ML_WARNING, "Track " << aTrack.GetTrackId() <<