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

Side by Side Diff: media/player/movie.cc

Issue 155338: Implemented injected message loops for PipelineImpl. (Closed)
Patch Set: Merged with git-svn Created 11 years, 5 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
« no previous file with comments | « media/player/movie.h ('k') | webkit/glue/webmediaplayer_impl.h » ('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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #ifdef _OPENMP 5 #ifdef _OPENMP
6 #include <omp.h> 6 #include <omp.h>
7 #endif 7 #endif
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 factories->AddFactory(FFmpegVideoDecoder::CreateFactory()); 72 factories->AddFactory(FFmpegVideoDecoder::CreateFactory());
73 73
74 if (enable_audio_) { 74 if (enable_audio_) {
75 factories->AddFactory(AudioRendererImpl::CreateFilterFactory()); 75 factories->AddFactory(AudioRendererImpl::CreateFilterFactory());
76 } else { 76 } else {
77 factories->AddFactory(media::NullAudioRenderer::CreateFilterFactory()); 77 factories->AddFactory(media::NullAudioRenderer::CreateFilterFactory());
78 } 78 }
79 factories->AddFactory( 79 factories->AddFactory(
80 new media::InstanceFilterFactory<WtlVideoRenderer>(video_renderer)); 80 new media::InstanceFilterFactory<WtlVideoRenderer>(video_renderer));
81 81
82 pipeline_.reset(new PipelineImpl()); 82 thread_.reset(new base::Thread("PipelineThread"));
83 thread_->Start();
84 pipeline_.reset(new PipelineImpl(thread_->message_loop()));
83 85
84 // Create and start our pipeline. 86 // Create and start our pipeline.
85 pipeline_->Start(factories.get(), WideToUTF8(std::wstring(url)), NULL); 87 pipeline_->Start(factories.get(), WideToUTF8(std::wstring(url)), NULL);
86 while (true) { 88 while (true) {
87 PlatformThread::Sleep(100); 89 PlatformThread::Sleep(100);
88 if (pipeline_->IsInitialized()) 90 if (pipeline_->IsInitialized())
89 break; 91 break;
90 if (pipeline_->GetError() != media::PIPELINE_OK) 92 if (pipeline_->GetError() != media::PIPELINE_OK)
91 return false; 93 return false;
92 } 94 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 189 }
188 190
189 // Get Enable/Disable OpenMP state. 191 // Get Enable/Disable OpenMP state.
190 bool Movie::GetOpenMpEnable() { 192 bool Movie::GetOpenMpEnable() {
191 return enable_openmp_; 193 return enable_openmp_;
192 } 194 }
193 195
194 // Teardown. 196 // Teardown.
195 void Movie::Close() { 197 void Movie::Close() {
196 if (pipeline_.get()) { 198 if (pipeline_.get()) {
197 pipeline_->Stop(); 199 pipeline_->Stop(NULL);
200 thread_->Stop();
198 pipeline_.reset(); 201 pipeline_.reset();
202 thread_.reset();
199 } 203 }
200 } 204 }
201 205
202 } // namespace media 206 } // namespace media
OLDNEW
« no previous file with comments | « media/player/movie.h ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698