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 "chromecast/media/cma/base/cast_decrypt_config_impl.h"
7 #include "media/base/decrypt_config.h"
12 CastDecryptConfigImpl::CastDecryptConfigImpl(
13 const ::media::DecryptConfig
& config
)
14 : key_id_(config
.key_id()), iv_(config
.iv()) {
15 for (const auto& sample
: config
.subsamples()) {
16 subsamples_
.push_back(
17 SubsampleEntry(sample
.clear_bytes
, sample
.cypher_bytes
));
21 CastDecryptConfigImpl::CastDecryptConfigImpl(
22 const std::string
& key_id
,
23 const std::string
& iv
,
24 const std::vector
<SubsampleEntry
>& subsamples
)
25 : key_id_(key_id
), iv_(iv
), subsamples_(subsamples
) {}
27 CastDecryptConfigImpl::~CastDecryptConfigImpl() {}
29 const std::string
& CastDecryptConfigImpl::key_id() const {
33 const std::string
& CastDecryptConfigImpl::iv() const {
37 const std::vector
<SubsampleEntry
>& CastDecryptConfigImpl::subsamples() const {
42 } // namespace chromecast