Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / components / cdm / browser / widevine_drm_delegate_android.cc
blob8acf8003be6e432d0204fe2830ef490a922f8087
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
3 // found in the LICENSE file.
5 #include "components/cdm/browser/widevine_drm_delegate_android.h"
7 #include "media/cdm/cenc_utils.h"
9 namespace cdm {
11 namespace {
13 const uint8_t kWidevineUuid[16] = {
14 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE,
15 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED };
17 } // namespace
19 WidevineDrmDelegateAndroid::WidevineDrmDelegateAndroid() {
22 WidevineDrmDelegateAndroid::~WidevineDrmDelegateAndroid() {
25 const std::vector<uint8_t> WidevineDrmDelegateAndroid::GetUUID() const {
26 return std::vector<uint8_t>(kWidevineUuid,
27 kWidevineUuid + arraysize(kWidevineUuid));
30 bool WidevineDrmDelegateAndroid::OnCreateSession(
31 const media::EmeInitDataType init_data_type,
32 const std::vector<uint8_t>& init_data,
33 std::vector<uint8_t>* init_data_out,
34 std::vector<std::string>* /* optional_parameters_out */) {
35 if (init_data_type != media::EmeInitDataType::CENC)
36 return true;
38 // Widevine MediaDrm plugin only accepts the "data" part of the PSSH box as
39 // the init data when using MP4 container.
40 return media::GetPsshData(init_data, GetUUID(), init_data_out);
43 } // namespace cdm