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

Unified Diff: webkit/media/filter_helpers.cc

Issue 11198017: Add DecryptingAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « media/media.gyp ('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 d34cf52408cdd97e7af6042f22d78b8a59b9a724..d02f57e29c9306da3158394062ec4688879e1220 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_audio_decoder.h"
#include "media/filters/decrypting_video_decoder.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/dummy_demuxer.h"
@@ -36,6 +37,17 @@ static void AddDefaultDecodersToCollection(
base::Unretained(message_loop_factory),
media::MessageLoopFactory::kDecoder));
+ scoped_refptr<media::DecryptingAudioDecoder> decrypting_audio_decoder =
+ new media::DecryptingAudioDecoder(
+ base::Bind(&media::MessageLoopFactory::GetMessageLoop,
+ base::Unretained(message_loop_factory),
+ media::MessageLoopFactory::kDecoder),
+ base::Bind(&ProxyDecryptor::RequestDecryptorNotification,
+ base::Unretained(proxy_decryptor)));
+
+ filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder);
+ filter_collection->GetAudioDecoders()->push_back(decrypting_audio_decoder);
+
scoped_refptr<media::DecryptingVideoDecoder> decrypting_video_decoder =
new media::DecryptingVideoDecoder(
base::Bind(&media::MessageLoopFactory::GetMessageLoop,
@@ -51,7 +63,12 @@ static void AddDefaultDecodersToCollection(
media::MessageLoopFactory::kDecoder),
proxy_decryptor);
- filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder);
+ // TODO(xhwang): Ideally we should have decrypting video decoder after
+ // regular video decoder since in the real world most videos are not
+ // encrypted. For now FFmpegVideoDecoder can also do decryption
+ // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode)
+ // to FFmpegVideoDecoder. Fix this order when we move decryption out of
+ // FFmpegVideoDecoder.
filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder);
filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder);
}
« no previous file with comments | « media/media.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698