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

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

Issue 557723003: Implement Chromium side of MediaKeys.isTypeSupported(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Requested changes. Created 6 years, 3 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 12
12 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
13 14
14 #if defined(WIDEVINE_CDM_AVAILABLE) 15 #if defined(WIDEVINE_CDM_AVAILABLE)
15 16
16 using content::KeySystemInfo; 17 using content::KeySystemInfo;
17 using content::SupportedCodecs; 18 using content::SupportedCodecs;
18 19
19 namespace cdm { 20 namespace cdm {
20 21
(...skipping 21 matching lines...) Expand all
42 #endif // defined(OS_ANDROID) 43 #endif // defined(OS_ANDROID)
43 default: 44 default:
44 NOTREACHED(); 45 NOTREACHED();
45 } 46 }
46 47
47 // 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
48 // 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
49 // initDataType. 50 // initDataType.
50 info.supported_codecs = supported_codecs; 51 info.supported_codecs = supported_codecs;
51 52
53 // |KeySystems| handles validating |init_data_type|/|container| mappings.
ddorwin 2014/09/23 22:48:15 ditto.
ddorwin 2014/09/23 22:48:15 // Support for a container implies support for the
sandersd (OOO until July 31) 2014/09/24 22:22:33 Done.
sandersd (OOO until July 31) 2014/09/24 22:22:33 Done.
54 info.supported_init_data_types = content::EME_INIT_DATA_TYPE_NONE;
ddorwin 2014/09/23 22:48:15 The constructor should handle this.
sandersd (OOO until July 31) 2014/09/24 22:22:33 Done.
55 if (supported_codecs & content::EME_CODEC_WEBM_ALL)
56 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_WEBM;
57 #if defined(USE_PROPRIETARY_CODECS)
58 if (supported_codecs & content::EME_CODEC_MP4_ALL)
59 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_CENC;
60 #endif // defined(USE_PROPRIETARY_CODECS)
61
52 #if defined(ENABLE_PEPPER_CDMS) 62 #if defined(ENABLE_PEPPER_CDMS)
53 info.pepper_type = kWidevineCdmPluginMimeType; 63 info.pepper_type = kWidevineCdmPluginMimeType;
54 #endif // defined(ENABLE_PEPPER_CDMS) 64 #endif // defined(ENABLE_PEPPER_CDMS)
55 65
56 concrete_key_systems->push_back(info); 66 concrete_key_systems->push_back(info);
57 } 67 }
58 68
59 } // namespace cdm 69 } // namespace cdm
60 70
61 #endif // defined(WIDEVINE_CDM_AVAILABLE) 71 #endif // defined(WIDEVINE_CDM_AVAILABLE)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698