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

Side by Side Diff: components/cdm/renderer/widevine_key_systems.cc

Issue 665343002: Move KeySystemInfo to media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/cdm/renderer/widevine_key_systems.h" 5 #include "components/cdm/renderer/widevine_key_systems.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "content/public/common/eme_constants.h" 11 #include "media/base/eme_constants.h"
12 12
13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
14 14
15 #if defined(WIDEVINE_CDM_AVAILABLE) 15 #if defined(WIDEVINE_CDM_AVAILABLE)
16 16
17 using content::KeySystemInfo; 17 namespace cdm {
18 using content::SupportedCodecs;
19 18
20 namespace cdm { 19 using media::KeySystemInfo;
ddorwin 2014/10/22 22:41:41 Why is this done within the cdm namespace now?
xhwang 2014/10/23 20:39:15 Reverted.
20 using media::SupportedCodecs;
21 21
22 // Return |name|'s parent key system. 22 // Return |name|'s parent key system.
23 static std::string GetDirectParentName(std::string name) { 23 static std::string GetDirectParentName(std::string name) {
24 size_t last_period = name.find_last_of('.'); 24 size_t last_period = name.find_last_of('.');
25 DCHECK_GT(last_period, 0u); 25 DCHECK_GT(last_period, 0u);
26 return name.substr(0u, last_period); 26 return name.substr(0u, last_period);
27 } 27 }
28 28
29 void AddWidevineWithCodecs(WidevineCdmType widevine_cdm_type, 29 void AddWidevineWithCodecs(WidevineCdmType widevine_cdm_type,
30 SupportedCodecs supported_codecs, 30 SupportedCodecs supported_codecs,
(...skipping 15 matching lines...) Expand all
46 } 46 }
47 47
48 // TODO(xhwang): A container or an initDataType may be supported even though 48 // TODO(xhwang): A container or an initDataType may be supported even though
49 // there are no codecs supported in that container. Fix this when we support 49 // there are no codecs supported in that container. Fix this when we support
50 // initDataType. 50 // initDataType.
51 info.supported_codecs = supported_codecs; 51 info.supported_codecs = supported_codecs;
52 52
53 // Here we assume that support for a container imples support for the 53 // Here we assume that support for a container imples support for the
54 // associated initialization data type. KeySystems handles validating 54 // associated initialization data type. KeySystems handles validating
55 // |init_data_type| x |container| pairings. 55 // |init_data_type| x |container| pairings.
56 if (supported_codecs & content::EME_CODEC_WEBM_ALL) 56 if (supported_codecs & media::EME_CODEC_WEBM_ALL)
57 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_WEBM; 57 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_WEBM;
58 #if defined(USE_PROPRIETARY_CODECS) 58 #if defined(USE_PROPRIETARY_CODECS)
59 if (supported_codecs & content::EME_CODEC_MP4_ALL) 59 if (supported_codecs & media::EME_CODEC_MP4_ALL)
60 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_CENC; 60 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC;
61 #endif // defined(USE_PROPRIETARY_CODECS) 61 #endif // defined(USE_PROPRIETARY_CODECS)
62 62
63 #if defined(ENABLE_PEPPER_CDMS) 63 #if defined(ENABLE_PEPPER_CDMS)
64 info.pepper_type = kWidevineCdmPluginMimeType; 64 info.pepper_type = kWidevineCdmPluginMimeType;
65 #endif // defined(ENABLE_PEPPER_CDMS) 65 #endif // defined(ENABLE_PEPPER_CDMS)
66 66
67 concrete_key_systems->push_back(info); 67 concrete_key_systems->push_back(info);
68 } 68 }
69 69
70 } // namespace cdm 70 } // namespace cdm
71 71
72 #endif // defined(WIDEVINE_CDM_AVAILABLE) 72 #endif // defined(WIDEVINE_CDM_AVAILABLE)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698