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

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: reorder methods in the unittest Created 8 years, 2 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 | « webkit/media/crypto/proxy_decryptor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/filter_helpers.cc
diff --git a/webkit/media/filter_helpers.cc b/webkit/media/filter_helpers.cc
index 791aea76b5d534c8fcc9667a28b79c28c0df47ff..d49f7769cf0cbbe6f3ae7efd17a077802a5e16e2 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/filters/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.
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);
}
« no previous file with comments | « webkit/media/crypto/proxy_decryptor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698