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

Unified Diff: media/base/decryptor.h

Issue 15772012: Separate MediaKeys interface from Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « no previous file | media/base/media_keys.h » ('j') | media/base/media_keys.h » ('J')
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 e3a2cb6cdd7a1d19d1f1ace75ea370ed87de9492..21131cfd26dc260617338bc18da4fc6c031d9bfd 100644
--- a/media/base/decryptor.h
+++ b/media/base/decryptor.h
@@ -6,7 +6,6 @@
#define MEDIA_BASE_DECRYPTOR_H_
#include <list>
-#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
@@ -21,31 +20,14 @@ class DecoderBuffer;
class VideoDecoderConfig;
class VideoFrame;
-// Performs key operations and decrypts (and decodes) encrypted buffer.
+// Decrypts (and decodes) encrypted buffer.
//
-// Key operations (GenerateKeyRequest(), AddKey() and CancelKeyRequest())
-// are called on the renderer thread. Therefore, these calls should be fast
-// and nonblocking; key events should be fired asynchronously.
-// All other methods are called on the (video/audio) decoder thread.
-// Decryptor implementations must be thread safe when methods are called
-// following the above model.
+// All methods are called on the (video/audio) decoder thread. Decryptor
+// implementations must be thread safe when methods are called this way.
// Depending on the implementation callbacks may be fired synchronously or
// asynchronously.
class MEDIA_EXPORT Decryptor {
public:
- // Reported to UMA, so never reuse a value!
- // Must be kept in sync with WebKit::WebMediaPlayerClient::MediaKeyErrorCode
- // (enforced in webmediaplayer_impl.cc).
- enum KeyError {
- kUnknownError = 1,
- kClientError,
- kServiceError,
- kOutputError,
- kHardwareChangeError,
- kDomainError,
- kMaxKeyError // Must be last and greater than any legit value.
- };
-
// TODO(xhwang): Replace kError with kDecryptError and kDecodeError.
ddorwin 2013/05/24 20:39:12 There are a bunch of cleanup TODOs in this file. P
xhwang 2013/05/24 23:15:56 Will do after this CL.
// TODO(xhwang): Replace kNeedMoreData with kNotEnoughData.
enum Status {
@@ -64,31 +46,6 @@ class MEDIA_EXPORT Decryptor {
Decryptor();
virtual ~Decryptor();
- // Generates a key request for the |key_system| with |type| and
- // |init_data| provided.
- // Returns true if generating key request succeeded, false otherwise.
- // Note: AddKey() and CancelKeyRequest() should only be called after
- // GenerateKeyRequest() returns true.
- virtual bool GenerateKeyRequest(const std::string& key_system,
- const std::string& type,
- const uint8* init_data,
- int init_data_length) = 0;
-
- // Adds a |key| to the |key_system|. The |key| is not limited to a decryption
- // key. It can be any data that the key system accepts, such as a license.
- // If multiple calls of this function set different keys for the same
- // key ID, the older key will be replaced by the newer key.
- virtual void AddKey(const std::string& key_system,
- const uint8* key,
- int key_length,
- const uint8* init_data,
- int init_data_length,
- const std::string& session_id) = 0;
-
- // Cancels the key request specified by |session_id|.
- virtual void CancelKeyRequest(const std::string& key_system,
- const std::string& session_id) = 0;
-
// Indicates that a new key has been added to the Decryptor.
ddorwin 2013/05/24 20:39:12 Is "Decryptor" correct?
xhwang 2013/05/24 23:15:56 Done.
typedef base::Callback<void()> NewKeyCB;
@@ -215,28 +172,6 @@ typedef base::Callback<void(Decryptor*)> DecryptorReadyCB;
// fired immediately with NULL.
typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB;
-
-// Key event callbacks. See the spec for details:
-// http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#event-summary
-typedef base::Callback<void(const std::string& key_system,
- const std::string& session_id)> KeyAddedCB;
-
-typedef base::Callback<void(const std::string& key_system,
- const std::string& session_id,
- media::Decryptor::KeyError error_code,
- int system_code)> KeyErrorCB;
-
-typedef base::Callback<void(const std::string& key_system,
- const std::string& session_id,
- const std::string& message,
- const std::string& default_url)> KeyMessageCB;
-
-typedef base::Callback<void(const std::string& key_system,
- const std::string& session_id,
- const std::string& type,
- scoped_ptr<uint8[]> init_data,
- int init_data_size)> NeedKeyCB;
-
} // namespace media
#endif // MEDIA_BASE_DECRYPTOR_H_
« no previous file with comments | « no previous file | media/base/media_keys.h » ('j') | media/base/media_keys.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698