| Index: media/filters/ffmpeg_demuxer.h
|
| diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
|
| index 6097c6b4f31a665d685efc8175fb1ccb59ba6881..92e296a86d8d6da672da8c1d0717d6a23d613624 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<bool(scoped_array<uint8>, int)> FFmpegNeedKeyCB;
|
| +
|
| class FFmpegDemuxer;
|
| class FFmpegH264ToAnnexBBitstreamConverter;
|
| class ScopedPtrAVFreePacket;
|
| @@ -92,6 +98,8 @@ class FFmpegDemuxerStream : public DemuxerStream {
|
| // Used to determine stream duration when it's not known ahead of time.
|
| base::TimeDelta GetElapsedTime() const;
|
|
|
| + void KeyAdded();
|
| +
|
| protected:
|
| virtual ~FFmpegDemuxerStream();
|
|
|
| @@ -128,6 +136,9 @@ class FFmpegDemuxerStream : public DemuxerStream {
|
|
|
| scoped_ptr<FFmpegH264ToAnnexBBitstreamConverter> bitstream_converter_;
|
|
|
| + bool need_decryption_key_;
|
| + 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 +152,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 +179,9 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
|
| // Provide access to FFmpegDemuxerStream.
|
| scoped_refptr<base::MessageLoopProxy> message_loop();
|
|
|
| + virtual void KeyAdded() OVERRIDE;
|
| + 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();
|
| @@ -192,6 +207,8 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol {
|
| // Carries out disabling the audio stream on the demuxer thread.
|
| void DisableAudioStreamTask();
|
|
|
| + void KeyAddedTask();
|
| +
|
| // Returns true if any of the streams have pending reads. Since we lazily
|
| // post a DemuxTask() for every read, we use this method to quickly terminate
|
| // the tasks if there is no work to do.
|
| @@ -267,6 +284,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);
|
| };
|
|
|
|
|