Bug 1516669 - Update gmp-clearkey to use CDM10 interface. r=cpearce
authorBryce Van Dyk <bvandyk@mozilla.com>
Mon, 14 Jan 2019 16:40:04 +0000
changeset 453762 b430ac03ce29256a1775ff46fd2864301b19b623
parent 453761 dad40f23f4c19891cbd7e6f805bf1eda699d7b16
child 453763 bd1e99a6325ade1c8839e8e7b7310b76609e3c0a
push id35372
push usercbrindusan@mozilla.com
push dateMon, 14 Jan 2019 21:49:33 +0000
treeherdermozilla-central@50b3268954b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1516669, 1516673
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516669 - Update gmp-clearkey to use CDM10 interface. r=cpearce Not much changed in the interface: - CDM initialization takes a use hardware codecs arg, we pipe this through, but don't do anything more with it in the clearkey CDM. - The CDM should call the hosts OnInitialized() when it's initialized. This is done is now done in the clearkey CDM once the session management is ready, as that is the last thing done during init. Aside from the above, it's just updating interface usage. While the new CDM interface adds support for different encryption schemes, this is not handled here and will be done in follow up bug 1516673. Differential Revision: https://phabricator.services.mozilla.com/D15518
media/gmp-clearkey/0.1/ClearKeyCDM.cpp
media/gmp-clearkey/0.1/ClearKeyCDM.h
media/gmp-clearkey/0.1/ClearKeyDecryptionManager.h
media/gmp-clearkey/0.1/ClearKeyPersistence.cpp
media/gmp-clearkey/0.1/ClearKeyPersistence.h
media/gmp-clearkey/0.1/ClearKeySessionManager.cpp
media/gmp-clearkey/0.1/ClearKeySessionManager.h
media/gmp-clearkey/0.1/ClearKeyStorage.cpp
media/gmp-clearkey/0.1/ClearKeyStorage.h
media/gmp-clearkey/0.1/VideoDecoder.cpp
media/gmp-clearkey/0.1/VideoDecoder.h
media/gmp-clearkey/0.1/gmp-clearkey.cpp
media/gmp-clearkey/0.1/manifest.json.in
--- a/media/gmp-clearkey/0.1/ClearKeyCDM.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyCDM.cpp
@@ -1,22 +1,25 @@
 #include "ClearKeyCDM.h"
 
 #include "ClearKeyUtils.h"
 
 using namespace cdm;
 
