Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.h" | 5 #include "chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chromecast/media/cma/base/decoder_buffer_base.h" | 8 #include "chromecast/media/cma/base/decoder_buffer_base.h" |
| 9 #include "chromecast/media/cma/ipc/media_message.h" | 9 #include "chromecast/media/cma/ipc/media_message.h" |
| 10 #include "chromecast/media/cma/ipc/media_message_type.h" | 10 #include "chromecast/media/cma/ipc/media_message_type.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 CHECK(msg->WritePod(buffer->end_of_stream())); | 134 CHECK(msg->WritePod(buffer->end_of_stream())); |
| 135 if (buffer->end_of_stream()) | 135 if (buffer->end_of_stream()) |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 CHECK(msg->WritePod(buffer->timestamp().ToInternalValue())); | 138 CHECK(msg->WritePod(buffer->timestamp().ToInternalValue())); |
| 139 | 139 |
| 140 bool has_decrypt_config = | 140 bool has_decrypt_config = |
| 141 (buffer->decrypt_config() != NULL && | 141 (buffer->decrypt_config() != NULL && |
| 142 buffer->decrypt_config()->iv().size() > 0); | 142 buffer->decrypt_config()->iv().size() > 0); |
| 143 CHECK(msg->WritePod(has_decrypt_config)); | 143 CHECK(msg->WritePod(has_decrypt_config)); |
| 144 if (has_decrypt_config) | 144 |
| 145 DecryptConfigMarshaller::Write(*buffer->decrypt_config(), msg); | 145 if (has_decrypt_config) { |
|
damienv1
2014/10/17 15:46:05
Note: I was thinking about sth like:
::media::Dec
gunsch
2014/10/17 16:04:02
heh, I had something exactly like this earlier and
| |
| 146 if (buffer->decrypt_config()->subsamples().size() == 0) | |
| 147 DecryptConfigMarshaller::WriteFullSampleEncryption( | |
| 148 *buffer->decrypt_config(), buffer->data_size(), msg); | |
| 149 else | |
| 150 DecryptConfigMarshaller::Write(*buffer->decrypt_config(), msg); | |
| 151 } | |
| 146 | 152 |
| 147 CHECK(msg->WritePod(buffer->data_size())); | 153 CHECK(msg->WritePod(buffer->data_size())); |
| 148 CHECK(msg->WriteBuffer(buffer->data(), buffer->data_size())); | 154 CHECK(msg->WriteBuffer(buffer->data(), buffer->data_size())); |
| 149 } | 155 } |
| 150 | 156 |
| 151 // static | 157 // static |
| 152 scoped_refptr<DecoderBufferBase> DecoderBufferBaseMarshaller::Read( | 158 scoped_refptr<DecoderBufferBase> DecoderBufferBaseMarshaller::Read( |
| 153 scoped_ptr<MediaMessage> msg) { | 159 scoped_ptr<MediaMessage> msg) { |
| 154 scoped_refptr<DecoderBufferFromMsg> buffer( | 160 scoped_refptr<DecoderBufferFromMsg> buffer( |
| 155 new DecoderBufferFromMsg(msg.Pass())); | 161 new DecoderBufferFromMsg(msg.Pass())); |
| 156 buffer->Initialize(); | 162 buffer->Initialize(); |
| 157 return buffer; | 163 return buffer; |
| 158 } | 164 } |
| 159 | 165 |
| 160 } // namespace media | 166 } // namespace media |
| 161 } // namespace chromecast | 167 } // namespace chromecast |
| OLD | NEW |