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

Side by Side Diff: media/cdm/ppapi/external_clear_key/clear_key_cdm.cc

Issue 757953002: Add SubsampleEntry constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years 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.cc ('k') | media/formats/mp4/mp4_stream_parser.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cdm/ppapi/external_clear_key/clear_key_cdm.h" 5 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <sstream> 9 #include <sstream>
10 #include <string> 10 #include <string>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 DCHECK(!input_buffer.data_size); 100 DCHECK(!input_buffer.data_size);
101 return media::DecoderBuffer::CreateEOSBuffer(); 101 return media::DecoderBuffer::CreateEOSBuffer();
102 } 102 }
103 103
104 // TODO(xhwang): Get rid of this copy. 104 // TODO(xhwang): Get rid of this copy.
105 scoped_refptr<media::DecoderBuffer> output_buffer = 105 scoped_refptr<media::DecoderBuffer> output_buffer =
106 media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size); 106 media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size);
107 107
108 std::vector<media::SubsampleEntry> subsamples; 108 std::vector<media::SubsampleEntry> subsamples;
109 for (uint32_t i = 0; i < input_buffer.num_subsamples; ++i) { 109 for (uint32_t i = 0; i < input_buffer.num_subsamples; ++i) {
110 media::SubsampleEntry subsample; 110 subsamples.push_back(
111 subsample.clear_bytes = input_buffer.subsamples[i].clear_bytes; 111 media::SubsampleEntry(input_buffer.subsamples[i].clear_bytes,
112 subsample.cypher_bytes = input_buffer.subsamples[i].cipher_bytes; 112 input_buffer.subsamples[i].cipher_bytes));
113 subsamples.push_back(subsample);
114 } 113 }
115 114
116 scoped_ptr<media::DecryptConfig> decrypt_config(new media::DecryptConfig( 115 scoped_ptr<media::DecryptConfig> decrypt_config(new media::DecryptConfig(
117 std::string(reinterpret_cast<const char*>(input_buffer.key_id), 116 std::string(reinterpret_cast<const char*>(input_buffer.key_id),
118 input_buffer.key_id_size), 117 input_buffer.key_id_size),
119 std::string(reinterpret_cast<const char*>(input_buffer.iv), 118 std::string(reinterpret_cast<const char*>(input_buffer.iv),
120 input_buffer.iv_size), 119 input_buffer.iv_size),
121 subsamples)); 120 subsamples));
122 121
123 output_buffer->set_decrypt_config(decrypt_config.Pass()); 122 output_buffer->set_decrypt_config(decrypt_config.Pass());
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 host_->OnSessionMessage(last_session_id_.data(), 858 host_->OnSessionMessage(last_session_id_.data(),
860 last_session_id_.length(), 859 last_session_id_.length(),
861 message.data(), 860 message.data(),
862 message.length(), 861 message.length(),
863 NULL, 862 NULL,
864 0); 863 0);
865 file_io_test_runner_.reset(); 864 file_io_test_runner_.reset();
866 } 865 }
867 866
868 } // namespace media 867 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decrypt_config.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698