From 4205f0aab39ea675109407d710e251e81e21a594 Mon Sep 17 00:00:00 2001 From: "xhwang@chromium.org" Date: Thu, 26 Apr 2012 04:33:06 +0000 Subject: 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 --- media/base/stream_parser.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'media/base') 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 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, 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 -- cgit v1.1