forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check CDM API version compatibility before registering component.
Compatibility is not checked before installing a component. This should be prevented on the server side. BUG=311374 TEST=video.canPlayType('video/webm; codecs="vp8"', 'com.widevine.alpha'); is affirmative when manifest contains supported "x-cdm-*-versions" values and "" when any value is unsupported. Review URL: https://codereview.chromium.org/47513020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232424 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
ddorwin@chromium.org
committed
Nov 1, 2013
1 parent
f2928a9
commit 9813665
Showing
7 changed files
with
193 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ | ||
#define MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ | ||
|
||
#include "media/cdm/ppapi/api/content_decryption_module.h" | ||
|
||
namespace media { | ||
|
||
// TODO(ddorwin): Move to content_decryption_module.h. | ||
#define CDM_MODULE_VERSION 4 | ||
|
||
bool IsSupportedCdmModuleVersion(int version) { | ||
switch(version) { | ||
// Latest. | ||
case CDM_MODULE_VERSION: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
bool IsSupportedCdmInterfaceVersion(int version) { | ||
COMPILE_ASSERT(cdm::ContentDecryptionModule::kVersion == | ||
cdm::ContentDecryptionModule_2::kVersion, | ||
update_code_below); | ||
switch(version) { | ||
// Latest. | ||
case cdm::ContentDecryptionModule::kVersion: | ||
// Older supported versions. | ||
case cdm::ContentDecryptionModule_1::kVersion: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
bool IsSupportedCdmHostVersion(int version) { | ||
COMPILE_ASSERT(cdm::ContentDecryptionModule::Host::kVersion == | ||
cdm::ContentDecryptionModule_2::Host::kVersion, | ||
update_code_below); | ||
switch(version) { | ||
// Supported versions in increasing order (there is no default). | ||
case cdm::Host_1::kVersion: | ||
case cdm::Host_2::kVersion: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
} // namespace media | ||
|
||
#endif // MEDIA_CDM_PPAPI_SUPPORTED_CDM_VERSIONS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters