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

Unified Diff: webkit/media/webmediaplayer_proxy.h

Issue 10534096: Generalize AesDecryptor to make it more spec compliant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error on Windows. Created 8 years, 6 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
Index: webkit/media/webmediaplayer_proxy.h
diff --git a/webkit/media/webmediaplayer_proxy.h b/webkit/media/webmediaplayer_proxy.h
index f958f5d7473f971a6f579500be3e224d312fb20a..8018532f3a9f85272c110475f867e85fac89f70f 100644
--- a/webkit/media/webmediaplayer_proxy.h
+++ b/webkit/media/webmediaplayer_proxy.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "media/base/pipeline.h"
+#include "media/crypto/decryptor_client.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/chunk_demuxer_client.h"
#include "media/filters/ffmpeg_video_decoder.h"
@@ -41,7 +42,8 @@ class WebMediaPlayerImpl;
// the render thread that WebMediaPlayerImpl is running on.
class WebMediaPlayerProxy
: public base::RefCountedThreadSafe<WebMediaPlayerProxy>,
- public media::ChunkDemuxerClient {
+ public media::ChunkDemuxerClient,
+ public media::DecryptorClient {
public:
WebMediaPlayerProxy(const scoped_refptr<base::MessageLoopProxy>& render_loop,
WebMediaPlayerImpl* webmediaplayer);
@@ -89,8 +91,8 @@ class WebMediaPlayerProxy
// ChunkDemuxerClient implementation.
virtual void DemuxerOpened(media::ChunkDemuxer* demuxer) OVERRIDE;
virtual void DemuxerClosed() OVERRIDE;
- virtual void KeyNeeded(scoped_array<uint8> init_data,
- int init_data_size) OVERRIDE;
+ virtual void DemuxerNeedKey(scoped_array<uint8> init_data,
+ int init_data_size) OVERRIDE;
// Methods for Demuxer communication.
void DemuxerStartWaitingForSeek();
@@ -105,9 +107,22 @@ class WebMediaPlayerProxy
void DemuxerEndOfStream(media::PipelineStatus status);
void DemuxerShutdown();
- void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer);
- void DemuxerClosedTask();
- void KeyNeededTask(scoped_array<uint8> init_data, int init_data_size);
+ // DecryptorClient implementation.
+ virtual void KeyAdded(const std::string& key_system,
+ const std::string& session_id) OVERRIDE;
+ virtual void KeyError(const std::string& key_system,
+ const std::string& session_id,
+ media::AesDecryptor::KeyError error_code,
+ int system_code) OVERRIDE;
+ virtual void KeyMessage(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> message,
+ int message_length,
+ const std::string& default_url) OVERRIDE;
+ virtual void NeedKey(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> init_data,
+ int init_data_size) OVERRIDE;
private:
friend class base::RefCountedThreadSafe<WebMediaPlayerProxy>;
@@ -132,6 +147,32 @@ class WebMediaPlayerProxy
// Inform |webmediaplayer_| whether the video content is opaque.
void SetOpaqueTask(bool opaque);
+ void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer);
+ void DemuxerClosedTask();
+
+ // Notify |webmediaplayer_| that a key has been added.
+ void KeyAddedTask(const std::string& key_system,
+ const std::string& session_id);
+
+ // Notify |webmediaplayer_| that a key error has occurred.
ddorwin 2012/06/14 21:00:13 nit: remove "has" to be consistent with DecryptorC
xhwang 2012/06/15 01:41:04 Done.
+ void KeyErrorTask(const std::string& key_system,
+ const std::string& session_id,
+ media::AesDecryptor::KeyError error_code,
+ int system_code);
+
+ // Notify |webmediaplayer_| that a key message has been generated.
+ void KeyMessageTask(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> message,
+ int message_length,
+ const std::string& default_url);
+
+ // Notify |webmediaplayer_| that a key is needed for decryption.
+ void NeedKeyTask(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> init_data,
+ int init_data_size);
+
// The render message loop where WebKit lives.
scoped_refptr<base::MessageLoopProxy> render_loop_;
WebMediaPlayerImpl* webmediaplayer_;

Powered by Google App Engine
This is Rietveld 408576698