diff options
author | jrummell <jrummell@chromium.org> | 2014-10-14 17:24:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-15 00:25:55 +0000 |
commit | e3bf57909309109bd0b0be0b207ef5cae71b413c (patch) | |
tree | 68f3583196553a0c502ce21a99bdf66b0cf7eaa8 /media | |
parent | 4736998c21d68ceb4ee23ca2a43a5fd703dbcfa6 (diff) | |
download | chromium_src-e3bf57909309109bd0b0be0b207ef5cae71b413c.zip chromium_src-e3bf57909309109bd0b0be0b207ef5cae71b413c.tar.gz chromium_src-e3bf57909309109bd0b0be0b207ef5cae71b413c.tar.bz2 |
Remove support for CDM_4
BUG=408328
TEST=Existing EME tests pass
Review URL: https://codereview.chromium.org/650953002
Cr-Commit-Position: refs/heads/master@{#299597}
Diffstat (limited to 'media')
-rw-r--r-- | media/cdm/ppapi/cdm_adapter.cc | 114 | ||||
-rw-r--r-- | media/cdm/ppapi/cdm_adapter.h | 23 | ||||
-rw-r--r-- | media/cdm/ppapi/cdm_wrapper.h | 319 | ||||
-rw-r--r-- | media/cdm/ppapi/supported_cdm_versions.h | 2 |
4 files changed, 18 insertions, 440 deletions
diff --git a/media/cdm/ppapi/cdm_adapter.cc b/media/cdm/ppapi/cdm_adapter.cc index a3245de..83bf899 100644 --- a/media/cdm/ppapi/cdm_adapter.cc +++ b/media/cdm/ppapi/cdm_adapter.cc @@ -357,11 +357,8 @@ void CdmAdapter::SetServerCertificate(uint32_t promise_id, return; } - if (!cdm_->SetServerCertificate( - promise_id, server_certificate_ptr, server_certificate_size)) { - // CDM_4 and CDM_5 don't support this method, so reject the promise. - RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); - } + cdm_->SetServerCertificate( + promise_id, server_certificate_ptr, server_certificate_size); } void CdmAdapter::CreateSession(uint32_t promise_id, @@ -426,11 +423,8 @@ void CdmAdapter::UpdateSession(uint32_t promise_id, void CdmAdapter::CloseSession(uint32_t promise_id, const std::string& web_session_id) { - if (!cdm_->CloseSession( - promise_id, web_session_id.data(), web_session_id.length())) { - // CDM_4 doesn't support this method, so reject the promise. - RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); - } + cdm_->CloseSession( + promise_id, web_session_id.data(), web_session_id.length()); } void CdmAdapter::RemoveSession(uint32_t promise_id, @@ -441,11 +435,8 @@ void CdmAdapter::RemoveSession(uint32_t promise_id, void CdmAdapter::GetUsableKeyIds(uint32_t promise_id, const std::string& web_session_id) { - if (!cdm_->GetUsableKeyIds( - promise_id, web_session_id.data(), web_session_id.length())) { - // CDM_4 doesn't support this method, so reject the promise. - RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); - } + cdm_->GetUsableKeyIds( + promise_id, web_session_id.data(), web_session_id.length()); } // Note: In the following decryption/decoding related functions, errors are NOT @@ -642,93 +633,6 @@ void CdmAdapter::TimerExpired(int32_t result, void* context) { cdm_->TimerExpired(context); } -// cdm::Host_4 methods - -double CdmAdapter::GetCurrentWallTimeInSeconds() { - return GetCurrentWallTime(); -} - -void CdmAdapter::OnSessionCreated(uint32_t session_id, - const char* web_session_id, - uint32_t web_session_id_length) { - uint32_t promise_id = cdm_->LookupPromiseId(session_id); - cdm_->AssignWebSessionId(session_id, web_session_id, web_session_id_length); - OnResolveNewSessionPromise(promise_id, web_session_id, web_session_id_length); -} - -void CdmAdapter::OnSessionMessage(uint32_t session_id, - const char* message, - uint32_t message_length, - const char* destination_url, - uint32_t destination_url_length) { - std::string web_session_id = cdm_->LookupWebSessionId(session_id); - OnSessionMessage(web_session_id.data(), - web_session_id.length(), - message, - message_length, - destination_url, - destination_url_length); -} - -void CdmAdapter::OnSessionReady(uint32_t session_id) { - uint32_t promise_id = cdm_->LookupPromiseId(session_id); - if (promise_id) { - OnResolvePromise(promise_id); - } else { - std::string web_session_id = cdm_->LookupWebSessionId(session_id); - PostOnMain(callback_factory_.NewCallback( - &CdmAdapter::SendSessionReadyInternal, web_session_id)); - } -} - -void CdmAdapter::OnSessionClosed(uint32_t session_id) { - uint32_t promise_id = cdm_->LookupPromiseId(session_id); - std::string web_session_id = cdm_->LookupWebSessionId(session_id); - cdm_->DropWebSessionId(web_session_id); - if (promise_id) { - OnResolvePromise(promise_id); - } else { - OnSessionClosed(web_session_id.data(), web_session_id.length()); - } -} - -void CdmAdapter::OnSessionError(uint32_t session_id, - cdm::MediaKeyError error_code, - uint32_t system_code) { - uint32_t promise_id = cdm_->LookupPromiseId(session_id); - - // Existing cdm::MediaKeyError don't map to DOM error names. Convert them - // into non-standard names so that the prefixed API can extract them. - // TODO(jrummell): Remove this conversion and the inverse when CDM4 is gone. - cdm::Error error; - switch (error_code) { - case cdm::kPrefixedClientError: - error = cdm::kClientError; - break; - case cdm::kPrefixedOutputError: - error = cdm::kOutputError; - break; - case cdm::kPrefixedUnknownError: - default: - error = cdm::kUnknownError; - break; - } - - if (promise_id) { - RejectPromise(promise_id, error, system_code, std::string()); - } else { - std::string web_session_id = cdm_->LookupWebSessionId(session_id); - OnSessionError(web_session_id.data(), - web_session_id.length(), - error, - system_code, - NULL, - 0); - } -} - -// cdm::Host_6 methods - cdm::Time CdmAdapter::GetCurrentWallTime() { return pp::Module::Get()->core()->GetTime(); } @@ -1356,17 +1260,13 @@ void* GetCdmHost(int host_interface_version, void* user_data) { // Current version is supported. IsSupportedCdmHostVersion(cdm::Host_6::kVersion) && // Include all previous supported versions (if any) here. - // Host_5 is not supported. - IsSupportedCdmHostVersion(cdm::Host_4::kVersion) && // One older than the oldest supported version is not supported. - !IsSupportedCdmHostVersion(cdm::Host_4::kVersion - 1)); + !IsSupportedCdmHostVersion(cdm::Host_6::kVersion - 1)); PP_DCHECK(IsSupportedCdmHostVersion(host_interface_version)); CdmAdapter* cdm_adapter = static_cast<CdmAdapter*>(user_data); CDM_DLOG() << "Create CDM Host with version " << host_interface_version; switch (host_interface_version) { - case cdm::Host_4::kVersion: - return static_cast<cdm::Host_4*>(cdm_adapter); case cdm::Host_6::kVersion: return static_cast<cdm::Host_6*>(cdm_adapter); default: diff --git a/media/cdm/ppapi/cdm_adapter.h b/media/cdm/ppapi/cdm_adapter.h index ed06261..9ceaea7 100644 --- a/media/cdm/ppapi/cdm_adapter.h +++ b/media/cdm/ppapi/cdm_adapter.h @@ -37,7 +37,6 @@ void* GetCdmHost(int host_interface_version, void* user_data); // Content Decryption Module (CDM). class CdmAdapter : public pp::Instance, public pp::ContentDecryptor_Private, - public cdm::Host_4, public cdm::Host_6 { public: CdmAdapter(PP_Instance instance, pp::Module* module); @@ -88,27 +87,9 @@ class CdmAdapter : public pp::Instance, pp::Buffer_Dev encrypted_buffer, const PP_EncryptedBlockInfo& encrypted_block_info) override; - // cdm::Host_4 and cdm::Host_6 implementation. + // cdm::Host_6 implementation. virtual cdm::Buffer* Allocate(uint32_t capacity) override; virtual void SetTimer(int64_t delay_ms, void* context) override; - - // cdm::Host_4 implementation. - virtual double GetCurrentWallTimeInSeconds() override; - virtual void OnSessionCreated(uint32_t session_id, - const char* web_session_id, - uint32_t web_session_id_length) override; - virtual void OnSessionMessage(uint32_t session_id, - const char* message, - uint32_t message_length, - const char* destination_url, - uint32_t destination_url_length) override; - virtual void OnSessionReady(uint32_t session_id) override; - virtual void OnSessionClosed(uint32_t session_id) override; - virtual void OnSessionError(uint32_t session_id, - cdm::MediaKeyError error_code, - uint32_t system_code) override; - - // cdm::Host_6 implementation. virtual cdm::Time GetCurrentWallTime() override; virtual void OnResolveNewSessionPromise( uint32_t promise_id, @@ -144,8 +125,6 @@ class CdmAdapter : public pp::Instance, uint32_t system_code, const char* error_message, uint32_t error_message_length) override; - - // cdm::Host_4 and cdm::Host_6 implementation. virtual void SendPlatformChallenge(const char* service_id, uint32_t service_id_length, const char* challenge, diff --git a/media/cdm/ppapi/cdm_wrapper.h b/media/cdm/ppapi/cdm_wrapper.h index 7d05a44..4cc54ed 100644 --- a/media/cdm/ppapi/cdm_wrapper.h +++ b/media/cdm/ppapi/cdm_wrapper.h @@ -42,8 +42,7 @@ class CdmWrapper { virtual ~CdmWrapper() {}; - // TODO(jrummell): Remove return value when CDM4/5 are removed. - virtual bool SetServerCertificate(uint32_t promise_id, + virtual void SetServerCertificate(uint32_t promise_id, const uint8_t* server_certificate_data, uint32_t server_certificate_data_size) = 0; virtual void CreateSession(uint32_t promise_id, @@ -60,15 +59,13 @@ class CdmWrapper { uint32_t web_session_id_size, const uint8_t* response, uint32_t response_size) = 0; - // TODO(jrummell): Remove return value when CDM4/5 are removed. - virtual bool CloseSession(uint32_t promise_id, + virtual void CloseSession(uint32_t promise_id, const char* web_session_id, uint32_t web_session_id_size) = 0; virtual void RemoveSession(uint32_t promise_id, const char* web_session_id, uint32_t web_session_id_size) = 0; - // TODO(jrummell): Remove return value when CDM4/5 are removed. - virtual bool GetUsableKeyIds(uint32_t promise_id, + virtual void GetUsableKeyIds(uint32_t promise_id, const char* web_session_id, uint32_t web_session_id_size) = 0; virtual void TimerExpired(void* context) = 0; @@ -92,53 +89,6 @@ class CdmWrapper { uint32_t link_mask, uint32_t output_protection_mask) = 0; - // Helper function for the cdm::Host_4 methods. Calls to CreateSession(), - // LoadSession(), UpdateSession(), and ReleaseSession() pass in promise ids, - // but the CDM interface needs session ids. For create and load, we need to - // create a new session_id to pass to the CDM. For update and release, we need - // to look up |web_session_id| and convert it into the existing |session_id|. - // Since the callbacks don't come through this interface, cdm_adapter needs to - // create the mapping (and delete it on release). - // TODO(jrummell): Remove these once Host_4 interface is removed. - virtual uint32_t LookupPromiseId(uint32_t session_id) = 0; - virtual void AssignWebSessionId(uint32_t session_id, - const char* web_session_id, - uint32_t web_session_id_size) = 0; - virtual std::string LookupWebSessionId(uint32_t session_id) = 0; - virtual void DropWebSessionId(std::string web_session_id) = 0; - - // Helper functions for the cdm::Host_4 methods. - // CDMs using cdm::Host_6 will call OnSessionUsableKeys() as necessary when - // resolving LoadSession() and UpdateSession(). This needs to be simulated - // for the older CDMs. These must not be called for cdm::Host_6 and later. - // TODO(jrummell): Remove these once Host_4 interface is removed. - - // Query whether a SessionUsableKeys event is necessary for the specified - // |promise_id|. Returns true if needed and |web_session_id| is updated, - // otherwise returns false. - virtual bool SessionUsableKeysEventNeeded(uint32_t promise_id, - std::string* web_session_id) = 0; - - // Used to indicate that a SessionUsableKeys event is required for the - // specified |promise_id| and associated |web_session_id|. - virtual void SetSessionUsableKeysEventNeeded( - uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) = 0; - - // cdm::Host_6 introduces InputBuffer_2 (aka InputBuffer). cdm::Host_4 - // methods still use InputBuffer_1, so this helper function - // converts InputBuffer_2 to InputBuffer_1. - // TODO(jrummell): Remove these once Host_4 interfaces is removed. - virtual void ConvertInputBuffer(const cdm::InputBuffer& v2, - cdm::InputBuffer_1* v1) = 0; - - // Prior to CDM_6, |init_data_type| was a content type. This helper convererts - // an |init_data_type| to a content type. - // TODO(sandersd): Remove once Host_4 interface is removed. - virtual std::string ConvertInitDataTypeToContentType( - const std::string& init_data_type) const = 0; - protected: CdmWrapper() {} @@ -170,22 +120,12 @@ class CdmWrapperImpl : public CdmWrapper { cdm_->Destroy(); } - // Returns true if |data| is prefixed with |header| and has data after the - // |header|. - bool HasHeader(const uint8* data, - int data_length, - const std::string& header) { - return static_cast<size_t>(data_length) > header.length() && - std::equal(data, data + header.length(), header.begin()); - } - - virtual bool SetServerCertificate( + virtual void SetServerCertificate( uint32_t promise_id, const uint8_t* server_certificate_data, uint32_t server_certificate_data_size) override { cdm_->SetServerCertificate( promise_id, server_certificate_data, server_certificate_data_size); - return true; } virtual void CreateSession(uint32_t promise_id, @@ -194,20 +134,6 @@ class CdmWrapperImpl : public CdmWrapper { const uint8_t* init_data, uint32_t init_data_size, cdm::SessionType session_type) override { - // TODO(jrummell): Remove this code once |session_type| is passed through - // Pepper. When removing, add the header back in for CDM4. - PP_DCHECK(session_type == cdm::kTemporary); - const char kPersistentSessionHeader[] = "PERSISTENT|"; - if (HasHeader(init_data, init_data_size, kPersistentSessionHeader)) { - cdm_->CreateSession(promise_id, - init_data_type, - init_data_type_size, - init_data + strlen(kPersistentSessionHeader), - init_data_size - strlen(kPersistentSessionHeader), - cdm::kPersistent); - return; - } - cdm_->CreateSession(promise_id, init_data_type, init_data_type_size, @@ -234,11 +160,10 @@ class CdmWrapperImpl : public CdmWrapper { response_size); } - virtual bool CloseSession(uint32_t promise_id, + virtual void CloseSession(uint32_t promise_id, const char* web_session_id, uint32_t web_session_id_size) override { cdm_->CloseSession(promise_id, web_session_id, web_session_id_size); - return true; } virtual void RemoveSession(uint32_t promise_id, @@ -247,11 +172,10 @@ class CdmWrapperImpl : public CdmWrapper { cdm_->RemoveSession(promise_id, web_session_id, web_session_id_size); } - virtual bool GetUsableKeyIds(uint32_t promise_id, + virtual void GetUsableKeyIds(uint32_t promise_id, const char* web_session_id, uint32_t web_session_id_size) override { cdm_->GetUsableKeyIds(promise_id, web_session_id, web_session_id_size); - return true; } virtual void TimerExpired(void* context) override { @@ -304,234 +228,16 @@ class CdmWrapperImpl : public CdmWrapper { cdm_->OnQueryOutputProtectionStatus(link_mask, output_protection_mask); } - uint32_t CreateSessionId() { - return next_session_id_++; - } - - void RegisterPromise(uint32_t session_id, uint32_t promise_id) { - PP_DCHECK(promise_to_session_id_map_.find(session_id) == - promise_to_session_id_map_.end()); - promise_to_session_id_map_.insert(std::make_pair(session_id, promise_id)); - } - - virtual uint32_t LookupPromiseId(uint32_t session_id) { - std::map<uint32_t, uint32_t>::iterator it = - promise_to_session_id_map_.find(session_id); - if (it == promise_to_session_id_map_.end()) - return 0; - uint32_t promise_id = it->second; - promise_to_session_id_map_.erase(it); - return promise_id; - } - - virtual void AssignWebSessionId(uint32_t session_id, - const char* web_session_id, - uint32_t web_session_id_size) { - web_session_to_session_id_map_.insert(std::make_pair( - std::string(web_session_id, web_session_id_size), session_id)); - } - - uint32_t LookupSessionId(std::string web_session_id) { - return web_session_to_session_id_map_.find(web_session_id)->second; - } - - virtual std::string LookupWebSessionId(uint32_t session_id) { - std::map<std::string, uint32_t>::iterator it; - for (it = web_session_to_session_id_map_.begin(); - it != web_session_to_session_id_map_.end(); - ++it) { - if (it->second == session_id) - return it->first; - } - PP_NOTREACHED(); - return std::string(); - } - - virtual void DropWebSessionId(std::string web_session_id) { - web_session_to_session_id_map_.erase(web_session_id); - } - - virtual bool SessionUsableKeysEventNeeded(uint32_t promise_id, - std::string* web_session_id) { - std::map<uint32_t, std::string>::iterator it = - promises_needing_usable_keys_event_.find(promise_id); - if (it == promises_needing_usable_keys_event_.end()) - return false; - web_session_id->swap(it->second); - promises_needing_usable_keys_event_.erase(it); - return true; - } - - virtual void SetSessionUsableKeysEventNeeded(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) { - promises_needing_usable_keys_event_.insert(std::make_pair( - promise_id, std::string(web_session_id, web_session_id_size))); - } - - virtual void ConvertInputBuffer(const cdm::InputBuffer& v2, - cdm::InputBuffer_1* v1) { - v1->data = v2.data; - v1->data_size = v2.data_size; - v1->data_offset = 0; - v1->key_id = v2.key_id; - v1->key_id_size = v2.key_id_size; - v1->iv = v2.iv; - v1->iv_size = v2.iv_size; - v1->subsamples = v2.subsamples; - v1->num_subsamples = v2.num_subsamples; - v1->timestamp = v2.timestamp; - } - - virtual std::string ConvertInitDataTypeToContentType( - const std::string& init_data_type) const { - if (init_data_type == "cenc") - return "video/mp4"; - if (init_data_type == "webm") - return "video/webm"; - return init_data_type; - } - private: - CdmWrapperImpl(CdmInterface* cdm) : cdm_(cdm), next_session_id_(100) { + CdmWrapperImpl(CdmInterface* cdm) : cdm_(cdm) { PP_DCHECK(cdm_); } CdmInterface* cdm_; - std::map<uint32_t, uint32_t> promise_to_session_id_map_; - uint32_t next_session_id_; - std::map<std::string, uint32_t> web_session_to_session_id_map_; - - std::map<uint32_t, std::string> promises_needing_usable_keys_event_; - DISALLOW_COPY_AND_ASSIGN(CdmWrapperImpl); }; -// Overrides for the cdm::Host_4 methods. Calls to CreateSession(), -// LoadSession(), UpdateSession(), and ReleaseSession() pass in promise ids, -// but the CDM interface needs session ids. For create and load, we need to -// create a new session_id to pass to the CDM. For update and release, we need -// to look up |web_session_id| and convert it into the existing |session_id|. -// Since the callbacks don't come through this interface, cdm_adapter needs to -// create the mapping (and delete it on release). Finally, for create, we need -// to translate |init_data_type| to a MIME type. -// TODO(jrummell): Remove these once Host_4 interface is removed. - -template <> -bool CdmWrapperImpl<cdm::ContentDecryptionModule_4>::SetServerCertificate( - uint32_t promise_id, - const uint8_t* server_certificate_data, - uint32_t server_certificate_data_size) { - return false; -} - -template <> -void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::CreateSession( - uint32_t promise_id, - const char* init_data_type, - uint32_t init_data_type_size, - const uint8_t* init_data, - uint32_t init_data_size, - cdm::SessionType session_type) { - uint32_t session_id = CreateSessionId(); - RegisterPromise(session_id, promise_id); - std::string converted_init_data_type = ConvertInitDataTypeToContentType( - std::string(init_data_type, init_data_type_size)); - cdm_->CreateSession(session_id, - converted_init_data_type.data(), - converted_init_data_type.length(), - init_data, - init_data_size); -} - -template <> -void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::LoadSession( - uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) { - uint32_t session_id = CreateSessionId(); - RegisterPromise(session_id, promise_id); - // As CDM_4 doesn't support OnSessionUsableKeysChange(), make sure to generate - // one when the promise is resolved. This may be overly aggressive. - SetSessionUsableKeysEventNeeded( - promise_id, web_session_id, web_session_id_size); - cdm_->LoadSession(session_id, web_session_id, web_session_id_size); -} - -template <> -void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::UpdateSession( - uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size, - const uint8_t* response, - uint32_t response_size) { - std::string web_session_str(web_session_id, web_session_id_size); - uint32_t session_id = LookupSessionId(web_session_str); - RegisterPromise(session_id, promise_id); - // As CDM_4 doesn't support OnSessionUsableKeysChange(), make sure to generate - // one when the promise is resolved. This may be overly aggressive. - SetSessionUsableKeysEventNeeded( - promise_id, web_session_id, web_session_id_size); - cdm_->UpdateSession(session_id, response, response_size); -} - -template <> -bool CdmWrapperImpl<cdm::ContentDecryptionModule_4>::CloseSession( - uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) { - return false; -} - -template <> -void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::RemoveSession( - uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) { - std::string web_session_str(web_session_id, web_session_id_size); - uint32_t session_id = LookupSessionId(web_session_str); - RegisterPromise(session_id, promise_id); - cdm_->ReleaseSession(session_id); -} - -template <> -bool CdmWrapperImpl<cdm::ContentDecryptionModule_4>::GetUsableKeyIds( - uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) { - return false; -} - -template <> -cdm::Status CdmWrapperImpl<cdm::ContentDecryptionModule_4>::Decrypt( - const cdm::InputBuffer& encrypted_buffer, - cdm::DecryptedBlock* decrypted_buffer) { - cdm::InputBuffer_1 buffer; - ConvertInputBuffer(encrypted_buffer, &buffer); - return cdm_->Decrypt(buffer, decrypted_buffer); -} - -template <> -cdm::Status -CdmWrapperImpl<cdm::ContentDecryptionModule_4>::DecryptAndDecodeFrame( - const cdm::InputBuffer& encrypted_buffer, - cdm::VideoFrame* video_frame) { - cdm::InputBuffer_1 buffer; - ConvertInputBuffer(encrypted_buffer, &buffer); - return cdm_->DecryptAndDecodeFrame(buffer, video_frame); -} - -template <> -cdm::Status -CdmWrapperImpl<cdm::ContentDecryptionModule_4>::DecryptAndDecodeSamples( - const cdm::InputBuffer& encrypted_buffer, - cdm::AudioFrames* audio_frames) { - cdm::InputBuffer_1 buffer; - ConvertInputBuffer(encrypted_buffer, &buffer); - return cdm_->DecryptAndDecodeSamples(buffer, audio_frames); -} - CdmWrapper* CdmWrapper::Create(const char* key_system, uint32_t key_system_size, GetCdmHostFunc get_cdm_host_func, @@ -548,22 +254,17 @@ CdmWrapper* CdmWrapper::Create(const char* key_system, !IsSupportedCdmInterfaceVersion(cdm::ContentDecryptionModule::kVersion + 1) && IsSupportedCdmInterfaceVersion(cdm::ContentDecryptionModule::kVersion) && - IsSupportedCdmInterfaceVersion( - cdm::ContentDecryptionModule_4::kVersion) && - !IsSupportedCdmInterfaceVersion(cdm::ContentDecryptionModule_4::kVersion - + !IsSupportedCdmInterfaceVersion(cdm::ContentDecryptionModule::kVersion - 1)); // Try to create the CDM using the latest CDM interface version. CdmWrapper* cdm_wrapper = CdmWrapperImpl<cdm::ContentDecryptionModule>::Create( key_system, key_system_size, get_cdm_host_func, user_data); - if (cdm_wrapper) - return cdm_wrapper; // If |cdm_wrapper| is NULL, try to create the CDM using older supported - // versions of the CDM interface. - cdm_wrapper = CdmWrapperImpl<cdm::ContentDecryptionModule_4>::Create( - key_system, key_system_size, get_cdm_host_func, user_data); + // versions of the CDM interface here. + return cdm_wrapper; } diff --git a/media/cdm/ppapi/supported_cdm_versions.h b/media/cdm/ppapi/supported_cdm_versions.h index bc669fc..ae6e567 100644 --- a/media/cdm/ppapi/supported_cdm_versions.h +++ b/media/cdm/ppapi/supported_cdm_versions.h @@ -26,7 +26,6 @@ bool IsSupportedCdmInterfaceVersion(int version) { switch(version) { // Supported versions in decreasing order. case cdm::ContentDecryptionModule_6::kVersion: - case cdm::ContentDecryptionModule_4::kVersion: return true; default: return false; @@ -40,7 +39,6 @@ bool IsSupportedCdmHostVersion(int version) { switch(version) { // Supported versions in decreasing order. case cdm::Host_6::kVersion: - case cdm::Host_4::kVersion: return true; default: return false; |