Bug 818670: merge AudioConduits to allow AEC to work r=ekr
☠☠ backed out by 37c311484185 ☠ ☠
authorRandell Jesup <rjesup@jesup.org>
Tue, 29 Jan 2013 11:57:44 -0500
changeset 120242 df75a87cce60fe1396b579941e4db1fe0495a610
parent 120241 19e164f7d88d9df419f1632b7b8a82f2d83841c5
child 120243 bf9886e0d35620c31ed2586a4a2fc8c316ddaa5e
push id24243
push userryanvm@gmail.com
push dateWed, 30 Jan 2013 00:49:21 +0000
treeherdermozilla-central@5c248ef0fe62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersekr
bugs818670
milestone21.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 818670: merge AudioConduits to allow AEC to work r=ekr
media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
media/webrtc/signaling/src/media-conduit/AudioConduit.h
media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
media/webrtc/signaling/test/mediaconduit_unittests.cpp
media/webrtc/signaling/test/mediapipeline_unittest.cpp
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
@@ -3,125 +3,157 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AudioConduit.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Services.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
+#include "nsThreadUtils.h"
 
 #include "CSFLog.h"
 #include "voice_engine/include/voe_errors.h"
 
 
 namespace mozilla {
 
 static const char* logTag ="WebrtcAudioSessionConduit";
 
 // 32 bytes is what WebRTC CodecInst expects
 const unsigned int WebrtcAudioConduit::CODEC_PLNAME_SIZE = 32;
 
 /**
  * Factory Method for AudioConduit
  */
-mozilla::RefPtr<AudioSessionConduit> AudioSessionConduit::Create()
+mozilla::RefPtr<AudioSessionConduit> AudioSessionConduit::Create(AudioSessionConduit *aOther)
 {
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
+  NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
+
   WebrtcAudioConduit* obj = new WebrtcAudioConduit();
-  if(obj->Init() != kMediaConduitNoError)
+  if(obj->Init(static_cast<WebrtcAudioConduit*>(aOther)) != kMediaConduitNoError)
   {
     CSFLogError(logTag,  "%s AudioConduit Init Failed ", __FUNCTION__);
     delete obj;
     return NULL;
   }
   CSFLogDebug(logTag,  "%s Successfully created AudioConduit ", __FUNCTION__);
   return obj;
 }
 
 /**
  * Destruction defines for our super-classes
  */
 WebrtcAudioConduit::~WebrtcAudioConduit()
 {
+  NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
+
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
   for(std::vector<AudioCodecConfig*>::size_type i=0;i < mRecvCodecList.size();i++)
   {
     delete mRecvCodecList[i];
   }
 
   delete mCurSendCodecConfig;
 
+  // The first one of a pair to be deleted shuts down media for both
   if(mPtrVoEXmedia)
   {
-    mPtrVoEXmedia->SetExternalRecordingStatus(false);
-    mPtrVoEXmedia->SetExternalPlayoutStatus(false);
+    if (!mShutDown) {
+      mPtrVoEXmedia->SetExternalRecordingStatus(false);
+      mPtrVoEXmedia->SetExternalPlayoutStatus(false);
+    }
     mPtrVoEXmedia->Release();
   }
 
   if(mPtrVoEProcessing)
   {
     mPtrVoEProcessing->Release();
   }
 
   //Deal with the transport
   if(mPtrVoENetwork)
   {
-    mPtrVoENetwork->DeRegisterExternalTransport(mChannel);
+    if (!mShutDown) {
+      mPtrVoENetwork->DeRegisterExternalTransport(mChannel);
+    }
     mPtrVoENetwork->Release();
   }
 
   if(mPtrVoECodec)
   {
     mPtrVoECodec->Release();
   }
 
   if(mPtrVoEBase)
   {
-    mPtrVoEBase->StopPlayout(mChannel);
-    mPtrVoEBase->StopSend(mChannel);
-    mPtrVoEBase->StopReceive(mChannel);
-    mPtrVoEBase->DeleteChannel(mChannel);
-    mPtrVoEBase->Terminate();
+    if (!mShutDown) {
+      mPtrVoEBase->StopPlayout(mChannel);
+      mPtrVoEBase->StopSend(mChannel);
+      mPtrVoEBase->StopReceive(mChannel);
+      mPtrVoEBase->DeleteChannel(mChannel);
+      mPtrVoEBase->Terminate();
+    }
     mPtrVoEBase->Release();
   }
 
-  if(mVoiceEngine)
+  if (mOtherDirection)
   {
-    webrtc::VoiceEngine::Delete(mVoiceEngine);
+    // mOtherDirection owns these now!
+    mOtherDirection->mOtherDirection = NULL;
+    // let other side we terminated the channel
+    mOtherDirection->mShutDown = true;
+    mVoiceEngine = nullptr;
+  } else {
+    // only one opener can call Delete.  Have it be the last to close.
+    if(mVoiceEngine)
+    {
+      webrtc::VoiceEngine::Delete(mVoiceEngine);
+    }
   }
 }
 
 /*
  * WebRTCAudioConduit Implementation
  */
-MediaConduitErrorCode WebrtcAudioConduit::Init()
+MediaConduitErrorCode WebrtcAudioConduit::Init(WebrtcAudioConduit *other)
 {
-  CSFLogDebug(logTag,  "%s ", __FUNCTION__);
+  CSFLogDebug(logTag,  "%s this=%p other=%p", __FUNCTION__, this, other);
 
-  //Per WebRTC APIs below function calls return NULL on failure
-  if(!(mVoiceEngine = webrtc::VoiceEngine::Create()))
-  {
-    CSFLogError(logTag, "%s Unable to create voice engine", __FUNCTION__);
-    return kMediaConduitSessionNotInited;
-  }
+  if (other) {
+    MOZ_ASSERT(!other->mOtherDirection);
+    other->mOtherDirection = this;
+    mOtherDirection = other;
 
-  PRLogModuleInfo *logs = GetWebRTCLogInfo();
-  if (!gWebrtcTraceLoggingOn && logs && logs->level > 0) {
-    // no need to a critical section or lock here
-    gWebrtcTraceLoggingOn = 1;
+    // only one can call ::Create()/GetVoiceEngine()
+    MOZ_ASSERT(other->mVoiceEngine);
+    mVoiceEngine = other->mVoiceEngine;
+  } else {
+    //Per WebRTC APIs below function calls return NULL on failure
+    if(!(mVoiceEngine = webrtc::VoiceEngine::Create()))
+    {
+      CSFLogError(logTag, "%s Unable to create voice engine", __FUNCTION__);
+      return kMediaConduitSessionNotInited;
+    }
 
-    const char *file = PR_GetEnv("WEBRTC_TRACE_FILE");
-    if (!file) {
-      file = "WebRTC.log";
+    PRLogModuleInfo *logs = GetWebRTCLogInfo();
+    if (!gWebrtcTraceLoggingOn && logs && logs->level > 0) {
+      // no need to a critical section or lock here
+      gWebrtcTraceLoggingOn = 1;
+
+      const char *file = PR_GetEnv("WEBRTC_TRACE_FILE");
+      if (!file) {
+        file = "WebRTC.log";
+      }
+      CSFLogDebug(logTag,  "%s Logging webrtc to %s level %d", __FUNCTION__,
+                  file, logs->level);
+      mVoiceEngine->SetTraceFilter(logs->level);
+      mVoiceEngine->SetTraceFile(file);
     }
-    CSFLogDebug(logTag,  "%s Logging webrtc to %s level %d", __FUNCTION__,
-                file, logs->level);
-    mVoiceEngine->SetTraceFilter(logs->level);
-    mVoiceEngine->SetTraceFile(file);
   }
 
   if(!(mPtrVoEBase = VoEBase::GetInterface(mVoiceEngine)))
   {
     CSFLogError(logTag, "%s Unable to initialize VoEBase", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
@@ -144,55 +176,58 @@ MediaConduitErrorCode WebrtcAudioConduit
   }
 
   if(!(mPtrVoEXmedia = VoEExternalMedia::GetInterface(mVoiceEngine)))
   {
     CSFLogError(logTag, "%s Unable to initialize VoEExternalMedia", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
-  // init the engine with our audio device layer
-  if(mPtrVoEBase->Init() == -1)
-  {
-    CSFLogError(logTag, "%s VoiceEngine Base Not Initialized", __FUNCTION__);
-    return kMediaConduitSessionNotInited;
-  }
+  if (other) {
+    mChannel = other->mChannel;
+  } else {
+    // init the engine with our audio device layer
+    if(mPtrVoEBase->Init() == -1)
+    {
+      CSFLogError(logTag, "%s VoiceEngine Base Not Initialized", __FUNCTION__);
+      return kMediaConduitSessionNotInited;
+    }
 
-  if( (mChannel = mPtrVoEBase->CreateChannel()) == -1)
-  {
-    CSFLogError(logTag, "%s VoiceEngine Channel creation failed",__FUNCTION__);
-    return kMediaConduitChannelError;
-  }
+    if( (mChannel = mPtrVoEBase->CreateChannel()) == -1)
+    {
+      CSFLogError(logTag, "%s VoiceEngine Channel creation failed",__FUNCTION__);
+      return kMediaConduitChannelError;
+    }
 
-  CSFLogDebug(logTag, "%s Channel Created %d ",__FUNCTION__, mChannel);
+    CSFLogDebug(logTag, "%s Channel Created %d ",__FUNCTION__, mChannel);
 
-  if(mPtrVoENetwork->RegisterExternalTransport(mChannel, *this) == -1)
-  {
-    CSFLogError(logTag, "%s VoiceEngine, External Transport Failed",__FUNCTION__);
-    return kMediaConduitTransportRegistrationFail;
-  }
+    if(mPtrVoENetwork->RegisterExternalTransport(mChannel, *this) == -1)
+    {
+      CSFLogError(logTag, "%s VoiceEngine, External Transport Failed",__FUNCTION__);
+      return kMediaConduitTransportRegistrationFail;
+    }
 
-  if(mPtrVoEXmedia->SetExternalRecordingStatus(true) == -1)
-  {
-    CSFLogError(logTag, "%s SetExternalRecordingStatus Failed %d",__FUNCTION__,
-                                                      mPtrVoEBase->LastError());
-    return kMediaConduitExternalPlayoutError;
-  }
+    if(mPtrVoEXmedia->SetExternalRecordingStatus(true) == -1)
+    {
+      CSFLogError(logTag, "%s SetExternalRecordingStatus Failed %d",__FUNCTION__,
+                  mPtrVoEBase->LastError());
+      return kMediaConduitExternalPlayoutError;
+    }
 
-  if(mPtrVoEXmedia->SetExternalPlayoutStatus(true) == -1)
-  {
-    CSFLogError(logTag, "%s SetExternalPlayoutStatus Failed %d ",__FUNCTION__,
-                                                     mPtrVoEBase->LastError());
-    return kMediaConduitExternalRecordingError;
+    if(mPtrVoEXmedia->SetExternalPlayoutStatus(true) == -1)
+    {
+      CSFLogError(logTag, "%s SetExternalPlayoutStatus Failed %d ",__FUNCTION__,
+                  mPtrVoEBase->LastError());
+      return kMediaConduitExternalRecordingError;
+    }
+    CSFLogDebug(logTag ,  "%s AudioSessionConduit Initialization Done (%p)",__FUNCTION__, this);
   }
-  CSFLogDebug(logTag ,  "%s AudioSessionConduit Initialization Done",__FUNCTION__);
   return kMediaConduitNoError;
 }
 
-
 // AudioSessionConduit Implementation
 MediaConduitErrorCode
 WebrtcAudioConduit::AttachTransport(mozilla::RefPtr<TransportInterface> aTransport)
 {
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
 
   if(!aTransport)
   {
@@ -583,44 +618,63 @@ WebrtcAudioConduit::ReceivedRTCPPacket(c
   //good here
   return kMediaConduitNoError;
 }
 
 //WebRTC::RTP Callback Implementation
 
 int WebrtcAudioConduit::SendPacket(int channel, const void* data, int len)
 {
-  CSFLogDebug(logTag,  "%s : channel %d",__FUNCTION__,channel);
+  CSFLogDebug(logTag,  "%s : channel %d %s",__FUNCTION__,channel,
+              (mEngineReceiving && mOtherDirection) ? "(using mOtherDirection)" : "");
 
-   if(mTransport && (mTransport->SendRtpPacket(data, len) == NS_OK))
-   {
+  if (mEngineReceiving)
+  {
+    if (mOtherDirection)
+    {
+      return mOtherDirection->SendPacket(channel, data, len);
+    }
+    CSFLogDebug(logTag,  "%s : Asked to send RTP without an RTP sender",
+                __FUNCTION__, channel);
+    return -1;
+  } else {
+    if(mTransport && (mTransport->SendRtpPacket(data, len) == NS_OK))
+    {
       CSFLogDebug(logTag, "%s Sent RTP Packet ", __FUNCTION__);
       return len;
-   } else {
-     CSFLogError(logTag, "%s RTP Packet Send Failed ", __FUNCTION__);
-     return -1;
-   }
-
+    } else {
+      CSFLogError(logTag, "%s RTP Packet Send Failed ", __FUNCTION__);
+      return -1;
+    }
+  }
 }
 
 int WebrtcAudioConduit::SendRTCPPacket(int channel, const void* data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d", __FUNCTION__, channel);
 
-  // can't enable this assertion, because we do.  Suppress it
-  // NS_ASSERTION(mEngineReceiving,"We shouldn't send RTCP on the receiver side");
-  if(mEngineReceiving && mTransport && mTransport->SendRtcpPacket(data, len) == NS_OK)
+  if (mEngineTransmitting)
   {
-    CSFLogDebug(logTag, "%s Sent RTCP Packet ", __FUNCTION__);
-    return len;
+    if (mOtherDirection)
+    {
+      return mOtherDirection->SendRTCPPacket(channel, data, len);
+    }
+    CSFLogDebug(logTag,  "%s : Asked to send RTCP without an RTP receiver",
+                __FUNCTION__, channel);
+    return -1;
   } else {
-    CSFLogError(logTag, "%s RTCP Packet Send Failed ", __FUNCTION__);
-    return -1;
+    if(mTransport && mTransport->SendRtcpPacket(data, len) == NS_OK)
+    {
+      CSFLogDebug(logTag, "%s Sent RTCP Packet ", __FUNCTION__);
+      return len;
+    } else {
+      CSFLogError(logTag, "%s RTCP Packet Send Failed ", __FUNCTION__);
+      return -1;
+    }
   }
-
 }
 
 /**
  * Converts between CodecConfig to WebRTC Codec Structure.
  */
 
 bool
 WebrtcAudioConduit::CodecConfigToWebRTCCodec(const AudioCodecConfig* codecInfo,
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.h
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.h
@@ -138,31 +138,33 @@ public:
    * Webrtc transport implementation to send and receive RTCP packet.
    * AudioConduit registers itself as ExternalTransport to the VoiceEngine
    */
   virtual int SendRTCPPacket(int channel, const void *data, int len) ;
 
 
 
   WebrtcAudioConduit():
+                      mOtherDirection(NULL),
+                      mShutDown(false),
                       mVoiceEngine(NULL),
                       mTransport(NULL),
                       mEngineTransmitting(false),
                       mEngineReceiving(false),
                       mChannel(-1),
                       mCurSendCodecConfig(NULL),
                       mCaptureDelay(150),
                       mEchoOn(true),
                       mEchoCancel(webrtc::kEcAec)
   {
   }
 
   virtual ~WebrtcAudioConduit();
 
-  MediaConduitErrorCode Init();
+  MediaConduitErrorCode Init(WebrtcAudioConduit *other);
 
 private:
   WebrtcAudioConduit(const WebrtcAudioConduit& other) MOZ_DELETE;
   void operator=(const WebrtcAudioConduit& other) MOZ_DELETE;
 
   //Local database of currently applied receive codecs
   typedef std::vector<AudioCodecConfig* > RecvCodecList;
 
@@ -185,16 +187,22 @@ private:
   bool CheckCodecsForMatch(const AudioCodecConfig* curCodecConfig,
                            const AudioCodecConfig* codecInfo) const;
   //Checks the codec to be applied
   MediaConduitErrorCode ValidateCodecConfig(const AudioCodecConfig* codecInfo, bool send) const;
 
   //Utility function to dump recv codec database
   void DumpCodecDB() const;
 
+  WebrtcAudioConduit*  mOtherDirection;
+  // Other side has shut down our channel and related items already
+  bool mShutDown;
+
+  // These are shared by both directions.  They're released by the last
+  // conduit to die
   webrtc::VoiceEngine* mVoiceEngine;
   mozilla::RefPtr<TransportInterface> mTransport;
   webrtc::VoENetwork*  mPtrVoENetwork;
   webrtc::VoEBase*     mPtrVoEBase;
   webrtc::VoECodec*    mPtrVoECodec;
   webrtc::VoEExternalMedia* mPtrVoEXmedia;
   webrtc::VoEAudioProcessing* mPtrVoEProcessing;
 
--- a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
+++ b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
@@ -221,17 +221,17 @@ class AudioSessionConduit : public Media
 {
 public:
 
    /**
     * Factory function to create and initialize a Video Conduit Session
     * return: Concrete VideoSessionConduitObject or NULL in the case
     *         of failure
     */
-  static mozilla::RefPtr<AudioSessionConduit> Create();
+  static mozilla::RefPtr<AudioSessionConduit> Create(AudioSessionConduit *aOther);
 
   virtual ~AudioSessionConduit() {}
 
   virtual Type type() const { return AUDIO; }
 
 
   /**
    * Function to deliver externally captured audio sample for encoding and transport
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -1298,22 +1298,28 @@ static int vcmRxStartICE_m(cc_mcapid_t m
                              fingerprint_alg, fingerprint);
   if (!rtcp_flow) {
       CSFLogError( logTag, "Could not create RTCP flow");
       return VCM_ERROR;
   }
 
   if (CC_IS_AUDIO(mcap_id)) {
     std::vector<mozilla::AudioCodecConfig *> configs;
+
     // Instantiate an appropriate conduit
+    mozilla::RefPtr<mozilla::AudioSessionConduit> tx_conduit =
+      pc.impl()->media()->GetConduit(level, false);
+
     mozilla::RefPtr<mozilla::AudioSessionConduit> conduit =
-                    mozilla::AudioSessionConduit::Create();
+                    mozilla::AudioSessionConduit::Create(tx_conduit);
     if(!conduit)
       return VCM_ERROR;
 
+    pc.impl()->media()->AddConduit(level, true, conduit);
+
     mozilla::AudioCodecConfig *config_raw;
 
     for(int i=0; i <num_payloads ; i++)
     {
       config_raw = new mozilla::AudioCodecConfig(
         payloads[i].remote_rtp_pt,
         ccsdpCodecName(payloads[i].codec_type),
         payloads[i].audio.frequency,
@@ -1948,22 +1954,27 @@ static int vcmTxStartICE_m(cc_mcapid_t m
       payload->audio.packet_size,
       payload->audio.channels,
       payload->audio.bitrate);
 
     // Take possession of this pointer
     mozilla::ScopedDeletePtr<mozilla::AudioCodecConfig> config(config_raw);
 
     // Instantiate an appropriate conduit
+    mozilla::RefPtr<mozilla::AudioSessionConduit> rx_conduit =
+      pc.impl()->media()->GetConduit(level, true);
+
     mozilla::RefPtr<mozilla::AudioSessionConduit> conduit =
-      mozilla::AudioSessionConduit::Create();
+      mozilla::AudioSessionConduit::Create(rx_conduit);
 
     if (!conduit || conduit->ConfigureSendMediaCodec(config))
       return VCM_ERROR;
 
+    pc.impl()->media()->AddConduit(level, false, conduit);
+
     mozilla::RefPtr<mozilla::MediaPipeline> pipeline =
         new mozilla::MediaPipelineTransmit(
             pc.impl()->GetHandle(),
             pc.impl()->GetMainThread().get(),
             pc.impl()->GetSTSThread(),
             stream->GetMediaStream()->GetStream(),
             pc_track_id,
             conduit, rtp_flow, rtcp_flow);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
@@ -288,19 +288,38 @@ class PeerConnectionMedia : public sigsl
     return mTransportFlows[index_inner];
   }
 
   // Add a transport flow
   void AddTransportFlow(int aIndex, bool aRtcp,
                         mozilla::RefPtr<mozilla::TransportFlow> aFlow) {
     int index_inner = aIndex * 2 + (aRtcp ? 1 : 0);
 
+    MOZ_ASSERT(!mTransportFlows[index_inner]);
     mTransportFlows[index_inner] = aFlow;
   }
 
+  mozilla::RefPtr<mozilla::AudioSessionConduit> GetConduit(int aStreamIndex, bool aReceive) {
+    int index_inner = aStreamIndex * 2 + (aReceive ? 0 : 1);
+
+    if (mAudioConduits.find(index_inner) == mAudioConduits.end())
+      return NULL;
+
+    return mAudioConduits[index_inner];
+  }
+
+  // Add a conduit
+  void AddConduit(int aIndex, bool aReceive,
+                  const mozilla::RefPtr<mozilla::AudioSessionConduit> &aConduit) {
+    int index_inner = aIndex * 2 + (aReceive ? 0 : 1);
+
+    MOZ_ASSERT(!mAudioConduits[index_inner]);
+    mAudioConduits[index_inner] = aConduit;
+  }
+
   // ICE state signals
   sigslot::signal1<mozilla::NrIceCtx *> SignalIceGatheringCompleted;  // Done gathering
   sigslot::signal1<mozilla::NrIceCtx *> SignalIceCompleted;  // Done handshaking
 
  private:
   // Disconnect the media streams. Must be called on the
   // main thread.
   void DisconnectMediaStreams();
@@ -326,13 +345,17 @@ class PeerConnectionMedia : public sigsl
 
   // ICE objects
   mozilla::RefPtr<mozilla::NrIceCtx> mIceCtx;
   std::vector<mozilla::RefPtr<mozilla::NrIceMediaStream> > mIceStreams;
 
   // Transport flows: even is RTP, odd is RTCP
   std::map<int, mozilla::RefPtr<mozilla::TransportFlow> > mTransportFlows;
 
+  // Conduits: even is receive, odd is transmit (for easier correlation with
+  // flows)
+  std::map<int, mozilla::RefPtr<mozilla::AudioSessionConduit> > mAudioConduits;
+
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PeerConnectionMedia)
 };
 
 }  // namespace sipcc
 #endif
--- a/media/webrtc/signaling/test/mediaconduit_unittests.cpp
+++ b/media/webrtc/signaling/test/mediaconduit_unittests.cpp
@@ -485,21 +485,21 @@ class TransportConduitTest : public ::te
   {
   }
 
   //1. Dump audio samples to dummy external transport
   void TestDummyAudioAndTransport()
   {
     //get pointer to AudioSessionConduit
     int err=0;
-    mAudioSession = mozilla::AudioSessionConduit::Create();
+    mAudioSession = mozilla::AudioSessionConduit::Create(NULL);
     if( !mAudioSession )
       ASSERT_NE(mAudioSession, (void*)NULL);
 
-    mAudioSession2 = mozilla::AudioSessionConduit::Create();
+    mAudioSession2 = mozilla::AudioSessionConduit::Create(NULL);
     if( !mAudioSession2 )
       ASSERT_NE(mAudioSession2, (void*)NULL);
 
     FakeMediaTransport* xport = new FakeMediaTransport();
     ASSERT_NE(xport, (void*)NULL);
     xport->SetAudioSession(mAudioSession, mAudioSession2);
     mAudioTransport = xport;
 
--- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
@@ -43,17 +43,17 @@ MtransportTestUtils *test_utils;
 namespace {
 class TestAgent {
  public:
   TestAgent() :
       audio_flow_(new TransportFlow()),
       audio_prsock_(new TransportLayerPrsock()),
       audio_dtls_(new TransportLayerDtls()),
       audio_config_(109, "opus", 48000, 480, 1, 64000),
-      audio_conduit_(mozilla::AudioSessionConduit::Create()),
+      audio_conduit_(mozilla::AudioSessionConduit::Create(NULL)),
       audio_(),
       audio_pipeline_(),
       video_flow_(new TransportFlow()),
       video_prsock_(new TransportLayerPrsock()),
       video_config_(120, "VP8", 640, 480),
       video_conduit_(mozilla::VideoSessionConduit::Create()),
       video_(),
       video_pipeline_() {