Bug 1319489 - Remove USE_FAKE_MEDIA_STREAMS; r=jesup
authorDan Minor <dminor@mozilla.com>
Mon, 02 Jan 2017 11:52:48 -0500
changeset 372838 062be1b8915fe66089bfd66b028c81fa767f952b
parent 372837 4ebe288d09f5124b0a0b2409bebb9a0ff3272e5c
child 372839 f03319359207676556b5b7f354d4e245c5ee0a9c
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1319489
milestone54.0a1
Bug 1319489 - Remove USE_FAKE_MEDIA_STREAMS; r=jesup MozReview-Commit-ID: 4CdECHBNmDs
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -2,19 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Original author: ekr@rtfm.com
 
 #include "MediaPipeline.h"
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 #include "MediaStreamGraphImpl.h"
-#endif
 
 #include <math.h>
 
 #include "nspr.h"
 #include "srtp.h"
 
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
 #include "VideoSegment.h"
@@ -1708,31 +1706,27 @@ nsresult MediaPipeline::PipelineTranspor
                              buf, false),
                 NS_DISPATCH_NORMAL);
 
   return NS_OK;
 }
 
 void MediaPipelineTransmit::PipelineListener::
 UnsetTrackId(MediaStreamGraphImpl* graph) {
-#ifndef USE_FAKE_MEDIA_STREAMS
   class Message : public ControlMessage {
   public:
     explicit Message(PipelineListener* listener) :
       ControlMessage(nullptr), listener_(listener) {}
     virtual void Run() override
     {
       listener_->UnsetTrackIdImpl();
     }
     RefPtr<PipelineListener> listener_;
   };
   graph->AppendMessage(MakeUnique<Message>(this));
-#else
-  UnsetTrackIdImpl();
-#endif
 }
 // Called if we're attached with AddDirectListener()
 void MediaPipelineTransmit::PipelineListener::
 NotifyRealtimeTrackData(MediaStreamGraph* graph,
                         StreamTime offset,
                         const MediaSegment& media) {
   MOZ_MTLOG(ML_DEBUG, "MediaPipeline::NotifyRealtimeTrackData() listener=" <<
                       this << ", offset=" << offset <<
@@ -1888,17 +1882,16 @@ class GenericReceiveListener : public Me
     AddListener(source_, this);
   }
 
   void EndTrack()
   {
     source_->EndTrack(track_id_);
   }
 
-#ifndef USE_FAKE_MEDIA_STREAMS
   // Must be called on the main thread
   void SetPrincipalHandle_m(const PrincipalHandle& principal_handle)
   {
     class Message : public ControlMessage
     {
     public:
       Message(GenericReceiveListener* listener,
               MediaStream* stream,
@@ -1919,17 +1912,16 @@ class GenericReceiveListener : public Me
     source_->GraphImpl()->AppendMessage(MakeUnique<Message>(this, source_, principal_handle));
   }
 
   // Must be called on the MediaStreamGraph thread
   void SetPrincipalHandle_msg(const PrincipalHandle& principal_handle)
   {
     principal_handle_ = principal_handle;
   }
-#endif // USE_FAKE_MEDIA_STREAMS
 
  protected:
   SourceMediaStream *source_;
   const TrackID track_id_;
   TrackTicks played_ticks_;
   PrincipalHandle principal_handle_;
 };
 
@@ -2105,22 +2097,20 @@ nsresult MediaPipelineReceiveAudio::Init
   description_ += track_id_;
   description_ += "]";
 
   listener_->AddSelf();
 
   return MediaPipelineReceive::Init();
 }
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 void MediaPipelineReceiveAudio::SetPrincipalHandle_m(const PrincipalHandle& principal_handle)
 {
   listener_->SetPrincipalHandle_m(principal_handle);
 }
-#endif // USE_FAKE_MEDIA_STREAMS
 
 class MediaPipelineReceiveVideo::PipelineListener
   : public GenericReceiveListener {
 public:
   PipelineListener(SourceMediaStream * source, TrackID track_id)
     : GenericReceiveListener(source, track_id),
       width_(0),
       height_(0),
@@ -2341,16 +2331,14 @@ nsresult MediaPipelineReceiveVideo::Init
 
   // Always happens before we can DetachMedia()
   static_cast<VideoSessionConduit *>(conduit_.get())->
       AttachRenderer(renderer_);
 
   return MediaPipelineReceive::Init();
 }
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 void MediaPipelineReceiveVideo::SetPrincipalHandle_m(const PrincipalHandle& principal_handle)
 {
   listener_->SetPrincipalHandle_m(principal_handle);
 }
-#endif // USE_FAKE_MEDIA_STREAMS
 
 }  // end namespace
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
@@ -5,19 +5,16 @@
 
 // Original author: ekr@rtfm.com
 
 #ifndef mediapipeline_h__
 #define mediapipeline_h__
 
 #include "sigslot.h"
 
-#ifdef USE_FAKE_MEDIA_STREAMS
-#include "FakeMediaStreams.h"
-#endif
 #include "MediaConduitInterface.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "mozilla/Atomics.h"
 #include "SrtpFlow.h"
 #include "databuffer.h"
 #include "runnable_utils.h"
 #include "transportflow.h"
 #include "AudioPacketizer.h"
