Chromium Code Reviews| Index: chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc |
| diff --git a/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc b/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc |
| index 14eb742495f1ed97dd648749e14ba1252257d641..907c58db673205039d2d6a6cb6e5eab287948eb0 100644 |
| --- a/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc |
| +++ b/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc |
| @@ -141,8 +141,24 @@ void DecoderBufferBaseMarshaller::Write( |
| (buffer->decrypt_config() != NULL && |
| buffer->decrypt_config()->iv().size() > 0); |
| CHECK(msg->WritePod(has_decrypt_config)); |
| - if (has_decrypt_config) |
| - DecryptConfigMarshaller::Write(*buffer->decrypt_config(), msg); |
| + |
| + if (has_decrypt_config) { |
| + // This handles the "Full Sample Encryption" case in |
| + // ISO/IEC 23001-7:2012 9.5 by declaring one "subsample" with |
|
damienv1
2014/10/17 16:20:22
nit: Not sure you should refer to the spec here. D
gunsch
2014/10/17 16:22:52
Done.
|
| + // |buffer->data_size| encrypted bytes. |
| + if (buffer->decrypt_config()->subsamples().empty()) { |
| + std::vector< ::media::SubsampleEntry> encrypted_subsample_list(1); |
| + encrypted_subsample_list[0].clear_bytes = 0; |
| + encrypted_subsample_list[0].cypher_bytes = buffer->data_size(); |
| + ::media::DecryptConfig full_sample_config( |
| + buffer->decrypt_config()->key_id(), |
| + buffer->decrypt_config()->iv(), |
| + encrypted_subsample_list); |
| + DecryptConfigMarshaller::Write(full_sample_config, msg); |
| + } |
| + else |
|
damienv1
2014/10/17 16:20:22
nit: I think you also need curly braces for the "e
gunsch
2014/10/17 16:22:52
Done.
lcwu1
2014/10/17 16:26:26
Also else should be in the same line as the previo
|
| + DecryptConfigMarshaller::Write(*buffer->decrypt_config(), msg); |
| + } |
| CHECK(msg->WritePod(buffer->data_size())); |
| CHECK(msg->WriteBuffer(buffer->data(), buffer->data_size())); |