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

Side by Side Diff: components/cdm/common/widevine_drm_delegate_android.cc

Issue 2643333002: Convert USE_PROPRIETARY_CODECS to a buildflag header. (Closed)
Patch Set: Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/common/widevine_drm_delegate_android.h" 5 #include "components/cdm/common/widevine_drm_delegate_android.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "media/cdm/cenc_utils.h" 8 #include "media/cdm/cenc_utils.h"
9 #include "media/media_features.h"
9 10
10 namespace cdm { 11 namespace cdm {
11 12
12 namespace { 13 namespace {
13 14
14 const uint8_t kWidevineUuid[16] = { 15 const uint8_t kWidevineUuid[16] = {
15 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, // 16 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, //
16 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED}; 17 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED};
17 18
18 } // namespace 19 } // namespace
19 20
20 WidevineDrmDelegateAndroid::WidevineDrmDelegateAndroid() {} 21 WidevineDrmDelegateAndroid::WidevineDrmDelegateAndroid() {}
21 22
22 WidevineDrmDelegateAndroid::~WidevineDrmDelegateAndroid() {} 23 WidevineDrmDelegateAndroid::~WidevineDrmDelegateAndroid() {}
23 24
24 const std::vector<uint8_t> WidevineDrmDelegateAndroid::GetUUID() const { 25 const std::vector<uint8_t> WidevineDrmDelegateAndroid::GetUUID() const {
25 return std::vector<uint8_t>(kWidevineUuid, 26 return std::vector<uint8_t>(kWidevineUuid,
26 kWidevineUuid + arraysize(kWidevineUuid)); 27 kWidevineUuid + arraysize(kWidevineUuid));
27 } 28 }
28 29
29 bool WidevineDrmDelegateAndroid::OnCreateSession( 30 bool WidevineDrmDelegateAndroid::OnCreateSession(
30 const media::EmeInitDataType init_data_type, 31 const media::EmeInitDataType init_data_type,
31 const std::vector<uint8_t>& init_data, 32 const std::vector<uint8_t>& init_data,
32 std::vector<uint8_t>* init_data_out, 33 std::vector<uint8_t>* init_data_out,
33 std::vector<std::string>* /* optional_parameters_out */) { 34 std::vector<std::string>* /* optional_parameters_out */) {
34 if (init_data_type != media::EmeInitDataType::CENC) 35 if (init_data_type != media::EmeInitDataType::CENC)
35 return true; 36 return true;
36 37
37 #if defined(USE_PROPRIETARY_CODECS) 38 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
38 // Widevine MediaDrm plugin only accepts the "data" part of the PSSH box as 39 // Widevine MediaDrm plugin only accepts the "data" part of the PSSH box as
39 // the init data when using MP4 container. 40 // the init data when using MP4 container.
40 return media::GetPsshData(init_data, GetUUID(), init_data_out); 41 return media::GetPsshData(init_data, GetUUID(), init_data_out);
41 #else 42 #else
42 return false; 43 return false;
43 #endif 44 #endif
44 } 45 }
45 46
46 } // namespace cdm 47 } // namespace cdm
OLDNEW
« no previous file with comments | « components/cdm/browser/cdm_message_filter_android.cc ('k') | components/cdm/renderer/android_key_systems.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698