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

Side by Side Diff: media/base/decrypt_config.cc

Issue 1422643002: Pass DecryptConfig parameters over IPC and use it in AVDA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed MediaCodec.CodecException that was added only at level 21 (Android L) Created 5 years, 1 month 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
« no previous file with comments | « media/base/decrypt_config.h ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/base/decrypt_config.h" 5 #include "media/base/decrypt_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h"
8 9
9 namespace media { 10 namespace media {
10 11
11 DecryptConfig::DecryptConfig(const std::string& key_id, 12 DecryptConfig::DecryptConfig(const std::string& key_id,
12 const std::string& iv, 13 const std::string& iv,
13 const std::vector<SubsampleEntry>& subsamples) 14 const std::vector<SubsampleEntry>& subsamples)
14 : key_id_(key_id), 15 : key_id_(key_id),
15 iv_(iv), 16 iv_(iv),
16 subsamples_(subsamples) { 17 subsamples_(subsamples) {
17 CHECK_GT(key_id.size(), 0u); 18 CHECK_GT(key_id.size(), 0u);
(...skipping 12 matching lines...) Expand all
30 for (size_t i = 0; i < subsamples().size(); ++i) { 31 for (size_t i = 0; i < subsamples().size(); ++i) {
31 if ((subsamples()[i].clear_bytes != config.subsamples()[i].clear_bytes) || 32 if ((subsamples()[i].clear_bytes != config.subsamples()[i].clear_bytes) ||
32 (subsamples()[i].cypher_bytes != config.subsamples()[i].cypher_bytes)) { 33 (subsamples()[i].cypher_bytes != config.subsamples()[i].cypher_bytes)) {
33 return false; 34 return false;
34 } 35 }
35 } 36 }
36 37
37 return true; 38 return true;
38 } 39 }
39 40
41 std::ostream& DecryptConfig::Print(std::ostream& os) const {
42 os << "key_id:'" << base::HexEncode(key_id_.data(), key_id_.size()) << "'"
43 << " iv:'" << base::HexEncode(iv_.data(), iv_.size()) << "'";
44
45 os << " subsamples:[";
46 for (const SubsampleEntry& entry : subsamples_) {
47 os << "(clear:" << entry.clear_bytes << ", cypher:" << entry.cypher_bytes
48 << ")";
49 }
50 os << "]";
51 return os;
52 }
53
40 } // namespace media 54 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decrypt_config.h ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698