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

Unified Diff: media/filters/ffmpeg_demuxer.h

Issue 10829470: Support for parsing encrypted WebM streams by src. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed bug with playing latest encrypted WebM. Addressing comments. 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
Index: media/filters/ffmpeg_demuxer.h
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index 6097c6b4f31a665d685efc8175fb1ccb59ba6881..76e5f7d67ec990d58ab6600e90292580422003ba 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -23,6 +23,7 @@
#define MEDIA_FILTERS_FFMPEG_DEMUXER_H_
#include <deque>
+#include <string>
#include <vector>
#include "base/callback.h"
@@ -43,6 +44,11 @@ struct AVStream;
namespace media {
+// 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.
+typedef base::Callback<void(scoped_array<uint8>, int)> FFmpegNeedKeyCB;
xhwang 2012/08/29 05:08:14 Move this typedef into FFmpegDemuxer and rename it
ddorwin 2012/09/01 16:46:41 We're going to eliminate this and replace it with
fgalligan1 2013/03/09 01:10:59 What should I do with this at this point?
+
class FFmpegDemuxer;
class FFmpegH264ToAnnexBBitstreamConverter;
class ScopedPtrAVFreePacket;
@@ -128,6 +134,8 @@ class FFmpegDemuxerStream : public DemuxerStream {
scoped_ptr<FFmpegH264ToAnnexBBitstreamConverter> bitstream_converter_;
+ std::string current_key_id_;
+
// Used to synchronize access to |buffer_queue_|, |read_queue_|, and
// |stopped_|. This is so other threads can get access to buffers that have
// already been demuxed without having the demuxer thread sending the
@@ -141,7 +149,8 @@ class FFmpegDemuxerStream : public DemuxerStream {
class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
public:
FFmpegDemuxer(const scoped_refptr<base::MessageLoopProxy>& message_loop,
- const scoped_refptr<DataSource>& data_source);
+ const scoped_refptr<DataSource>& data_source,
+ const FFmpegNeedKeyCB& need_key_cb);
// Posts a task to perform additional demuxing.
virtual void PostDemuxTask();
@@ -167,6 +176,8 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
// Provide access to FFmpegDemuxerStream.
scoped_refptr<base::MessageLoopProxy> message_loop();
+ void NeedKey(const std::string& key_id);
+
// Allow FFmpegDemuxerStream to notify us when there is updated information
// about what buffered data is available.
void NotifyBufferingChanged();
@@ -267,6 +278,8 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
// stream -- at this moment we definitely know duration.
bool duration_known_;
+ const FFmpegNeedKeyCB need_key_cb_;
+
DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
};

Powered by Google App Engine
This is Rietveld 408576698