| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_BASE_DECRYPTOR_H_ | 5 #ifndef MEDIA_BASE_DECRYPTOR_H_ |
| 6 #define MEDIA_BASE_DECRYPTOR_H_ | 6 #define MEDIA_BASE_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // decrypted and the decrypted buffer is ready to be read. | 74 // decrypted and the decrypted buffer is ready to be read. |
| 75 // If the returned status is kNoKey, no decryption key is available to decrypt | 75 // If the returned status is kNoKey, no decryption key is available to decrypt |
| 76 // |encrypted| buffer. In this case the decrypted buffer must be NULL. | 76 // |encrypted| buffer. In this case the decrypted buffer must be NULL. |
| 77 // If the returned status is kError, unexpected error has occurred. In this | 77 // If the returned status is kError, unexpected error has occurred. In this |
| 78 // case the decrypted buffer must be NULL. | 78 // case the decrypted buffer must be NULL. |
| 79 typedef base::Callback<void(Status, | 79 typedef base::Callback<void(Status, |
| 80 const scoped_refptr<DecoderBuffer>&)> DecryptCB; | 80 const scoped_refptr<DecoderBuffer>&)> DecryptCB; |
| 81 virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted, | 81 virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted, |
| 82 const DecryptCB& decrypt_cb) = 0; | 82 const DecryptCB& decrypt_cb) = 0; |
| 83 | 83 |
| 84 // Stops the decryptor and fires any pending DecryptCB immediately with kError | 84 // Cancel scheduled decryption operations and fires any pending DecryptCB |
| 85 // and NULL buffer. | 85 // immediately with kError and NULL buffer. |
| 86 virtual void Stop() = 0; | 86 virtual void CancelDecrypt() = 0; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 DISALLOW_COPY_AND_ASSIGN(Decryptor); | 89 DISALLOW_COPY_AND_ASSIGN(Decryptor); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace media | 92 } // namespace media |
| 93 | 93 |
| 94 #endif // MEDIA_BASE_DECRYPTOR_H_ | 94 #endif // MEDIA_BASE_DECRYPTOR_H_ |
| OLD | NEW |