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

Unified Diff: webkit/media/filter_helpers.cc

Issue 10969028: Add video decoding methods in Decryptor and add DecryptingVideoDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unitttests and resolved comments. Created 8 years, 3 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: webkit/media/filter_helpers.cc
diff --git a/webkit/media/filter_helpers.cc b/webkit/media/filter_helpers.cc
index 791aea76b5d534c8fcc9667a28b79c28c0df47ff..c1773f4d615f6d669ab6350f00c1793f6c1567ed 100644
--- a/webkit/media/filter_helpers.cc
+++ b/webkit/media/filter_helpers.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "media/base/filter_collection.h"
#include "media/base/message_loop_factory.h"
+#include "media/crypto/decrypting_video_decoder.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/dummy_demuxer.h"
#include "media/filters/ffmpeg_audio_decoder.h"
@@ -18,6 +19,12 @@
namespace webkit_media {
// Constructs and adds the default audio/video decoders to |filter_collection|.
+// Note that decoders in the |filter_collection| are ordered. The first
+// audio/video decoder in the |filter_collection| that supports the input
+// audio/video stream will be selected as the audio/video decoder in the media
+// pipeline. This is done by trying to initialize the decoder with the input
+// stream. Some decoder may only accept certain types of streams. For example,
+// DecryptingVideoDecoder only supports encrypted video stream.
ddorwin 2012/09/26 02:34:27 "streams" Probably a bad example since this will c
static void AddDefaultDecodersToCollection(
media::MessageLoopFactory* message_loop_factory,
media::FilterCollection* filter_collection,
@@ -27,12 +34,21 @@ static void AddDefaultDecodersToCollection(
base::Unretained(message_loop_factory),
media::MessageLoopFactory::kDecoder)));
+ scoped_refptr<media::DecryptingVideoDecoder> decrypting_video_decoder =
+ new media::DecryptingVideoDecoder(
+ base::Bind(&media::MessageLoopFactory::GetMessageLoop,
+ base::Unretained(message_loop_factory),
+ media::MessageLoopFactory::kDecoder),
+ decryptor);
+
scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder =
new media::FFmpegVideoDecoder(
base::Bind(&media::MessageLoopFactory::GetMessageLoop,
base::Unretained(message_loop_factory),
media::MessageLoopFactory::kDecoder),
decryptor);
+
+ filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder);
filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder);
}
« webkit/media/crypto/proxy_decryptor.cc ('K') | « webkit/media/crypto/proxy_decryptor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698