Bug 1039886 - Add warnings to Gecko Media Plugin loading code r=cpearce
authorEdwin Flores <eflores@mozilla.com>
Wed, 24 Sep 2014 10:04:48 +1200
changeset 222385 cbcf41cc455cace9fb3ac76b94095c1c352707e1
parent 222384 ed858dc6599c8cf86a205ad8e520c9a3db5d4113
child 222386 cf05825151e3075369bb76c85c41d5ccdcaa1c7e
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1039886
milestone35.0a1
Bug 1039886 - Add warnings to Gecko Media Plugin loading code r=cpearce
content/media/gmp/GMPChild.cpp
--- a/content/media/gmp/GMPChild.cpp
+++ b/content/media/gmp/GMPChild.cpp
@@ -266,33 +266,37 @@ GMPChild::LoadPluginLibrary(const std::s
   MOZ_ASSERT(mozilla::CanSandboxMediaPlugin());
   mozilla::SetMediaPluginSandbox(nativePath.get());
 #endif // XP_LINUX && MOZ_GMP_SANDBOX
 
   libFile->Load(&mLib);
 #endif // XP_MACOSX && MOZ_GMP_SANDBOX
 
   if (!mLib) {
+    NS_WARNING("Failed to link Gecko Media Plugin library.");
     return false;
   }
 
   GMPInitFunc initFunc = reinterpret_cast<GMPInitFunc>(PR_FindFunctionSymbol(mLib, "GMPInit"));
   if (!initFunc) {
+    NS_WARNING("Failed to link Gecko Media Plugin Init function.");
     return false;
   }
 
   auto platformAPI = new GMPPlatformAPI();
   InitPlatformAPI(*platformAPI, this);
 
   if (initFunc(platformAPI) != GMPNoErr) {
+    NS_WARNING("Gecko Media Plugin failed to initialize.");
     return false;
   }
 
   mGetAPIFunc = reinterpret_cast<GMPGetAPIFunc>(PR_FindFunctionSymbol(mLib, "GMPGetAPI"));
   if (!mGetAPIFunc) {
+    NS_WARNING("Failed to link Gecko Media Plugin GetAPI function.");
     return false;
   }
 
   void* sh = nullptr;
   GMPAsyncShutdownHost* host = static_cast<GMPAsyncShutdownHost*>(this);
   GMPErr err = mGetAPIFunc("async-shutdown", host, &sh);
   if (err == GMPNoErr && sh) {
     mAsyncShutdown = reinterpret_cast<GMPAsyncShutdown*>(sh);
@@ -433,32 +437,34 @@ GMPChild::DeallocPGMPVideoEncoderChild(P
 bool
 GMPChild::RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor)
 {
   auto vdc = static_cast<GMPVideoDecoderChild*>(aActor);
 
   void* vd = nullptr;
   GMPErr err = mGetAPIFunc("decode-video", &vdc->Host(), &vd);
   if (err != GMPNoErr || !vd) {
+    NS_WARNING("GMPGetAPI call failed trying to construct decoder.");
     return false;
   }
 
   vdc->Init(static_cast<GMPVideoDecoder*>(vd));
 
   return true;
 }
 
 bool
 GMPChild::RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor)
 {
   auto vec = static_cast<GMPVideoEncoderChild*>(aActor);
 
   void* ve = nullptr;
   GMPErr err = mGetAPIFunc("encode-video", &vec->Host(), &ve);
   if (err != GMPNoErr || !ve) {
+    NS_WARNING("GMPGetAPI call failed trying to construct encoder.");
     return false;
   }
 
   vec->Init(static_cast<GMPVideoEncoder*>(ve));
 
   return true;
 }