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 // - The buffer's keyframe flag is always set to false. The callback handler | |
73 // is responsible for setting this flag true as appropriate. | |
xhwang
2014/11/10 20:14:12
How about: Only |data|, |data_size| and |timestamp
wolenetz
2014/11/11 22:39:41
Done.
| |
72 typedef base::Callback<void(Status, | 74 typedef base::Callback<void(Status, |
73 const scoped_refptr<DecoderBuffer>&)> DecryptCB; | 75 const scoped_refptr<DecoderBuffer>&)> DecryptCB; |
74 | 76 |
75 // Decrypts the |encrypted| buffer. The decrypt status and decrypted buffer | 77 // Decrypts the |encrypted| buffer. The decrypt status and decrypted buffer |
76 // are returned via the provided callback |decrypt_cb|. The |encrypted| buffer | 78 // are returned via the provided callback |decrypt_cb|. The |encrypted| buffer |
77 // must not be NULL. | 79 // must not be NULL. |
78 // Decrypt() should not be called until any previous DecryptCB of the same | 80 // 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 | 81 // |stream_type| has completed. Thus, only one DecryptCB may be pending at |
80 // a time for a given |stream_type|. | 82 // a time for a given |stream_type|. |
81 virtual void Decrypt(StreamType stream_type, | 83 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 | 177 // notification. When the decryptor is ready, notification will be sent |
176 // through the provided callback. | 178 // through the provided callback. |
177 // Calling this callback with a null callback cancels previously registered | 179 // Calling this callback with a null callback cancels previously registered |
178 // decryptor ready notification. Any previously provided callback will be | 180 // decryptor ready notification. Any previously provided callback will be |
179 // fired immediately with NULL. | 181 // fired immediately with NULL. |
180 typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB; | 182 typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB; |
181 | 183 |
182 } // namespace media | 184 } // namespace media |
183 | 185 |
184 #endif // MEDIA_BASE_DECRYPTOR_H_ | 186 #endif // MEDIA_BASE_DECRYPTOR_H_ |
OLD | NEW |