@@ -34,23 +31,21 @@ class nsIPrincipal;
 namespace mozilla {
 class MediaPipelineFilter;
 class PeerIdentity;
 class AudioProxyThread;
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
 class VideoFrameConverter;
 #endif
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 namespace dom {
   class MediaStreamTrack;
 } // namespace dom
 
 class SourceMediaStream;
-#endif // USE_FAKE_MEDIA_STREAMS
 
 // A class that represents the pipeline of audio and video
 // The dataflow looks like:
 //
 // TRANSMIT
 // CaptureDevice -> stream -> [us] -> conduit -> [us] -> transport -> network
 //
 // RECEIVE
@@ -376,21 +371,19 @@ class MediaPipelineReceive : public Medi
                        int level,
                        RefPtr<MediaSessionConduit> conduit,
                        RefPtr<TransportFlow> rtp_transport,
                        RefPtr<TransportFlow> rtcp_transport,
                        nsAutoPtr<MediaPipelineFilter> filter);
 
   int segments_added() const { return segments_added_; }
 
-#ifndef USE_FAKE_MEDIA_STREAMS
   // Sets the PrincipalHandle we set on the media chunks produced by this
   // pipeline. Must be called on the main thread.
   virtual void SetPrincipalHandle_m(const PrincipalHandle& principal_handle) = 0;
-#endif // USE_FAKE_MEDIA_STREAMS
  protected:
   ~MediaPipelineReceive();
 
   RefPtr<SourceMediaStream> stream_;
   int segments_added_;
 
  private:
 };
@@ -417,19 +410,17 @@ class MediaPipelineReceiveAudio : public
                             RefPtr<TransportFlow> rtcp_transport,
                             nsAutoPtr<MediaPipelineFilter> filter);
 
   void DetachMedia() override;
 
   nsresult Init() override;
   bool IsVideo() const override { return false; }
 
-#ifndef USE_FAKE_MEDIA_STREAMS
   void SetPrincipalHandle_m(const PrincipalHandle& principal_handle) override;
-#endif // USE_FAKE_MEDIA_STREAMS
 
  private:
   // Separate class to allow ref counting
   class PipelineListener;
 
   RefPtr<PipelineListener> listener_;
 };
 
@@ -456,19 +447,17 @@ class MediaPipelineReceiveVideo : public
                             nsAutoPtr<MediaPipelineFilter> filter);
 
   // Called on the main thread.
   void DetachMedia() override;
 
   nsresult Init() override;
   bool IsVideo() const override { return true; }
 
-#ifndef USE_FAKE_MEDIA_STREAMS
   void SetPrincipalHandle_m(const PrincipalHandle& principal_handle) override;
-#endif // USE_FAKE_MEDIA_STREAMS
 
  private:
   class PipelineRenderer;
   friend class PipelineRenderer;
 
   // Separate class to allow ref counting
   class PipelineListener;
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -99,31 +99,27 @@
 #include "WebrtcGlobalInformation.h"
 #include "mozilla/dom/Event.h"
 #include "nsIDOMCustomEvent.h"
 #include "mozilla/EventDispatcher.h"
 #endif
 
 #include "mozilla/net/DataChannelProtocol.h"
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 #include "MediaStreamGraphImpl.h"
-#endif
 
 #ifdef XP_WIN
 // We need to undef the MS macro again in case the windows include file
 // got imported after we included nsIDocument.h
 #ifdef CreateEvent
 #undef CreateEvent
 #endif
 #endif // XP_WIN
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 #include "MediaSegment.h"
-#endif
 
 #ifdef USE_FAKE_PCOBSERVER
 #include "FakePCObserver.h"
 #else
 #include "mozilla/dom/PeerConnectionObserverBinding.h"
 #endif
 #include "mozilla/dom/PeerConnectionObserverEnumsBinding.h"
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -45,52 +45,39 @@
 #endif
 
 namespace test {
 #ifdef USE_FAKE_PCOBSERVER
 class AFakePCObserver;
 #endif
 }
 
-#ifdef USE_FAKE_MEDIA_STREAMS
-class Fake_DOMMediaStream;
-class Fake_MediaStreamTrack;
-#endif
-
 class nsGlobalWindow;
 class nsDOMDataChannel;
 
 namespace mozilla {
 class DataChannel;
 class DtlsIdentity;
 class NrIceCtx;
 class NrIceMediaStream;
 class NrIceStunServer;
 class NrIceTurnServer;
 class MediaPipeline;
 
-#ifdef USE_FAKE_MEDIA_STREAMS
-typedef Fake_DOMMediaStream DOMMediaStream;
-#else
 class DOMMediaStream;
-#endif
 
 namespace dom {
 class RTCCertificate;
 struct RTCConfiguration;
 class RTCDTMFSender;
 struct RTCIceServer;
 struct RTCOfferOptions;
 struct RTCRtpParameters;
 class RTCRtpSender;
-#ifdef USE_FAKE_MEDIA_STREAMS
-typedef Fake_MediaStreamTrack MediaStreamTrack;
-#else
 class MediaStreamTrack;
-#endif
 
 #ifdef USE_FAKE_PCOBSERVER
 typedef test::AFakePCObserver PeerConnectionObserver;
 typedef const char *PCObserverString;
 #else
 class PeerConnectionObserver;
 typedef NS_ConvertUTF8toUTF16 PCObserverString;
 #endif
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -18,29 +18,22 @@
 #include "AudioConduit.h"
 #include "VideoConduit.h"
 #include "runnable_utils.h"
 #include "transportlayerice.h"
 #include "transportlayerdtls.h"
 #include "signaling/src/jsep/JsepSession.h"
 #include "signaling/src/jsep/JsepTransport.h"
 
-#ifdef USE_FAKE_STREAMS
-#include "DOMMediaStream.h"
-#include "FakeMediaStreams.h"
-#else
 #include "MediaSegment.h"
 #ifdef MOZILLA_INTERNAL_API
 #include "MediaStreamGraph.h"
 #endif
-#endif
 
-#ifndef USE_FAKE_MEDIA_STREAMS
 #include "MediaStreamGraphImpl.h"
-#endif
 
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIURI.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsICancelable.h"
 #include "nsILoadInfo.h"
 #include "nsIContentPolicy.h"