| 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/renderer/render_thread.h" | 13 #include "content/public/renderer/render_thread.h" |
| 14 | 14 |
| 15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| 16 | 16 |
| 17 using content::KeySystemInfo; | 17 using content::KeySystemInfo; |
| 18 using content::SupportedCodecs; | 18 using content::SupportedCodecs; |
| 19 | 19 |
| 20 namespace cdm { | 20 namespace cdm { |
| 21 | 21 |
| 22 static SupportedKeySystemResponse QueryKeySystemSupport( | 22 static SupportedKeySystemResponse QueryKeySystemSupport( |
| 23 const std::string& key_system) { | 23 const std::string& key_system) { |
| 24 SupportedKeySystemRequest request; | 24 SupportedKeySystemRequest request; |
| 25 SupportedKeySystemResponse response; | 25 SupportedKeySystemResponse response; |
| 26 | 26 |
| 27 request.key_system = key_system; | 27 request.key_system = key_system; |
| 28 request.codecs = content::EME_CODEC_WEBM_ALL | content::EME_CODEC_MP4_ALL; | 28 request.codecs = content::EME_CODEC_ALL; |
| 29 content::RenderThread::Get()->Send( | 29 content::RenderThread::Get()->Send( |
| 30 new ChromeViewHostMsg_QueryKeySystemSupport(request, &response)); | 30 new ChromeViewHostMsg_QueryKeySystemSupport(request, &response)); |
| 31 DCHECK(!(response.compositing_codecs & ~content::EME_CODEC_ALL)) | 31 DCHECK(!(response.compositing_codecs & ~content::EME_CODEC_ALL)) |
| 32 << "unrecognized codec"; | 32 << "unrecognized codec"; |
| 33 DCHECK(!(response.non_compositing_codecs & ~content::EME_CODEC_ALL)) | 33 DCHECK(!(response.non_compositing_codecs & ~content::EME_CODEC_ALL)) |
| 34 << "unrecognized codec"; | 34 << "unrecognized codec"; |
| 35 return response; | 35 return response; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) { | 38 void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 64 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); | 64 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); |
| 65 if (response.compositing_codecs != content::EME_CODEC_NONE) { | 65 if (response.compositing_codecs != content::EME_CODEC_NONE) { |
| 66 KeySystemInfo info(*it); | 66 KeySystemInfo info(*it); |
| 67 info.supported_codecs = response.compositing_codecs; | 67 info.supported_codecs = response.compositing_codecs; |
| 68 concrete_key_systems->push_back(info); | 68 concrete_key_systems->push_back(info); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace cdm | 73 } // namespace cdm |
| OLD | NEW |