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

Side by Side Diff: webkit/media/filter_helpers.cc

Issue 10834183: Remove WebMediaPlayerProxy::video_decoder_ & FFmpegVideoDecoder::set_decryptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed CR comments Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/filter_helpers.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/media/filter_helpers.h" 5 #include "webkit/media/filter_helpers.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "media/base/filter_collection.h" 8 #include "media/base/filter_collection.h"
9 #include "media/base/message_loop_factory.h" 9 #include "media/base/message_loop_factory.h"
10 #include "media/filters/chunk_demuxer.h" 10 #include "media/filters/chunk_demuxer.h"
11 #include "media/filters/dummy_demuxer.h" 11 #include "media/filters/dummy_demuxer.h"
12 #include "media/filters/ffmpeg_audio_decoder.h" 12 #include "media/filters/ffmpeg_audio_decoder.h"
13 #include "media/filters/ffmpeg_demuxer.h" 13 #include "media/filters/ffmpeg_demuxer.h"
14 #include "media/filters/ffmpeg_video_decoder.h" 14 #include "media/filters/ffmpeg_video_decoder.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
16 #include "webkit/media/media_stream_client.h" 16 #include "webkit/media/media_stream_client.h"
17 17
18 namespace webkit_media { 18 namespace webkit_media {
19 19
20 // Constructs and adds the default audio/video decoders to |filter_collection|. 20 // Constructs and adds the default audio/video decoders to |filter_collection|.
21 static void AddDefaultDecodersToCollection( 21 static void AddDefaultDecodersToCollection(
22 media::MessageLoopFactory* message_loop_factory, 22 media::MessageLoopFactory* message_loop_factory,
23 media::FilterCollection* filter_collection, 23 media::FilterCollection* filter_collection,
24 media::Decryptor* decryptor, 24 media::Decryptor* decryptor) {
25 scoped_refptr<media::FFmpegVideoDecoder>* ffmpeg_video_decoder) {
26 filter_collection->AddAudioDecoder(new media::FFmpegAudioDecoder( 25 filter_collection->AddAudioDecoder(new media::FFmpegAudioDecoder(
27 base::Bind(&media::MessageLoopFactory::GetMessageLoop, 26 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
28 base::Unretained(message_loop_factory), 27 base::Unretained(message_loop_factory),
29 "AudioDecoderThread"))); 28 "AudioDecoderThread")));
30 *ffmpeg_video_decoder = new media::FFmpegVideoDecoder( 29
31 base::Bind(&media::MessageLoopFactory::GetMessageLoop, 30 scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder =
32 base::Unretained(message_loop_factory), 31 new media::FFmpegVideoDecoder(
33 "VideoDecoderThread")); 32 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
34 (*ffmpeg_video_decoder)->set_decryptor(decryptor); 33 base::Unretained(message_loop_factory),
35 filter_collection->AddVideoDecoder(*ffmpeg_video_decoder); 34 "VideoDecoderThread"),
35 decryptor);
36 filter_collection->AddVideoDecoder(ffmpeg_video_decoder);
36 } 37 }
37 38
38 bool BuildMediaStreamCollection(const WebKit::WebURL& url, 39 bool BuildMediaStreamCollection(const WebKit::WebURL& url,
39 MediaStreamClient* client, 40 MediaStreamClient* client,
40 media::MessageLoopFactory* message_loop_factory, 41 media::MessageLoopFactory* message_loop_factory,
41 media::FilterCollection* filter_collection) { 42 media::FilterCollection* filter_collection) {
42 if (!client) 43 if (!client)
43 return false; 44 return false;
44 45
45 scoped_refptr<media::VideoDecoder> video_decoder = client->GetVideoDecoder( 46 scoped_refptr<media::VideoDecoder> video_decoder = client->GetVideoDecoder(
(...skipping 16 matching lines...) Expand all
62 63
63 return true; 64 return true;
64 } 65 }
65 66
66 bool BuildMediaSourceCollection( 67 bool BuildMediaSourceCollection(
67 const WebKit::WebURL& url, 68 const WebKit::WebURL& url,
68 const WebKit::WebURL& media_source_url, 69 const WebKit::WebURL& media_source_url,
69 media::ChunkDemuxerClient* client, 70 media::ChunkDemuxerClient* client,
70 media::MessageLoopFactory* message_loop_factory, 71 media::MessageLoopFactory* message_loop_factory,
71 media::FilterCollection* filter_collection, 72 media::FilterCollection* filter_collection,
72 media::Decryptor* decryptor, 73 media::Decryptor* decryptor) {
73 scoped_refptr<media::FFmpegVideoDecoder>* video_decoder) {
74 if (media_source_url.isEmpty() || url != media_source_url) 74 if (media_source_url.isEmpty() || url != media_source_url)
75 return false; 75 return false;
76 76
77 filter_collection->SetDemuxer(new media::ChunkDemuxer(client)); 77 filter_collection->SetDemuxer(new media::ChunkDemuxer(client));
78 78
79 AddDefaultDecodersToCollection(message_loop_factory, filter_collection, 79 AddDefaultDecodersToCollection(message_loop_factory, filter_collection,
80 decryptor, video_decoder); 80 decryptor);
81 return true; 81 return true;
82 } 82 }
83 83
84 void BuildDefaultCollection( 84 void BuildDefaultCollection(
85 const scoped_refptr<media::DataSource>& data_source, 85 const scoped_refptr<media::DataSource>& data_source,
86 media::MessageLoopFactory* message_loop_factory, 86 media::MessageLoopFactory* message_loop_factory,
87 media::FilterCollection* filter_collection, 87 media::FilterCollection* filter_collection,
88 media::Decryptor* decryptor, 88 media::Decryptor* decryptor) {
89 scoped_refptr<media::FFmpegVideoDecoder>* video_decoder) {
90 filter_collection->SetDemuxer(new media::FFmpegDemuxer( 89 filter_collection->SetDemuxer(new media::FFmpegDemuxer(
91 message_loop_factory->GetMessageLoop("PipelineThread"), 90 message_loop_factory->GetMessageLoop("PipelineThread"),
92 data_source)); 91 data_source));
93 92
94 AddDefaultDecodersToCollection(message_loop_factory, filter_collection, 93 AddDefaultDecodersToCollection(message_loop_factory, filter_collection,
95 decryptor, video_decoder); 94 decryptor);
96 } 95 }
97 96
98 } // webkit_media 97 } // webkit_media
OLDNEW
« no previous file with comments | « webkit/media/filter_helpers.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698