| 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_PIPELINE_DECRYPT_UTIL_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_PIPELINE_DECRYPT_UTIL_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_PIPELINE_DECRYPT_UTIL_H_ | 6 #define CHROMECAST_MEDIA_CMA_PIPELINE_DECRYPT_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 | 10 |
| 11 namespace crypto { | |
| 12 class SymmetricKey; | |
| 13 } | |
| 14 | |
| 15 namespace chromecast { | 11 namespace chromecast { |
| 16 namespace media { | 12 namespace media { |
| 17 | 13 |
| 18 class DecoderBufferBase; | 14 class DecoderBufferBase; |
| 19 class DecryptContextImpl; | 15 class DecryptContextImpl; |
| 20 | 16 |
| 21 using BufferDecryptedCB = | 17 using BufferDecryptedCB = |
| 22 base::Callback<void(scoped_refptr<DecoderBufferBase>, bool)>; | 18 base::Callback<void(scoped_refptr<DecoderBufferBase>, bool)>; |
| 23 | 19 |
| 24 // Create a new buffer which corresponds to the clear version of |buffer|. | 20 // Create a new buffer which corresponds to the clear version of |buffer|. |
| 25 // Note: the memory area corresponding to the ES data of the new buffer | 21 // Note: the memory area corresponding to the ES data of the new buffer |
| 26 // is the same as the ES data of |buffer| (for efficiency). | 22 // is the same as the ES data of |buffer| (for efficiency). |
| 27 // After the |buffer_decrypted_cb| is called, |buffer| is left in a inconsistent | 23 // After the |buffer_decrypted_cb| is called, |buffer| is left in a inconsistent |
| 28 // state in the sense it has some decryption info but the ES data is now in | 24 // state in the sense it has some decryption info but the ES data is now in |
| 29 // clear. | 25 // clear. |
| 30 void DecryptDecoderBuffer(scoped_refptr<DecoderBufferBase> buffer, | 26 void DecryptDecoderBuffer(scoped_refptr<DecoderBufferBase> buffer, |
| 31 DecryptContextImpl* decrypt_ctxt, | 27 DecryptContextImpl* decrypt_ctxt, |
| 32 const BufferDecryptedCB& buffer_decrypted_cb); | 28 const BufferDecryptedCB& buffer_decrypted_cb); |
| 33 | 29 |
| 34 } // namespace media | 30 } // namespace media |
| 35 } // namespace chromecast | 31 } // namespace chromecast |
| 36 | 32 |
| 37 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_DECRYPT_UTIL_H_ | 33 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_DECRYPT_UTIL_H_ |
| OLD | NEW |