Bug 1189506. Don't bother blocking captured media-element MediaStreams while we're not decoding. r=jwwang
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 04 Sep 2015 00:46:33 +1200
changeset 297195 c8d75cd4d9eaac0af060d9b28e8f68825dfbe236
parent 297194 3a81598dc929419c5595f1110a7d0b0f46fd7dad
child 297196 2624ea64e7ab556386c4ad081f49e85a42961c84
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1189506
milestone43.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 1189506. Don't bother blocking captured media-element MediaStreams while we're not decoding. r=jwwang They should just run in realtime since we're getting rid of blocking.
dom/html/HTMLMediaElement.cpp
dom/media/mediasink/DecodedStream.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1870,20 +1870,16 @@ HTMLMediaElement::CaptureStreamInternal(
   OutputMediaStream* out = mOutputStreams.AppendElement();
   out->mStream = DOMMediaStream::CreateTrackUnionStream(window, aGraph);
   nsRefPtr<nsIPrincipal> principal = GetCurrentPrincipal();
   out->mStream->CombineWithPrincipal(principal);
   out->mStream->SetCORSMode(mCORSMode);
   out->mFinishWhenEnded = aFinishWhenEnded;
 
   mAudioCaptured = true;
-  // Block the output stream initially.
-  // Decoders are responsible for removing the block while they are playing
-  // back into the output stream.
-  out->mStream->GetStream()->ChangeExplicitBlockerCount(1);
   if (mDecoder) {
     mDecoder->AddOutputStream(out->mStream->GetStream()->AsProcessedStream(),
                               aFinishWhenEnded);
     if (mReadyState >= HAVE_METADATA) {
       // Expose the tracks to JS directly.
       if (HasAudio()) {
         TrackID audioTrackId = mMediaInfo.mAudio.mTrackId;
         out->mStream->CreateDOMTrack(audioTrackId, MediaSegment::AUDIO);
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -212,19 +212,16 @@ OutputStreamData::Init(OutputStreamManag
 void
 OutputStreamData::Connect(MediaStream* aStream)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mPort, "Already connected?");
   MOZ_ASSERT(!mStream->IsDestroyed(), "Can't connect a destroyed stream.");
 
   mPort = mStream->AllocateInputPort(aStream, 0);
-  // Unblock the output stream now. The input stream is responsible for
-  // controlling blocking from now on.
-  mStream->ChangeExplicitBlockerCount(-1);
 }
 
 bool
 OutputStreamData::Disconnect()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // During cycle collection, DOMMediaStream can be destroyed and send
@@ -234,19 +231,16 @@ OutputStreamData::Disconnect()
     return false;
   }
 
   // Disconnect the existing port if necessary.
   if (mPort) {
     mPort->Destroy();
     mPort = nullptr;
   }
-  // Block the stream again. It will be unlocked when connecting
-  // to the input stream.
-  mStream->ChangeExplicitBlockerCount(1);
   return true;
 }
 
 MediaStreamGraph*
 OutputStreamData::Graph() const
 {
   return mStream->Graph();
 }