Bug 1143987: Use SharedDecoderManager with EME PDM. r=cpearce,a=sledru
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 18 Mar 2015 14:10:59 +1100
changeset 257984 3e63e6edecbbd51329d3b77416225ac946361609
parent 257983 c906b0dbfe3735bd10db05454326858852a1d574
child 257985 4abc71a31d019b37941002584f8ba9b47be7e802
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, sledru
bugs1143987
milestone38.0a2
Bug 1143987: Use SharedDecoderManager with EME PDM. r=cpearce,a=sledru
dom/media/fmp4/MP4Reader.cpp
--- a/dom/media/fmp4/MP4Reader.cpp
+++ b/dom/media/fmp4/MP4Reader.cpp
@@ -470,19 +470,17 @@ 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 (!mIsEncrypted && mSharedDecoderManager && mPlatform->SupportsSharedDecoders(video)) {
-      // Note: Don't use SharedDecoderManager in EME content, as it doesn't
-      // handle reiniting the decoder properly yet.
+    if (mSharedDecoderManager && mPlatform->SupportsSharedDecoders(video)) {
       mVideo.mDecoder =
         mSharedDecoderManager->CreateVideoDecoder(mPlatform,
                                                   video,
                                                   mLayersBackendType,
                                                   mDecoder->GetImageContainer(),
                                                   mVideo.mTaskQueue,
                                                   mVideo.mCallback);
     } else {
@@ -565,17 +563,17 @@ MP4Reader::GetNextKeyframeTime()
 {
   MonitorAutoLock mon(mDemuxerMonitor);
   return mDemuxer->GetNextKeyframeTime();
 }
 
 void
 MP4Reader::DisableHardwareAcceleration()
 {
-  if (HasVideo() && !mIsEncrypted && mSharedDecoderManager) {
+  if (HasVideo() && mSharedDecoderManager) {
     mSharedDecoderManager->DisableHardwareAcceleration();
 
     const VideoDecoderConfig& video = mDemuxer->VideoConfig();
     if (!mSharedDecoderManager->Recreate(video, mLayersBackendType, mDecoder->GetImageContainer())) {
       MonitorAutoLock mon(mVideo.mMonitor);
       mVideo.mError = true;
       if (mVideo.HasPromise()) {
         mVideo.RejectPromise(DECODE_ERROR, __func__);
@@ -1095,19 +1093,17 @@ void MP4Reader::NotifyResourcesStatusCha
   if (mDecoder) {
     mDecoder->NotifyWaitingForResourcesStatusChanged();
   }
 }
 
 void
 MP4Reader::SetIdle()
 {
-  if (!mIsEncrypted && mSharedDecoderManager && mVideo.mDecoder) {
-    // Note: Don't use SharedDecoderManager in EME content, as it doesn't
-    // handle reiniting the decoder properly yet.
+  if (mSharedDecoderManager && mVideo.mDecoder) {
     mSharedDecoderManager->SetIdle(mVideo.mDecoder);
     NotifyResourcesStatusChanged();
   }
 }
 
 void
 MP4Reader::SetSharedDecoderManager(SharedDecoderManager* aManager)
 {