OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "chromecast/media/cma/base/cast_decrypt_config_impl.h" |
| 6 |
| 7 #include "media/base/decrypt_config.h" |
| 8 |
| 9 namespace chromecast { |
| 10 namespace media { |
| 11 |
| 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)); |
| 18 } |
| 19 } |
| 20 |
| 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) {} |
| 26 |
| 27 CastDecryptConfigImpl::~CastDecryptConfigImpl() {} |
| 28 |
| 29 const std::string& CastDecryptConfigImpl::key_id() const { |
| 30 return key_id_; |
| 31 } |
| 32 |
| 33 const std::string& CastDecryptConfigImpl::iv() const { |
| 34 return iv_; |
| 35 } |
| 36 |
| 37 const std::vector<SubsampleEntry>& CastDecryptConfigImpl::subsamples() const { |
| 38 return subsamples_; |
| 39 } |
| 40 |
| 41 } // namespace media |
| 42 } // namespace chromecast |
OLD | NEW |