Bug 1140797 - Make gmp-clearkey buildable outside of mozilla-central. r=edwin, a=lmandel
authorChris Pearce <cpearce@mozilla.com>
Mon, 09 Mar 2015 08:27:05 +1300
changeset 250435 a49b40d229df
parent 250434 5598a289b442
child 250436 29333933d6d6
push id4589
push userryanvm@gmail.com
push date2015-03-19 02:20 +0000
treeherdermozilla-beta@d76c709556bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, lmandel
bugs1140797
milestone37.0
Bug 1140797 - Make gmp-clearkey buildable outside of mozilla-central. r=edwin, a=lmandel
media/gmp-clearkey/0.1/ClearKeySession.cpp
media/gmp-clearkey/0.1/WMFAACDecoder.cpp
media/gmp-clearkey/0.1/WMFH264Decoder.cpp
media/gmp-clearkey/0.1/WMFUtils.cpp
--- a/media/gmp-clearkey/0.1/ClearKeySession.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeySession.cpp
@@ -5,17 +5,16 @@
 #include "ClearKeyDecryptionManager.h"
 #include "ClearKeySession.h"
 #include "ClearKeyUtils.h"
 #include "ClearKeyStorage.h"
 #include "gmp-task-utils.h"
 
 #include "gmp-api/gmp-decryption.h"
 #include "mozilla/Endian.h"
-#include "pk11pub.h"
 
 using namespace mozilla;
 
 ClearKeySession::ClearKeySession(const std::string& aSessionId,
                                  GMPDecryptorCallback* aCallback,
                                  GMPSessionType aSessionType)
   : mSessionId(aSessionId)
   , mCallback(aCallback)
--- a/media/gmp-clearkey/0.1/WMFAACDecoder.cpp
+++ b/media/gmp-clearkey/0.1/WMFAACDecoder.cpp
@@ -12,16 +12,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "WMFAACDecoder.h"
 #include <algorithm>
 #include <stdint.h>
+#include <vector>
 
 using std::vector;
 
 namespace wmf {
 
 WMFAACDecoder::WMFAACDecoder()
   : mDecoder(nullptr)
   , mChannels(0)
--- a/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
+++ b/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
@@ -10,16 +10,17 @@
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "WMFH264Decoder.h"
+#include <algorithm>
 
 namespace wmf {
 
 WMFH264Decoder::WMFH264Decoder()
   : mDecoder(nullptr)
 {
   memset(&mInputStreamInfo, 0, sizeof(MFT_INPUT_STREAM_INFO));
   memset(&mOutputStreamInfo, 0, sizeof(MFT_OUTPUT_STREAM_INFO));
--- a/media/gmp-clearkey/0.1/WMFUtils.cpp
+++ b/media/gmp-clearkey/0.1/WMFUtils.cpp
@@ -50,17 +50,17 @@ namespace wmf {
 
 static bool
 LinkMfplat()
 {
   static bool sInitDone = false;
   static bool sInitOk = false;
   if (!sInitDone) {
     sInitDone = true;
-    auto handle = GetModuleHandle("mfplat.dll");
+    auto handle = GetModuleHandleA("mfplat.dll");
 #define MFPLAT_FUNC(_func) \
     if (!(_func = (decltype(_func))(GetProcAddress(handle, #_func)))) { \
       return false; \
     }
 #include "WMFSymbols.h"
 #undef MFPLAT_FUNC
     sInitOk = true;
   }
@@ -69,19 +69,19 @@ LinkMfplat()
 
 bool
 EnsureLibs()
 {
   static bool sInitDone = false;
   static bool sInitOk = false;
   if (!sInitDone) {
     sInitOk = LinkMfplat() &&
-      !!GetModuleHandle("msauddecmft.dll") &&
-      !!GetModuleHandle("msmpeg2adec.dll") &&
-      !!GetModuleHandle("msmpeg2vdec.dll");
+      !!GetModuleHandleA("msauddecmft.dll") &&
+      !!GetModuleHandleA("msmpeg2adec.dll") &&
+      !!GetModuleHandleA("msmpeg2vdec.dll");
     sInitDone = true;
   }
   return sInitOk;
 }
 
 int32_t
 MFOffsetToInt32(const MFOffset& aOffset)
 {
@@ -178,17 +178,17 @@ void dump(const uint8_t* data, uint32_t 
   fclose(f);
 }
 
 HRESULT
 CreateMFT(const CLSID& clsid,
           const char* aDllName,
           CComPtr<IMFTransform>& aOutMFT)
 {
-  HMODULE module = ::GetModuleHandle(aDllName);
+  HMODULE module = ::GetModuleHandleA(aDllName);
   if (!module) {
     LOG("Failed to get %S\n", aDllName);
     return E_FAIL;
   }
 
   typedef HRESULT (WINAPI* DllGetClassObjectFnPtr)(const CLSID& clsid,
                                                    const IID& iid,
                                                    void** object);