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

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: Fix tool player_x11 Created 7 years, 9 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 | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.h
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index 1056d07dc9a561d3562ef36a7caa647ab98f86cc..8a340ef8bfe5b081a9a760eac7f210f01b347d94 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -22,6 +22,7 @@
#ifndef MEDIA_FILTERS_FFMPEG_DEMUXER_H_
#define MEDIA_FILTERS_FFMPEG_DEMUXER_H_
+#include <string>
#include <vector>
#include "base/callback.h"
@@ -42,6 +43,14 @@ struct AVStream;
namespace media {
+// A new potentially encrypted stream has been parsed.
+// First parameter - The type of initialization data.
+// Second parameter - The initialization data associated with the stream.
+// Third parameter - Number of bytes of the initialization data.
+typedef base::Callback<void(const std::string& type,
+ scoped_array<uint8> init_data,
+ int init_data_size)> FFmpegNeedKeyCB;
+
class FFmpegDemuxer;
class FFmpegGlue;
class FFmpegH264ToAnnexBBitstreamConverter;
@@ -121,13 +130,16 @@ class FFmpegDemuxerStream : public DemuxerStream {
scoped_ptr<FFmpegH264ToAnnexBBitstreamConverter> bitstream_converter_;
bool bitstream_converter_enabled_;
+ std::string encryption_key_id_;
+
DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxerStream);
};
class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
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);
// Demuxer implementation.
virtual void Initialize(DemuxerHost* host,
@@ -140,6 +152,10 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
DemuxerStream::Type type) OVERRIDE;
virtual base::TimeDelta GetStartTime() const OVERRIDE;
+ // Calls |need_key_cb_| with the initialization data encountered in the file.
+ void FireNeedKey(const std::string& init_data_type,
+ const std::string& encryption_key_id);
+
// Allow FFmpegDemuxerStream to notify us when there is updated information
// about capacity and what buffered data is available.
void NotifyCapacityAvailable();
@@ -233,6 +249,8 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
BlockingUrlProtocol url_protocol_;
scoped_ptr<FFmpegGlue> glue_;
+ const FFmpegNeedKeyCB need_key_cb_;
+
DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
};
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698