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

Side by Side Diff: media/tools/player_wtl/movie.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 "media/tools/player_wtl/movie.h" 5 #include "media/tools/player_wtl/movie.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "media/audio/audio_manager.h" 10 #include "media/audio/audio_manager.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 scoped_refptr<FileDataSource> data_source = new FileDataSource(); 73 scoped_refptr<FileDataSource> data_source = new FileDataSource();
74 if (data_source->Initialize(url_utf8) != PIPELINE_OK) { 74 if (data_source->Initialize(url_utf8) != PIPELINE_OK) {
75 return false; 75 return false;
76 } 76 }
77 77
78 // Create filter collection. 78 // Create filter collection.
79 scoped_ptr<FilterCollection> collection(new FilterCollection()); 79 scoped_ptr<FilterCollection> collection(new FilterCollection());
80 collection->SetDemuxerFactory(scoped_ptr<DemuxerFactory>( 80 collection->SetDemuxerFactory(scoped_ptr<DemuxerFactory>(
81 new FFmpegDemuxerFactory(data_source, pipeline_loop))); 81 new FFmpegDemuxerFactory(data_source, pipeline_loop)));
82 collection->AddAudioDecoder(new FFmpegAudioDecoder( 82 collection->AddAudioDecoder(new FFmpegAudioDecoder(
83 message_loop_factory_->GetMessageLoop("AudioDecoderThread"))); 83 message_loop_factory_.get(), "AudioDecoderThread"));
84 collection->AddVideoDecoder(new FFmpegVideoDecoder( 84 collection->AddVideoDecoder(new FFmpegVideoDecoder(
85 message_loop_factory_->GetMessageLoop("VideoDecoderThread"))); 85 message_loop_factory_.get(), "VideoDecoderThread"));
86 86
87 // TODO(vrk): Re-enabled audio. (crbug.com/112159) 87 // TODO(vrk): Re-enabled audio. (crbug.com/112159)
88 collection->AddAudioRenderer(new media::NullAudioRenderer()); 88 collection->AddAudioRenderer(new media::NullAudioRenderer());
89 collection->AddVideoRenderer(video_renderer); 89 collection->AddVideoRenderer(video_renderer);
90 90
91 // Create and start our pipeline. 91 // Create and start our pipeline.
92 media::PipelineStatusNotification note; 92 media::PipelineStatusNotification note;
93 pipeline_->Start( 93 pipeline_->Start(
94 collection.Pass(), 94 collection.Pass(),
95 url_utf8, 95 url_utf8,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void Movie::Close() { 182 void Movie::Close() {
183 if (pipeline_) { 183 if (pipeline_) {
184 pipeline_->Stop(media::PipelineStatusCB()); 184 pipeline_->Stop(media::PipelineStatusCB());
185 pipeline_ = NULL; 185 pipeline_ = NULL;
186 } 186 }
187 187
188 message_loop_factory_.reset(); 188 message_loop_factory_.reset();
189 } 189 }
190 190
191 } // namespace media 191 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698