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

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

Issue 9632024: Create video and audio decoder threads on demand. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
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 "media/base/filter_collection.h" 7 #include "media/base/filter_collection.h"
8 #include "media/base/message_loop_factory.h" 8 #include "media/base/message_loop_factory.h"
9 #include "media/filters/chunk_demuxer_factory.h" 9 #include "media/filters/chunk_demuxer_factory.h"
10 #include "media/filters/dummy_demuxer_factory.h" 10 #include "media/filters/dummy_demuxer_factory.h"
11 #include "media/filters/ffmpeg_audio_decoder.h" 11 #include "media/filters/ffmpeg_audio_decoder.h"
12 #include "media/filters/ffmpeg_demuxer_factory.h" 12 #include "media/filters/ffmpeg_demuxer_factory.h"
13 #include "media/filters/ffmpeg_video_decoder.h" 13 #include "media/filters/ffmpeg_video_decoder.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
15 #include "webkit/media/media_stream_client.h" 15 #include "webkit/media/media_stream_client.h"
16 16
17 namespace webkit_media { 17 namespace webkit_media {
18 18
19 // Constructs and adds the default audio/video decoders to |filter_collection|. 19 // Constructs and adds the default audio/video decoders to |filter_collection|.
20 static void AddDefaultDecodersToCollection( 20 static void AddDefaultDecodersToCollection(
21 media::MessageLoopFactory* message_loop_factory, 21 media::MessageLoopFactory* message_loop_factory,
22 media::FilterCollection* filter_collection) { 22 media::FilterCollection* filter_collection) {
23 filter_collection->AddAudioDecoder(new media::FFmpegAudioDecoder( 23 filter_collection->AddAudioDecoder(new media::FFmpegAudioDecoder(
24 message_loop_factory->GetMessageLoop("AudioDecoderThread"))); 24 message_loop_factory, "AudioDecoderThread"));
25 filter_collection->AddVideoDecoder(new media::FFmpegVideoDecoder( 25 filter_collection->AddVideoDecoder(new media::FFmpegVideoDecoder(
26 message_loop_factory->GetMessageLoop("VideoDecoderThread"))); 26 message_loop_factory, "VideoDecoderThread"));
27 } 27 }
28 28
29 bool BuildMediaStreamCollection(const WebKit::WebURL& url, 29 bool BuildMediaStreamCollection(const WebKit::WebURL& url,
30 MediaStreamClient* client, 30 MediaStreamClient* client,
31 media::MessageLoopFactory* message_loop_factory, 31 media::MessageLoopFactory* message_loop_factory,
32 media::FilterCollection* filter_collection) { 32 media::FilterCollection* filter_collection) {
33 if (!client) 33 if (!client)
34 return false; 34 return false;
35 35
36 // Remove any "traditional" decoders (e.g. GpuVideoDecoder) from the 36 // Remove any "traditional" decoders (e.g. GpuVideoDecoder) from the
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 media::FilterCollection* filter_collection) { 81 media::FilterCollection* filter_collection) {
82 scoped_ptr<media::DemuxerFactory> demuxer_factory( 82 scoped_ptr<media::DemuxerFactory> demuxer_factory(
83 new media::FFmpegDemuxerFactory( 83 new media::FFmpegDemuxerFactory(
84 data_source, message_loop_factory->GetMessageLoop("PipelineThread"))); 84 data_source, message_loop_factory->GetMessageLoop("PipelineThread")));
85 filter_collection->SetDemuxerFactory(demuxer_factory.Pass()); 85 filter_collection->SetDemuxerFactory(demuxer_factory.Pass());
86 86
87 AddDefaultDecodersToCollection(message_loop_factory, filter_collection); 87 AddDefaultDecodersToCollection(message_loop_factory, filter_collection);
88 } 88 }
89 89
90 } // webkit_media 90 } // webkit_media
OLDNEW
« media/filters/ffmpeg_audio_decoder.h ('K') | « media/tools/player_x11/player_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698