| 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 <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // | 62 // |
| 63 // First parameter: The status of the decryption operation. | 63 // First parameter: The status of the decryption operation. |
| 64 // - Set to kSuccess if the encrypted buffer is successfully decrypted and | 64 // - Set to kSuccess if the encrypted buffer is successfully decrypted and |
| 65 // the decrypted buffer is ready to be read. | 65 // the decrypted buffer is ready to be read. |
| 66 // - Set to kNoKey if no decryption key is available to decrypt the encrypted | 66 // - Set to kNoKey if no decryption key is available to decrypt the encrypted |
| 67 // buffer. In this case the decrypted buffer must be NULL. | 67 // buffer. In this case the decrypted buffer must be NULL. |
| 68 // - Set to kError if unexpected error has occurred. In this case the | 68 // - Set to kError if unexpected error has occurred. In this case the |
| 69 // decrypted buffer must be NULL. | 69 // decrypted buffer must be NULL. |
| 70 // - This parameter should not be set to kNeedMoreData. | 70 // - This parameter should not be set to kNeedMoreData. |
| 71 // Second parameter: The decrypted buffer. | 71 // Second parameter: The decrypted buffer. |
| 72 // - Only |data|, |data_size| and |timestamp| are set in the returned |
| 73 // DecoderBuffer. The callback handler is responsible for setting other |
| 74 // fields as appropriate. |
| 72 typedef base::Callback<void(Status, | 75 typedef base::Callback<void(Status, |
| 73 const scoped_refptr<DecoderBuffer>&)> DecryptCB; | 76 const scoped_refptr<DecoderBuffer>&)> DecryptCB; |
| 74 | 77 |
| 75 // Decrypts the |encrypted| buffer. The decrypt status and decrypted buffer | 78 // Decrypts the |encrypted| buffer. The decrypt status and decrypted buffer |
| 76 // are returned via the provided callback |decrypt_cb|. The |encrypted| buffer | 79 // are returned via the provided callback |decrypt_cb|. The |encrypted| buffer |
| 77 // must not be NULL. | 80 // must not be NULL. |
| 78 // Decrypt() should not be called until any previous DecryptCB of the same | 81 // Decrypt() should not be called until any previous DecryptCB of the same |
| 79 // |stream_type| has completed. Thus, only one DecryptCB may be pending at | 82 // |stream_type| has completed. Thus, only one DecryptCB may be pending at |
| 80 // a time for a given |stream_type|. | 83 // a time for a given |stream_type|. |
| 81 virtual void Decrypt(StreamType stream_type, | 84 virtual void Decrypt(StreamType stream_type, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // notification. When the decryptor is ready, notification will be sent | 178 // notification. When the decryptor is ready, notification will be sent |
| 176 // through the provided callback. | 179 // through the provided callback. |
| 177 // Calling this callback with a null callback cancels previously registered | 180 // Calling this callback with a null callback cancels previously registered |
| 178 // decryptor ready notification. Any previously provided callback will be | 181 // decryptor ready notification. Any previously provided callback will be |
| 179 // fired immediately with NULL. | 182 // fired immediately with NULL. |
| 180 typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB; | 183 typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB; |
| 181 | 184 |
| 182 } // namespace media | 185 } // namespace media |
| 183 | 186 |
| 184 #endif // MEDIA_BASE_DECRYPTOR_H_ | 187 #endif // MEDIA_BASE_DECRYPTOR_H_ |
| OLD | NEW |