Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(902)

Unified Diff: media/base/decryptor.h

Issue 10822026: Implement "Key Presence" step in "Encrypted Block Encounted" algorithm in EME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/mock_filters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decryptor.h
diff --git a/media/base/decryptor.h b/media/base/decryptor.h
index 442c3c66ead98a01dc925df5a49f5a07c423d42e..29c4617d243f815368c718230fbab61957cae720 100644
--- a/media/base/decryptor.h
+++ b/media/base/decryptor.h
@@ -20,7 +20,7 @@ class DecoderBuffer;
// All public methods other than Decrypt() will be called on the renderer
// thread. Therefore, these calls should be fast and nonblocking, with key
// events fired asynchronously. Decrypt() will be called on the (video/audio)
-// decoder thread synchronously.
+// decoder thread.
class MEDIA_EXPORT Decryptor {
public:
enum KeyError {
@@ -34,7 +34,8 @@ class MEDIA_EXPORT Decryptor {
enum DecryptStatus {
kSuccess, // Decryption successfully completed. Decrypted buffer ready.
- kError // Error occurred during decryption.
+ kNoKey, // No key is available to decrypt.
+ kError // Key is available but an error occurred during decryption.
};
Decryptor() {}
@@ -68,6 +69,8 @@ class MEDIA_EXPORT Decryptor {
//
// If the returned status is kSuccess, the |encrypted| buffer is successfully
// decrypted and the decrypted buffer is ready to be read.
+ // If the returned status is kNoKey, no decryption key is available to decrypt
+ // |encrypted| buffer. In this case the decrypted buffer must be NULL.
// If the returned status is kError, unexpected error has occurred. In this
// case the decrypted buffer must be NULL.
typedef base::Callback<void(DecryptStatus,
@@ -75,6 +78,10 @@ class MEDIA_EXPORT Decryptor {
virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted,
const DecryptCB& decrypt_cb) = 0;
+ // Stops the decryptor and fires any pending DecryptCB immediately with kError
+ // and NULL buffer.
+ virtual void Stop() = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(Decryptor);
};
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/mock_filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698