Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: media/cdm/supported_cdm_versions.h

Issue 1430503004: Move code out of supported_cdm_versions.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: #undef Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cdm/ppapi/ppapi_cdm_adapter.gni ('k') | media/cdm/supported_cdm_versions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_ 5 #ifndef MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_
6 #define MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_ 6 #define MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_
7 7
8 #include "media/cdm/api/content_decryption_module.h" 8 #ifdef USE_PPAPI_CDM_ADAPTER
9 // When building the adapter these functions need to be local.
10 #define FUNCTION_EXPORT
11 #else
12 #include "media/base/media_export.h"
13 #define FUNCTION_EXPORT MEDIA_EXPORT
14 #endif
9 15
10 namespace media { 16 namespace media {
11 17
12 bool IsSupportedCdmModuleVersion(int version) { 18 FUNCTION_EXPORT bool IsSupportedCdmModuleVersion(int version);
13 switch (version) {
14 // Latest.
15 case CDM_MODULE_VERSION:
16 return true;
17 default:
18 return false;
19 }
20 }
21 19
22 bool IsSupportedCdmInterfaceVersion(int version) { 20 FUNCTION_EXPORT bool IsSupportedCdmInterfaceVersion(int version);
23 static_assert(cdm::ContentDecryptionModule::kVersion ==
24 cdm::ContentDecryptionModule_8::kVersion,
25 "update the code below");
26 switch (version) {
27 // Supported versions in decreasing order.
28 case cdm::ContentDecryptionModule_8::kVersion:
29 case cdm::ContentDecryptionModule_7::kVersion:
30 return true;
31 default:
32 return false;
33 }
34 }
35 21
36 bool IsSupportedCdmHostVersion(int version) { 22 FUNCTION_EXPORT bool IsSupportedCdmHostVersion(int version);
37 static_assert(cdm::ContentDecryptionModule::Host::kVersion ==
38 cdm::ContentDecryptionModule_8::Host::kVersion,
39 "update the code below");
40 switch (version) {
41 // Supported versions in decreasing order.
42 case cdm::Host_8::kVersion:
43 case cdm::Host_7::kVersion:
44 return true;
45 default:
46 return false;
47 }
48 }
49 23
50 } // namespace media 24 } // namespace media
51 25
26 #undef FUNCTION_EXPORT
27
52 #endif // MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_ 28 #endif // MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_
OLDNEW
« no previous file with comments | « media/cdm/ppapi/ppapi_cdm_adapter.gni ('k') | media/cdm/supported_cdm_versions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698