Bug 1130150: mSources update r=roc a=abillings
authorRandell Jesup <rjesup@jesup.org>
Tue, 10 Mar 2015 01:20:08 -0400
changeset 237550 21f52f25675adf2aeb0ebc4f3786ec717f4a9a44
parent 237525 89b593b91e5e466e11dd9238f010d2b7c363f024
child 237551 066ad2436c70f480100917834471f14f804f79f7
push id298
push userryanvm@gmail.com
push dateWed, 11 Mar 2015 00:22:02 +0000
treeherdermozilla-b2g37_v2_2@8eaf70287f6c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, abillings
bugs1130150
milestone37.0
Bug 1130150: mSources update r=roc a=abillings
dom/media/webrtc/MediaEngineCameraVideoSource.h
dom/media/webrtc/MediaEngineWebRTC.h
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineCameraVideoSource.h
+++ b/dom/media/webrtc/MediaEngineCameraVideoSource.h
@@ -81,17 +81,17 @@ protected:
   // mMonitor protects mImage access/changes, and transitions of mState
   // from kStarted to kStopped (which are combined with EndTrack() and
   // image changes).
   // mMonitor also protects mSources[] access/changes.
   // mSources[] is accessed from webrtc threads.
 
   // All the mMonitor accesses are from the child classes.
   Monitor mMonitor; // Monitor for processing Camera frames.
-  nsTArray<SourceMediaStream*> mSources; // When this goes empty, we shut down HW
+  nsTArray<nsRefPtr<SourceMediaStream>> mSources; // When this goes empty, we shut down HW
   nsRefPtr<layers::Image> mImage;
   nsRefPtr<layers::ImageContainer> mImageContainer;
   int mWidth, mHeight; // protected with mMonitor on Gonk due to different threading
   // end of data protected by mMonitor
 
 
   bool mInitDone;
   bool mHasDirectListeners;
--- a/dom/media/webrtc/MediaEngineWebRTC.h
+++ b/dom/media/webrtc/MediaEngineWebRTC.h
@@ -220,17 +220,17 @@ private:
   ScopedCustomReleasePtr<webrtc::VoENetwork> mVoENetwork;
   ScopedCustomReleasePtr<webrtc::VoEAudioProcessing> mVoEProcessing;
   ScopedCustomReleasePtr<webrtc::VoECallReport> mVoECallReport;
 
   // mMonitor protects mSources[] access/changes, and transitions of mState
   // from kStarted to kStopped (which are combined with EndTrack()).
   // mSources[] is accessed from webrtc threads.
   Monitor mMonitor;
-  nsTArray<SourceMediaStream*> mSources; // When this goes empty, we shut down HW
+  nsTArray<nsRefPtr<SourceMediaStream>> mSources; // When this goes empty, we shut down HW
   nsCOMPtr<nsIThread> mThread;
   int mCapIndex;
   int mChannel;
   TrackID mTrackID;
   bool mInitDone;
   bool mStarted;
 
   nsString mDeviceName;
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -603,17 +603,17 @@ MediaEngineWebRTCAudioSource::Process(in
     channels.AppendElement(dest);
     segment->AppendFrames(buffer.forget(), channels, length);
     TimeStamp insertTime;
     segment->GetStartTime(insertTime);
 
     if (mSources[i]) {
       // Make sure we include the stream and the track.
       // The 0:1 is a flag to note when we've done the final insert for a given input block.
-      LogTime(AsyncLatencyLogger::AudioTrackInsertion, LATENCY_STREAM_ID(mSources[i], mTrackID),
+      LogTime(AsyncLatencyLogger::AudioTrackInsertion, LATENCY_STREAM_ID(mSources[i].get(), mTrackID),
               (i+1 < len) ? 0 : 1, insertTime);
 
       // This is safe from any thread, and is safe if the track is Finished
       // or Destroyed.
       // Note: due to evil magic, the nsAutoPtr<AudioSegment>'s ownership transfers to
       // the Runnable (AutoPtr<> = AutoPtr<>)
       RUN_ON_THREAD(mThread, WrapRunnable(mSources[i], &SourceMediaStream::AppendToTrack,
                                           mTrackID, segment, (AudioSegment *) nullptr),