Bug 1278027 - Reuse some codes of MediaEncoder::NotifyQueuedTrackChanges in MediaEncoder::NotifyQueuedAudioData. r=jesup
authorctai <ctai@mozilla.com>
Tue, 07 Jun 2016 12:25:04 +0800
changeset 300853 d13ee16778f1aa6bdc1eaa8ba858e128c07177d3
parent 300852 093e04a3f56b03b639c51761992dd12c75a96267
child 300854 7f5be0d15ff0ff65abb6baa4b41fa8a75601b0ff
push id19599
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 10:16:21 +0000
treeherderfx-team@81f4cc3f6f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1278027
milestone50.0a1
Bug 1278027 - Reuse some codes of MediaEncoder::NotifyQueuedTrackChanges in MediaEncoder::NotifyQueuedAudioData. r=jesup MozReview-Commit-ID: JBRdxD1wA4c
dom/media/TrackUnionStream.cpp
dom/media/encoder/MediaEncoder.cpp
--- a/dom/media/TrackUnionStream.cpp
+++ b/dom/media/TrackUnionStream.cpp
@@ -322,17 +322,20 @@ TrackUnionStream::TrackUnionStream(DOMMe
         }
       }
       ApplyTrackDisabling(outputTrack->GetID(), segment);
       for (uint32_t j = 0; j < mListeners.Length(); ++j) {
         MediaStreamListener* l = mListeners[j];
         // Separate Audio and Video.
         if (segment->GetType() == MediaSegment::AUDIO) {
           l->NotifyQueuedAudioData(Graph(), outputTrack->GetID(),
-                                   outputStart, *static_cast<AudioSegment*>(segment));
+                                   outputStart,
+                                   *static_cast<AudioSegment*>(segment),
+                                   map->mInputPort->GetSource(),
+                                   map->mInputTrackID);
         } else {
           // This part will be removed in bug 1201363.
           l->NotifyQueuedTrackChanges(Graph(), outputTrack->GetID(),
                                       outputStart, 0, *segment,
                                       map->mInputPort->GetSource(),
                                       map->mInputTrackID);
         }
       }
--- a/dom/media/encoder/MediaEncoder.cpp
+++ b/dom/media/encoder/MediaEncoder.cpp
@@ -107,18 +107,25 @@ MediaEncoder::NotifyQueuedTrackChanges(M
 
 void
 MediaEncoder::NotifyQueuedAudioData(MediaStreamGraph* aGraph, TrackID aID,
                                     StreamTime aTrackOffset,
                                     const AudioSegment& aQueuedMedia,
                                     MediaStream* aInputStream,
                                     TrackID aInputTrackID)
 {
-  mAudioEncoder->NotifyQueuedTrackChanges(aGraph, aID, aTrackOffset, 0,
-                                          aQueuedMedia);
+  if (!mDirectConnected) {
+    NotifyRealtimeData(aGraph, aID, aTrackOffset, 0, aQueuedMedia);
+  } else {
+    if (mSuspended == RECORD_RESUMED) {
+      if (!mVideoEncoder) {
+        mSuspended = RECORD_NOT_SUSPENDED; // no video
+      }
+    }
+  }
 }
 
 void
 MediaEncoder::NotifyEvent(MediaStreamGraph* aGraph,
                           MediaStreamListener::MediaStreamGraphEvent event)
 {
   // In case that MediaEncoder does not receive a TRACK_EVENT_ENDED event.
   LOG(LogLevel::Debug, ("NotifyRemoved in [MediaEncoder]."));