Bug 1136986 - Disable SharedDecoderManager for EME video. r=kentuckyfriedtakahe a=lmandel
authorChris Pearce <cpearce@mozilla.com>
Sat, 28 Feb 2015 10:23:29 +1300
changeset 250227 9745aeeb920c
parent 250226 1ef0bf557169
child 250228 1fd982ec5296
push id4521
push usercpearce@mozilla.com
push date2015-03-04 01:22 +0000
treeherdermozilla-beta@8abdbdecd2d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe, lmandel
bugs1136986
milestone37.0
Bug 1136986 - Disable SharedDecoderManager for EME video. r=kentuckyfriedtakahe a=lmandel
dom/media/fmp4/MP4Reader.cpp
dom/media/gmp/GMPVideoDecoderParent.cpp
--- a/dom/media/fmp4/MP4Reader.cpp
+++ b/dom/media/fmp4/MP4Reader.cpp
@@ -438,17 +438,19 @@ MP4Reader::ReadMetadata(MediaInfo* aInfo
   if (HasVideo()) {
     const VideoDecoderConfig& video = mDemuxer->VideoConfig();
     if (mInfo.mVideo.mHasVideo && !IsSupportedVideoMimeType(video.mime_type)) {
       return NS_ERROR_FAILURE;
     }
     mInfo.mVideo.mDisplay =
       nsIntSize(video.display_width, video.display_height);
     mVideo.mCallback = new DecoderCallback(this, kVideo);
-    if (mSharedDecoderManager) {
+    if (!mIsEncrypted && mSharedDecoderManager) {
+      // Note: Don't use SharedDecoderManager in EME content, as it doesn't
+      // handle reiniting the decoder properly yet.
       mVideo.mDecoder =
         mSharedDecoderManager->CreateVideoDecoder(mPlatform,
                                                   video,
                                                   mLayersBackendType,
                                                   mDecoder->GetImageContainer(),
                                                   mVideo.mTaskQueue,
                                                   mVideo.mCallback);
     } else {
@@ -1032,17 +1034,19 @@ void MP4Reader::NotifyResourcesStatusCha
     mDecoder->NotifyWaitingForResourcesStatusChanged();
   }
 #endif
 }
 
 void
 MP4Reader::SetIdle()
 {
-  if (mSharedDecoderManager && mVideo.mDecoder) {
+  if (!mIsEncrypted && mSharedDecoderManager && mVideo.mDecoder) {
+    // Note: Don't use SharedDecoderManager in EME content, as it doesn't
+    // handle reiniting the decoder properly yet.
     mSharedDecoderManager->SetIdle(mVideo.mDecoder);
     NotifyResourcesStatusChanged();
   }
 }
 
 void
 MP4Reader::SetSharedDecoderManager(SharedDecoderManager* aManager)
 {
--- a/dom/media/gmp/GMPVideoDecoderParent.cpp
+++ b/dom/media/gmp/GMPVideoDecoderParent.cpp
@@ -64,17 +64,17 @@ GMPVideoDecoderParent::Host()
   return mVideoHost;
 }
 
 // Note: may be called via Terminated()
 void
 GMPVideoDecoderParent::Close()
 {
   LOGD(("%s: %p", __FUNCTION__, this));
-  MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
+  MOZ_ASSERT(!mPlugin || mPlugin->GMPThread() == NS_GetCurrentThread());
   // Consumer is done with us; we can shut down.  No more callbacks should
   // be made to mCallback.  Note: do this before Shutdown()!
   mCallback = nullptr;
   // Let Shutdown mark us as dead so it knows if we had been alive
 
   // In case this is the last reference
   nsRefPtr<GMPVideoDecoderParent> kungfudeathgrip(this);
   Release();