Bug 1313315 - Do construct CreateDecoderParams only on Windows build in VideoDecoderParent::RecvInit r=mattwoodrow
authorJames Cheng <jacheng@mozilla.com>
Thu, 27 Oct 2016 17:43:36 +0800
changeset 319913 bb8f38a1583fcb632acf1941bf8063c7d0e7dd73
parent 319912 466b0de6dfcbb27630de8ddfe66db89951a2dc34
child 319914 2aa6df19f5f214bb3d28db836ba259ca6afb6ff3
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1313315
milestone52.0a1
Bug 1313315 - Do construct CreateDecoderParams only on Windows build in VideoDecoderParent::RecvInit r=mattwoodrow MozReview-Commit-ID: 8BQHZU8e3nV
dom/media/ipc/VideoDecoderParent.cpp
--- a/dom/media/ipc/VideoDecoderParent.cpp
+++ b/dom/media/ipc/VideoDecoderParent.cpp
@@ -71,29 +71,29 @@ VideoDecoderParent::Destroy()
   mIPDLSelfRef = nullptr;
 }
 
 bool
 VideoDecoderParent::RecvInit(const VideoInfo& aInfo, const layers::TextureFactoryIdentifier& aIdentifier)
 {
   mKnowsCompositor->IdentifyTextureHost(aIdentifier);
 
-  CreateDecoderParams params(aInfo);
-  params.mTaskQueue = mDecodeTaskQueue;
-  params.mCallback = this;
-  params.mKnowsCompositor = mKnowsCompositor;
-  params.mImageContainer = new layers::ImageContainer();
-
 #ifdef XP_WIN
   // TODO: Ideally we wouldn't hardcode the WMF PDM, and we'd use the normal PDM
   // factory logic for picking a decoder.
   WMFDecoderModule::Init();
   RefPtr<WMFDecoderModule> pdm(new WMFDecoderModule());
   pdm->Startup();
 
+  CreateDecoderParams params(aInfo);
+  params.mTaskQueue = mDecodeTaskQueue;
+  params.mCallback = this;
+  params.mKnowsCompositor = mKnowsCompositor;
+  params.mImageContainer = new layers::ImageContainer();
+
   mDecoder = pdm->CreateVideoDecoder(params);
   if (!mDecoder) {
     Unused << SendInitFailed(NS_ERROR_DOM_MEDIA_FATAL_ERR);
     return true;
   }
 #else
   MOZ_ASSERT(false, "Can't use RemoteVideoDecoder on non-Windows platforms yet");
 #endif