OLD | NEW |
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 Loading... |
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 // Here we assume that support for a container implies support for the |
| 70 // associated initialization data type. KeySystems handles validating |
| 71 // |init_data_type| x |container| pairings. |
| 72 if (response.compositing_codecs & content::EME_CODEC_WEBM_ALL) |
| 73 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_WEBM; |
| 74 #if defined(USE_PROPRIETARY_CODECS) |
| 75 if (response.compositing_codecs & content::EME_CODEC_MP4_ALL) |
| 76 info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_CENC; |
| 77 #endif // defined(USE_PROPRIETARY_CODECS) |
68 concrete_key_systems->push_back(info); | 78 concrete_key_systems->push_back(info); |
69 } | 79 } |
70 } | 80 } |
71 } | 81 } |
72 | 82 |
73 } // namespace cdm | 83 } // namespace cdm |
OLD | NEW |