| 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 #ifndef CHROMECAST_MEDIA_CMA_IPC_STREAMER_DECRYPT_CONFIG_MARSHALLER_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_IPC_STREAMER_DECRYPT_CONFIG_MARSHALLER_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_IPC_STREAMER_DECRYPT_CONFIG_MARSHALLER_H_ | 6 #define CHROMECAST_MEDIA_CMA_IPC_STREAMER_DECRYPT_CONFIG_MARSHALLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 class DecryptConfig; | 11 class DecryptConfig; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace chromecast { | 14 namespace chromecast { |
| 15 namespace media { | 15 namespace media { |
| 16 class MediaMessage; | 16 class MediaMessage; |
| 17 | 17 |
| 18 class DecryptConfigMarshaller { | 18 class DecryptConfigMarshaller { |
| 19 public: | 19 public: |
| 20 // Writes the serialized structure of |config| into |msg|. | 20 // Writes the serialized structure of |config| into |msg|. |
| 21 static void Write( | 21 static void Write( |
| 22 const ::media::DecryptConfig& config, MediaMessage* msg); | 22 const ::media::DecryptConfig& config, MediaMessage* msg); |
| 23 | 23 |
| 24 // Writes the serialized structure of |config| into |msg|, assuming one |
| 25 // subsample with |data_size| encrypted bytes. This handles the |
| 26 // "Full Sample Encryption" case in ISO/IEC 23001-7:2012 9.5. |
| 27 static void WriteFullSampleEncryption( |
| 28 const ::media::DecryptConfig& config, int data_size, MediaMessage* msg); |
| 29 |
| 24 // Returns a DecryptConfig from its serialized structure. | 30 // Returns a DecryptConfig from its serialized structure. |
| 25 static scoped_ptr< ::media::DecryptConfig> Read(MediaMessage* msg); | 31 static scoped_ptr< ::media::DecryptConfig> Read(MediaMessage* msg); |
| 26 }; | 32 }; |
| 27 | 33 |
| 28 } // namespace media | 34 } // namespace media |
| 29 } // namespace chromecast | 35 } // namespace chromecast |
| 30 | 36 |
| 31 #endif // CHROMECAST_MEDIA_CMA_IPC_STREAMER_DECRYPT_CONFIG_MARSHALLER_H_ | 37 #endif // CHROMECAST_MEDIA_CMA_IPC_STREAMER_DECRYPT_CONFIG_MARSHALLER_H_ |
| OLD | NEW |