-ClearKeyCDM::ClearKeyCDM(Host_9* aHost) {
+ClearKeyCDM::ClearKeyCDM(Host_10* aHost) {
   mHost = aHost;
   mSessionManager = new ClearKeySessionManager(mHost);
 }
 
 void ClearKeyCDM::Initialize(bool aAllowDistinctiveIdentifier,
-                             bool aAllowPersistentState) {
+                             bool aAllowPersistentState,
+                             bool aUseHardwareSecureCodecs) {
   mSessionManager->Init(aAllowDistinctiveIdentifier, aAllowPersistentState);
+  // We call mHost->OnInitialized() in the session manager once it has
+  // initialized.
 }
 
 void ClearKeyCDM::GetStatusForPolicy(uint32_t aPromiseId,
                                      const Policy& aPolicy) {
   // MediaKeys::GetStatusForPolicy checks the keysystem and
   // reject the promise with NS_ERROR_DOM_NOT_SUPPORTED_ERR without calling CDM.
   // This function should never be called and is not supported.
   assert(false);
@@ -61,31 +64,31 @@ void ClearKeyCDM::RemoveSession(uint32_t
 }
 
 void ClearKeyCDM::TimerExpired(void* aContext) {
   // Clearkey is not interested in timers, so this method has not been
   // implemented.
   assert(false);
 }
 
-Status ClearKeyCDM::Decrypt(const InputBuffer_1& aEncryptedBuffer,
+Status ClearKeyCDM::Decrypt(const InputBuffer_2& aEncryptedBuffer,
                             DecryptedBlock* aDecryptedBuffer) {
   return mSessionManager->Decrypt(aEncryptedBuffer, aDecryptedBuffer);
 }
 
 Status ClearKeyCDM::InitializeAudioDecoder(
-    const AudioDecoderConfig_1& aAudioDecoderConfig) {
+    const AudioDecoderConfig_2& aAudioDecoderConfig) {
   // Audio decoding is not supported by Clearkey because Widevine doesn't
   // support it and Clearkey's raison d'etre is to provide test coverage
   // for paths that Widevine will exercise in the wild.
   return Status::kDecodeError;
 }
 
 Status ClearKeyCDM::InitializeVideoDecoder(
-    const VideoDecoderConfig_1& aVideoDecoderConfig) {
+    const VideoDecoderConfig_2& aVideoDecoderConfig) {
 #ifdef ENABLE_WMF
   mVideoDecoder = new VideoDecoder(mHost);
   return mVideoDecoder->InitDecode(aVideoDecoderConfig);
 #else
   return Status::kDecodeError;
 #endif
 }
 
@@ -101,27 +104,27 @@ void ClearKeyCDM::DeinitializeDecoder(St
 void ClearKeyCDM::ResetDecoder(StreamType aDecoderType) {
 #ifdef ENABLE_WMF
   if (aDecoderType == StreamType::kStreamTypeVideo) {
     mVideoDecoder->Reset();
   }
 #endif
 }
 
-Status ClearKeyCDM::DecryptAndDecodeFrame(const InputBuffer_1& aEncryptedBuffer,
+Status ClearKeyCDM::DecryptAndDecodeFrame(const InputBuffer_2& aEncryptedBuffer,
                                           VideoFrame* aVideoFrame) {
 #ifdef ENABLE_WMF
   return mVideoDecoder->Decode(aEncryptedBuffer, aVideoFrame);
 #else
   return Status::kDecodeError;
 #endif
 }
 
 Status ClearKeyCDM::DecryptAndDecodeSamples(
-    const InputBuffer_1& aEncryptedBuffer, AudioFrames* aAudioFrame) {
+    const InputBuffer_2& aEncryptedBuffer, AudioFrames* aAudioFrame) {
   // Audio decoding is not supported by Clearkey because Widevine doesn't
   // support it and Clearkey's raison d'etre is to provide test coverage
   // for paths that Widevine will exercise in the wild.
   return Status::kDecodeError;
 }
 
 void ClearKeyCDM::OnPlatformChallengeResponse(
     const PlatformChallengeResponse& aResponse) {
--- a/media/gmp-clearkey/0.1/ClearKeyCDM.h
+++ b/media/gmp-clearkey/0.1/ClearKeyCDM.h
@@ -8,31 +8,31 @@
 #include "stddef.h"
 #include "content_decryption_module.h"
 
 #ifdef ENABLE_WMF
 #include "WMFUtils.h"
 #include "VideoDecoder.h"
 #endif
 
-class ClearKeyCDM : public cdm::ContentDecryptionModule_9 {
+class ClearKeyCDM : public cdm::ContentDecryptionModule_10 {
  private:
   RefPtr<ClearKeySessionManager> mSessionManager;
 #ifdef ENABLE_WMF
   RefPtr<VideoDecoder> mVideoDecoder;
 #endif
 
  protected:
-  cdm::Host_9* mHost;
+  cdm::Host_10* mHost;
 
  public:
-  explicit ClearKeyCDM(cdm::Host_9* mHost);
+  explicit ClearKeyCDM(cdm::Host_10* aHost);
 
-  void Initialize(bool aAllowDistinctiveIdentifier,
-                  bool aAllowPersistentState) override;
+  void Initialize(bool aAllowDistinctiveIdentifier, bool aAllowPersistentState,
+                  bool aUseHardwareSecureCodecs) override;
 
   void GetStatusForPolicy(uint32_t aPromiseId,
                           const cdm::Policy& aPolicy) override;
 
   void SetServerCertificate(uint32_t aPromiseId,
                             const uint8_t* aServerCertificateData,
                             uint32_t aServerCertificateDataSize) override;
 
@@ -52,34 +52,34 @@ class ClearKeyCDM : public cdm::ContentD
   void CloseSession(uint32_t aPromiseId, const char* aSessionId,
                     uint32_t aSessionIdSize) override;
 
   void RemoveSession(uint32_t aPromiseId, const char* aSessionId,
                      uint32_t aSessionIdSize) override;
 
   void TimerExpired(void* aContext) override;
 
-  cdm::Status Decrypt(const cdm::InputBuffer_1& aEncryptedBuffer,
+  cdm::Status Decrypt(const cdm::InputBuffer_2& aEncryptedBuffer,
                       cdm::DecryptedBlock* aDecryptedBuffer) override;
 
   cdm::Status InitializeAudioDecoder(
-      const cdm::AudioDecoderConfig_1& aAudioDecoderConfig) override;
+      const cdm::AudioDecoderConfig_2& aAudioDecoderConfig) override;
 
   cdm::Status InitializeVideoDecoder(
-      const cdm::VideoDecoderConfig_1& aVideoDecoderConfig) override;
+      const cdm::VideoDecoderConfig_2& aVideoDecoderConfig) override;
 
   void DeinitializeDecoder(cdm::StreamType aDecoderType) override;
 
   void ResetDecoder(cdm::StreamType aDecoderType) override;
 
-  cdm::Status DecryptAndDecodeFrame(const cdm::InputBuffer_1& aEncryptedBuffer,
+  cdm::Status DecryptAndDecodeFrame(const cdm::InputBuffer_2& aEncryptedBuffer,
                                     cdm::VideoFrame* aVideoFrame) override;
 
   cdm::Status DecryptAndDecodeSamples(
-      const cdm::InputBuffer_1& aEncryptedBuffer,
+      const cdm::InputBuffer_2& aEncryptedBuffer,
       cdm::AudioFrames* aAudioFrame) override;
 
   void OnPlatformChallengeResponse(
       const cdm::PlatformChallengeResponse& aResponse) override;
 
   void OnQueryOutputProtectionStatus(cdm::QueryResult aResult,
                                      uint32_t aLinkMask,
                                      uint32_t aOutputProtectionMask) override;
--- a/media/gmp-clearkey/0.1/ClearKeyDecryptionManager.h
+++ b/media/gmp-clearkey/0.1/ClearKeyDecryptionManager.h
@@ -27,21 +27,21 @@
 #include <map>
 
 class ClearKeyDecryptor;
 
 class CryptoMetaData {
  public:
   CryptoMetaData() {}
 
-  explicit CryptoMetaData(const cdm::InputBuffer_1* aInputBuffer) {
+  explicit CryptoMetaData(const cdm::InputBuffer_2* aInputBuffer) {
     Init(aInputBuffer);
   }
 
-  void Init(const cdm::InputBuffer_1* aInputBuffer) {
+  void Init(const cdm::InputBuffer_2* aInputBuffer) {
     if (!aInputBuffer) {
       assert(!IsValid());
       return;
     }
 
     Assign(mKeyId, aInputBuffer->key_id, aInputBuffer->key_id_size);
     Assign(mIV, aInputBuffer->iv, aInputBuffer->iv_size);
 
--- a/media/gmp-clearkey/0.1/ClearKeyPersistence.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyPersistence.cpp
@@ -84,17 +84,19 @@ void ClearKeyPersistence::WriteIndex() {
   string dataString = ss.str();
   uint8_t* dataArray = (uint8_t*)dataString.data();
   vector<uint8_t> data(dataArray, dataArray + dataString.size());
 
   string filename = "index";
   WriteData(mHost, filename, data, move(onIndexSuccess), move(onIndexFail));
 }
 
-ClearKeyPersistence::ClearKeyPersistence(Host_9* aHost) { this->mHost = aHost; }
+ClearKeyPersistence::ClearKeyPersistence(Host_10* aHost) {
+  this->mHost = aHost;
+}
 
 void ClearKeyPersistence::EnsureInitialized(bool aPersistentStateAllowed,
                                             function<void()>&& aOnInitialized) {
   if (aPersistentStateAllowed &&
       mPersistentKeyState == PersistentKeyState::UNINITIALIZED) {
     mPersistentKeyState = LOADING;
     ReadAllRecordsFromIndex(move(aOnInitialized));
   } else {
--- a/media/gmp-clearkey/0.1/ClearKeyPersistence.h
+++ b/media/gmp-clearkey/0.1/ClearKeyPersistence.h
@@ -30,31 +30,31 @@
 
 class ClearKeySessionManager;
 
 // Whether we've loaded the persistent session ids yet.
 enum PersistentKeyState { UNINITIALIZED, LOADING, LOADED };
 
 class ClearKeyPersistence : public RefCounted {
  public:
-  explicit ClearKeyPersistence(cdm::Host_9* aHost);
+  explicit ClearKeyPersistence(cdm::Host_10* aHost);
 
   void EnsureInitialized(bool aPersistentStateAllowed,
                          std::function<void()>&& aOnInitialized);
 
   bool IsLoaded() const;
 
   std::string GetNewSessionId(cdm::SessionType aSessionType);
 
   bool IsPersistentSessionId(const std::string& aSid);
 
   void PersistentSessionRemoved(std::string& aSid);
 
  private:
-  cdm::Host_9* mHost = nullptr;
+  cdm::Host_10* mHost = nullptr;
 
   PersistentKeyState mPersistentKeyState = PersistentKeyState::UNINITIALIZED;
 
   std::set<uint32_t> mPersistentSessionIds;
 
   void ReadAllRecordsFromIndex(std::function<void()>&& aOnComplete);
   void WriteIndex();
 };
--- a/media/gmp-clearkey/0.1/ClearKeySessionManager.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeySessionManager.cpp
@@ -28,17 +28,17 @@
 #include <assert.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
 using namespace std;
 using namespace cdm;
 
-ClearKeySessionManager::ClearKeySessionManager(Host_9* aHost)
+ClearKeySessionManager::ClearKeySessionManager(Host_10* aHost)
     : mDecryptionManager(ClearKeyDecryptionManager::Get()) {
   CK_LOGD("ClearKeySessionManager ctor %p", this);
   AddRef();
 
   mHost = aHost;
   mPersistence = new ClearKeyPersistence(mHost);
 }
 
@@ -53,16 +53,21 @@ void ClearKeySessionManager::Init(bool a
   RefPtr<ClearKeySessionManager> self(this);
   function<void()> onPersistentStateLoaded = [self]() {
     while (!self->mDeferredInitialize.empty()) {
       function<void()> func = self->mDeferredInitialize.front();
       self->mDeferredInitialize.pop();
 
       func();
     }
+    if (self->mHost) {
+      // The session manager should be the last thing the ClearKey CDM is
+      // waiting on to be initialized.
+      self->mHost->OnInitialized(true);
+    }
   };
 
   mPersistence->EnsureInitialized(aPersistentStateAllowed,
                                   move(onPersistentStateLoaded));
 }
 
 void ClearKeySessionManager::CreateSession(uint32_t aPromiseId,
                                            InitDataType aInitDataType,
@@ -524,17 +529,17 @@ void ClearKeySessionManager::SetServerCe
                                                   const uint8_t* aServerCert,
                                                   uint32_t aServerCertSize) {
   // ClearKey CDM doesn't support this method by spec.
   CK_LOGD("ClearKeySessionManager::SetServerCertificate");
   mHost->OnRejectPromise(aPromiseId, Exception::kExceptionNotSupportedError, 0,
                          nullptr /* message */, 0 /* messageLen */);
 }
 
-Status ClearKeySessionManager::Decrypt(const InputBuffer_1& aBuffer,
+Status ClearKeySessionManager::Decrypt(const InputBuffer_2& aBuffer,
                                        DecryptedBlock* aDecryptedBlock) {
   CK_LOGD("ClearKeySessionManager::Decrypt");
 
   CK_LOGARRAY("Key: ", aBuffer.key_id, aBuffer.key_id_size);
 
   Buffer* buffer = mHost->Allocate(aBuffer.data_size);
   assert(buffer != nullptr);
   assert(buffer->Data() != nullptr);
--- a/media/gmp-clearkey/0.1/ClearKeySessionManager.h
+++ b/media/gmp-clearkey/0.1/ClearKeySessionManager.h
@@ -30,17 +30,17 @@
 #include <functional>
 #include <map>
 #include <queue>
 #include <set>
 #include <string>
 
 class ClearKeySessionManager final : public RefCounted {
  public:
-  explicit ClearKeySessionManager(cdm::Host_9* aHost);
+  explicit ClearKeySessionManager(cdm::Host_10* aHost);
 
   void Init(bool aDistinctiveIdentifierAllowed, bool aPersistentStateAllowed);
 
   void CreateSession(uint32_t aPromiseId, cdm::InitDataType aInitDataType,
                      const uint8_t* aInitData, uint32_t aInitDataSize,
                      cdm::SessionType aSessionType);
 
   void LoadSession(uint32_t aPromiseId, const char* aSessionId,
@@ -54,17 +54,17 @@ class ClearKeySessionManager final : pub
                     uint32_t aSessionIdLength);
 
   void RemoveSession(uint32_t aPromiseId, const char* aSessionId,
                      uint32_t aSessionIdLength);
 
   void SetServerCertificate(uint32_t aPromiseId, const uint8_t* aServerCert,
                             uint32_t aServerCertSize);
 
-  cdm::Status Decrypt(const cdm::InputBuffer_1& aBuffer,
+  cdm::Status Decrypt(const cdm::InputBuffer_2& aBuffer,
                       cdm::DecryptedBlock* aDecryptedBlock);
 
   void DecryptingComplete();
 
   void PersistentSessionDataLoaded(uint32_t aPromiseId,
                                    const std::string& aSessionId,
                                    const uint8_t* aKeyData,
                                    uint32_t aKeyDataSize);
@@ -75,17 +75,17 @@ class ClearKeySessionManager final : pub
   void ClearInMemorySessionData(ClearKeySession* aSession);
   bool MaybeDeferTillInitialized(std::function<void()>&& aMaybeDefer);
   void Serialize(const ClearKeySession* aSession,
                  std::vector<uint8_t>& aOutKeyData);
 
   RefPtr<ClearKeyDecryptionManager> mDecryptionManager;
   RefPtr<ClearKeyPersistence> mPersistence;
 
-  cdm::Host_9* mHost = nullptr;
+  cdm::Host_10* mHost = nullptr;
 
   std::set<KeyId> mKeyIds;
   std::map<std::string, ClearKeySession*> mSessions;
 
   std::queue<std::function<void()>> mDeferredInitialize;
 };
 
 #endif  // __ClearKeyDecryptor_h__
--- a/media/gmp-clearkey/0.1/ClearKeyStorage.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyStorage.cpp
@@ -31,17 +31,17 @@ using namespace cdm;
 using namespace std;
 
 class WriteRecordClient : public FileIOClient {
  public:
   /*
    * This function will take the memory ownership of the parameters and
    * delete them when done.
    */
-  static void Write(Host_9* aHost, string& aRecordName,
+  static void Write(Host_10* aHost, string& aRecordName,
                     const vector<uint8_t>& aData, function<void()>&& aOnSuccess,
                     function<void()>&& aOnFailure) {
     WriteRecordClient* client =
         new WriteRecordClient(aData, move(aOnSuccess), move(aOnFailure));
     client->Do(aRecordName, aHost);
   }
 
   void OnOpenComplete(Status aStatus) override {
@@ -66,17 +66,17 @@ class WriteRecordClient : public FileIOC
   explicit WriteRecordClient(const vector<uint8_t>& aData,
                              function<void()>&& aOnSuccess,
                              function<void()>&& aOnFailure)
       : mFileIO(nullptr),
         mOnSuccess(move(aOnSuccess)),
         mOnFailure(move(aOnFailure)),
         mData(aData) {}
 
-  void Do(const string& aName, Host_9* aHost) {
+  void Do(const string& aName, Host_10* aHost) {
     // Initialize the FileIO.
     mFileIO = aHost->CreateFileIO(this);
     mFileIO->Open(aName.c_str(), aName.size());
   }
 
   void Done(cdm::FileIOClient::Status aStatus) {
     // Note: Call Close() before running continuation, in case the
     // continuation tries to open the same record; if we call Close()
@@ -99,29 +99,30 @@ class WriteRecordClient : public FileIOC
   FileIO* mFileIO = nullptr;
 
   function<void()> mOnSuccess;
   function<void()> mOnFailure;
 
   const vector<uint8_t> mData;
 };
 
-void WriteData(Host_9* aHost, string& aRecordName, const vector<uint8_t>& aData,
-               function<void()>&& aOnSuccess, function<void()>&& aOnFailure) {
+void WriteData(Host_10* aHost, string& aRecordName,
+               const vector<uint8_t>& aData, function<void()>&& aOnSuccess,
+               function<void()>&& aOnFailure) {
   WriteRecordClient::Write(aHost, aRecordName, aData, move(aOnSuccess),
                            move(aOnFailure));
 }
 
 class ReadRecordClient : public FileIOClient {
  public:
   /*
    * This function will take the memory ownership of the parameters and
    * delete them when done.
    */
-  static void Read(Host_9* aHost, string& aRecordName,
+  static void Read(Host_10* aHost, string& aRecordName,
                    function<void(const uint8_t*, uint32_t)>&& aOnSuccess,
                    function<void()>&& aOnFailure) {
     (new ReadRecordClient(move(aOnSuccess), move(aOnFailure)))
         ->Do(aRecordName, aHost);
   }
 
   void OnOpenComplete(Status aStatus) override {
     auto err = aStatus;
@@ -145,17 +146,17 @@ class ReadRecordClient : public FileIOCl
  private:
   explicit ReadRecordClient(
       function<void(const uint8_t*, uint32_t)>&& aOnSuccess,
       function<void()>&& aOnFailure)
       : mFileIO(nullptr),
         mOnSuccess(move(aOnSuccess)),
         mOnFailure(move(aOnFailure)) {}
 
-  void Do(const string& aName, Host_9* aHost) {
+  void Do(const string& aName, Host_10* aHost) {
     mFileIO = aHost->CreateFileIO(this);
     mFileIO->Open(aName.c_str(), aName.size());
   }
 
   void Done(cdm::FileIOClient::Status aStatus, const uint8_t* aData,
             uint32_t aDataSize) {
     // Note: Call Close() before running continuation, in case the
     // continuation tries to open the same record; if we call Close()
@@ -176,14 +177,14 @@ class ReadRecordClient : public FileIOCl
   }
 
   FileIO* mFileIO = nullptr;
 
   function<void(const uint8_t*, uint32_t)> mOnSuccess;
   function<void()> mOnFailure;
 };
 
-void ReadData(Host_9* mHost, string& aRecordName,
+void ReadData(Host_10* aHost, string& aRecordName,
               function<void(const uint8_t*, uint32_t)>&& aOnSuccess,
               function<void()>&& aOnFailure) {
-  ReadRecordClient::Read(mHost, aRecordName, move(aOnSuccess),
+  ReadRecordClient::Read(aHost, aRecordName, move(aOnSuccess),
                          move(aOnFailure));
 }
--- a/media/gmp-clearkey/0.1/ClearKeyStorage.h
+++ b/media/gmp-clearkey/0.1/ClearKeyStorage.h
@@ -23,19 +23,19 @@
 #include <vector>
 
 #include "ClearKeySessionManager.h"
 
 #define IO_SUCCEEDED(x) ((x) == cdm::FileIOClient::Status::kSuccess)
 #define IO_FAILED(x) ((x) != cdm::FileIOClient::Status::kSuccess)
 
 // Writes data to a file and fires the appropriate callback when complete.
-void WriteData(cdm::Host_9* aHost, std::string& aRecordName,
+void WriteData(cdm::Host_10* aHost, std::string& aRecordName,
                const std::vector<uint8_t>& aData,
                std::function<void()>&& aOnSuccess,
                std::function<void()>&& aOnFailure);
 
 // Reads data from a file and fires the appropriate callback when complete.
-void ReadData(cdm::Host_9* aHost, std::string& aRecordName,
+void ReadData(cdm::Host_10* aHost, std::string& aRecordName,
               std::function<void(const uint8_t*, uint32_t)>&& aOnSuccess,
               std::function<void()>&& aOnFailure);
 
 #endif  // __ClearKeyStorage_h__
--- a/media/gmp-clearkey/0.1/VideoDecoder.cpp
+++ b/media/gmp-clearkey/0.1/VideoDecoder.cpp
@@ -22,44 +22,44 @@
 #include "ClearKeyDecryptionManager.h"
 #include "ClearKeyUtils.h"
 #include "VideoDecoder.h"
 #include "mozilla/CheckedInt.h"
 
 using namespace wmf;
 using namespace cdm;
 
-VideoDecoder::VideoDecoder(Host_9* aHost) : mHost(aHost), mHasShutdown(false) {
+VideoDecoder::VideoDecoder(Host_10* aHost) : mHost(aHost), mHasShutdown(false) {
   CK_LOGD("VideoDecoder created");
 
   // We drop the ref in DecodingComplete().
   AddRef();
 
   mDecoder = new WMFH264Decoder();
 
   uint32_t cores = std::max(1u, std::thread::hardware_concurrency());
 
   HRESULT hr = mDecoder->Init(cores);
 }
 
 VideoDecoder::~VideoDecoder() { CK_LOGD("VideoDecoder destroyed"); }
 
-Status VideoDecoder::InitDecode(const VideoDecoderConfig_1& aConfig) {
+Status VideoDecoder::InitDecode(const VideoDecoderConfig_2& aConfig) {
   CK_LOGD("VideoDecoder::InitDecode");
 
   if (!mDecoder) {
     CK_LOGD("VideoDecoder::InitDecode failed to init WMFH264Decoder");
 
     return Status::kDecodeError;
   }
 
   return Status::kSuccess;
 }
 
-Status VideoDecoder::Decode(const InputBuffer_1& aInputBuffer,
+Status VideoDecoder::Decode(const InputBuffer_2& aInputBuffer,
                             VideoFrame* aVideoFrame) {
   CK_LOGD("VideoDecoder::Decode");
   // If the input buffer we have been passed has a null buffer, it means we
   // should drain.
   if (!aInputBuffer.data) {
     // This will drain the decoder until there are no frames left to drain,
     // whereupon it will return 'NeedsMoreData'.
     CK_LOGD("VideoDecoder::Decode Input buffer null: Draining");
--- a/media/gmp-clearkey/0.1/VideoDecoder.h
+++ b/media/gmp-clearkey/0.1/VideoDecoder.h
@@ -24,21 +24,21 @@
 // This include is required in order for content_decryption_module to work
 // on Unix systems.
 #include "stddef.h"
 #include "content_decryption_module.h"
 #include "WMFH264Decoder.h"
 
 class VideoDecoder : public RefCounted {
  public:
-  explicit VideoDecoder(cdm::Host_9* aHost);
+  explicit VideoDecoder(cdm::Host_10* aHost);
 
-  cdm::Status InitDecode(const cdm::VideoDecoderConfig_1& aConfig);
+  cdm::Status InitDecode(const cdm::VideoDecoderConfig_2& aConfig);
 
-  cdm::Status Decode(const cdm::InputBuffer_1& aEncryptedBuffer,
+  cdm::Status Decode(const cdm::InputBuffer_2& aEncryptedBuffer,
                      cdm::VideoFrame* aVideoFrame);
 
   void Reset();
 
   void DecodingComplete();
 
   bool HasShutdown() { return mHasShutdown; }
 
@@ -55,17 +55,17 @@ class VideoDecoder : public RefCounted {
 
   cdm::Status OutputFrame(cdm::VideoFrame* aVideoFrame);
 
   HRESULT SampleToVideoFrame(IMFSample* aSample, int32_t aPictureWidth,
                              int32_t aPictureHeight, int32_t aStride,
                              int32_t aFrameHeight,
                              cdm::VideoFrame* aVideoFrame);
 
-  cdm::Host_9* mHost;
+  cdm::Host_10* mHost;
   wmf::AutoPtr<wmf::WMFH264Decoder> mDecoder;
 
   std::queue<wmf::CComPtr<IMFSample>> mOutputQueue;
 
   bool mHasShutdown;
 };
 
 #endif  // __VideoDecoder_h__
--- a/media/gmp-clearkey/0.1/gmp-clearkey.cpp
+++ b/media/gmp-clearkey/0.1/gmp-clearkey.cpp
@@ -45,17 +45,17 @@ void INITIALIZE_CDM_MODULE() {}
 static bool sCanReadHostVerificationFiles = false;
 
 CDM_API
 void* CreateCdmInstance(int cdm_interface_version, const char* key_system,
                         uint32_t key_system_size,
                         GetCdmHostFunc get_cdm_host_func, void* user_data) {
   CK_LOGE("ClearKey CreateCDMInstance");
 
-  if (cdm_interface_version != cdm::ContentDecryptionModule_9::kVersion) {
+  if (cdm_interface_version != cdm::ContentDecryptionModule_10::kVersion) {
     CK_LOGE(
         "ClearKey CreateCDMInstance failed due to requesting unsupported "
         "version %d.",
         cdm_interface_version);
     return nullptr;
   }
 #ifdef ENABLE_WMF
   if (!wmf::EnsureLibs()) {
@@ -66,17 +66,17 @@ void* CreateCdmInstance(int cdm_interfac
 
 #ifdef MOZILLA_OFFICIAL
   // Test that we're able to read the host files.
   if (!sCanReadHostVerificationFiles) {
     return nullptr;
   }
 #endif
 
-  cdm::Host_9* host = static_cast<cdm::Host_9*>(
+  cdm::Host_10* host = static_cast<cdm::Host_10*>(
       get_cdm_host_func(cdm_interface_version, user_data));
   ClearKeyCDM* clearKey = new ClearKeyCDM(host);
 
   CK_LOGE("Created ClearKeyCDM instance!");
 
   return clearKey;
 }
 
--- a/media/gmp-clearkey/0.1/manifest.json.in
+++ b/media/gmp-clearkey/0.1/manifest.json.in
@@ -1,13 +1,13 @@
 {
     "name": "clearkey",
     "description": "ClearKey Gecko Media Plugin",
     "version": "1",
     "x-cdm-module-versions": "4",
-    "x-cdm-interface-versions": "9",
-    "x-cdm-host-versions": "9",
+    "x-cdm-interface-versions": "10",
+    "x-cdm-host-versions": "10",
 #ifdef ENABLE_WMF
     "x-cdm-codecs": "avc1"
 #else
     "x-cdm-codecs": ""
 #endif
 }
\ No newline at end of file