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

Unified Diff: media/tools/player_wtl/movie.cc

Issue 6171009: Remove MessageLoop methods from Filter interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied more CR suggestions & removed message_loop() methods where possible. Created 9 years, 11 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/tools/player_wtl/movie.h ('k') | media/tools/player_wtl/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/player_wtl/movie.cc
diff --git a/media/tools/player_wtl/movie.cc b/media/tools/player_wtl/movie.cc
index 2efd7150f4184e952a833814094196e42caeed28..fe734906c18ab75b45efe73bb34d82a14154a3eb 100644
--- a/media/tools/player_wtl/movie.cc
+++ b/media/tools/player_wtl/movie.cc
@@ -8,6 +8,7 @@
#include "base/threading/platform_thread.h"
#include "base/utf_string_conversions.h"
#include "media/base/filter_collection.h"
+#include "media/base/message_loop_factory_impl.h"
#include "media/base/pipeline_impl.h"
#include "media/filters/audio_renderer_impl.h"
#include "media/filters/ffmpeg_audio_decoder.h"
@@ -60,12 +61,17 @@ bool Movie::Open(const wchar_t* url, WtlVideoRenderer* video_renderer) {
Close();
}
+ message_loop_factory_.reset(new media::MessageLoopFactoryImpl());
+
// Create filter collection.
scoped_ptr<FilterCollection> collection(new FilterCollection());
collection->AddDataSource(new FileDataSource());
- collection->AddAudioDecoder(new FFmpegAudioDecoder());
- collection->AddDemuxer(new FFmpegDemuxer());
- collection->AddVideoDecoder(new FFmpegVideoDecoder(NULL));
+ collection->AddAudioDecoder(new FFmpegAudioDecoder(
+ message_loop_factory_->GetMessageLoop("AudioDecoderThread")));
+ collection->AddDemuxer(new FFmpegDemuxer(
+ message_loop_factory_->GetMessageLoop("DemuxThread")));
+ collection->AddVideoDecoder(new FFmpegVideoDecoder(
+ message_loop_factory_->GetMessageLoop("VideoDecoderThread"), NULL));
if (enable_audio_) {
collection->AddAudioRenderer(new AudioRendererImpl());
@@ -74,9 +80,8 @@ bool Movie::Open(const wchar_t* url, WtlVideoRenderer* video_renderer) {
}
collection->AddVideoRenderer(video_renderer);
- thread_.reset(new base::Thread("PipelineThread"));
- thread_->Start();
- pipeline_ = new PipelineImpl(thread_->message_loop());
+ pipeline_ = new PipelineImpl(
+ message_loop_factory_->GetMessageLoop("PipelineThread"));
// Create and start our pipeline.
pipeline_->Start(collection.release(), WideToUTF8(std::wstring(url)), NULL);
@@ -168,10 +173,10 @@ bool Movie::GetDumpYuvFileEnable() {
void Movie::Close() {
if (pipeline_) {
pipeline_->Stop(NULL);
- thread_->Stop();
pipeline_ = NULL;
- thread_.reset();
}
+
+ message_loop_factory_.reset();
}
} // namespace media
« no previous file with comments | « media/tools/player_wtl/movie.h ('k') | media/tools/player_wtl/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698