summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 04:33:06 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 04:33:06 +0000
commit4205f0aab39ea675109407d710e251e81e21a594 (patch)
tree5ae72018803fc8025d35aa0d15c68c09a4dfb7ae /media/base
parent509e25c20ca3e44bd9b2078841606e1e2cba56ff (diff)
downloadchromium_src-4205f0aab39ea675109407d710e251e81e21a594.zip
chromium_src-4205f0aab39ea675109407d710e251e81e21a594.tar.gz
chromium_src-4205f0aab39ea675109407d710e251e81e21a594.tar.bz2
Fire needkey event when encrypted media is encounted.
BUG=119843 TEST=Modified media_unittests passes. Also the revised demo page works. Review URL: http://codereview.chromium.org/10223010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/stream_parser.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/media/base/stream_parser.h b/media/base/stream_parser.h
index 2d71573..ef859dc 100644
--- a/media/base/stream_parser.h
+++ b/media/base/stream_parser.h
@@ -9,6 +9,7 @@
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "media/base/media_export.h"
@@ -52,6 +53,13 @@ class MEDIA_EXPORT StreamParser {
// error should be signalled.
typedef base::Callback<bool(const BufferQueue&)> NewBuffersCB;
+ // A new potentially encrypted stream has been parsed.
+ // First parameter - The initialization data associated with the stream.
+ // Second parameter - Number of bytes of the initialization data.
+ // Return value - True indicates that the initialization data is accepted.
+ // False if something was wrong with the initialization data
+ // and a parsing error should be signalled.
+ typedef base::Callback<bool(scoped_array<uint8>, int)> KeyNeededCB;
// Initialize the parser with necessary callbacks. Must be called before any
// data is passed to Parse(). |init_cb| will be called once enough data has
@@ -60,7 +68,8 @@ class MEDIA_EXPORT StreamParser {
virtual void Init(const InitCB& init_cb,
const NewConfigCB& config_cb,
const NewBuffersCB& audio_cb,
- const NewBuffersCB& video_cb) = 0;
+ const NewBuffersCB& video_cb,
+ const KeyNeededCB& key_needed_cb) = 0;
// Called when a seek occurs. This flushes the current parser state
// and puts the parser in a state where it can receive data for the new seek