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

Side by Side Diff: components/cdm/renderer/android_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, 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/android_key_systems.h" 5 #include "components/cdm/renderer/android_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 "components/cdm/common/cdm_messages_android.h" 11 #include "components/cdm/common/cdm_messages_android.h"
12 #include "components/cdm/renderer/widevine_key_systems.h" 12 #include "components/cdm/renderer/widevine_key_systems.h"
13 #include "content/public/common/eme_constants.h"
13 #include "content/public/renderer/render_thread.h" 14 #include "content/public/renderer/render_thread.h"
14 15
15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 16 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
16 17
17 using content::KeySystemInfo; 18 using content::KeySystemInfo;
18 using content::SupportedCodecs; 19 using content::SupportedCodecs;
19 20
20 namespace cdm { 21 namespace cdm {
21 22
22 static SupportedKeySystemResponse QueryKeySystemSupport( 23 static SupportedKeySystemResponse QueryKeySystemSupport(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 std::vector<std::string> key_system_names; 59 std::vector<std::string> key_system_names;
59 content::RenderThread::Get()->Send( 60 content::RenderThread::Get()->Send(
60 new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names)); 61 new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names));
61 62
62 for (std::vector<std::string>::const_iterator it = key_system_names.begin(); 63 for (std::vector<std::string>::const_iterator it = key_system_names.begin();
63 it != key_system_names.end(); ++it) { 64 it != key_system_names.end(); ++it) {
64 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); 65 SupportedKeySystemResponse response = QueryKeySystemSupport(*it);
65 if (response.compositing_codecs != content::EME_CODEC_NONE) { 66 if (response.compositing_codecs != content::EME_CODEC_NONE) {
66 KeySystemInfo info(*it); 67 KeySystemInfo info(*it);
67 info.supported_codecs = response.compositing_codecs; 68 info.supported_codecs = response.compositing_codecs;
69 // Assume that WebM and CENC are supported by platform CDMs. |KeySystems|
ddorwin 2014/09/23 22:48:15 ... CDMs that support their respective containers.
ddorwin 2014/09/23 22:48:15 I think '|' is usually used for parameters and may
sandersd (OOO until July 31) 2014/09/24 22:22:32 No, it just returns false for IsSupported queries,
sandersd (OOO until July 31) 2014/09/24 22:22:33 Done.
70 // handles validating |init_data_type|/|container| mappings.
71 info.supported_init_data_types = content::EME_INIT_DATA_TYPE_WEBM;
72 #if defined(USE_PROPRIETARY_CODECS)
73 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_CENC;
74 #endif // defined(USE_PROPRIETARY_CODECS)
68 concrete_key_systems->push_back(info); 75 concrete_key_systems->push_back(info);
69 } 76 }
70 } 77 }
71 } 78 }
72 79
73 } // namespace cdm 80 } // namespace cdm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698