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

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

Issue 155396: Revert "Implemented injected message loops for PipelineImpl." (Closed)
Patch Set: 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 thread_.reset(new base::Thread("PipelineThread")); 82 pipeline_.reset(new PipelineImpl());
83 thread_->Start();
84 pipeline_.reset(new PipelineImpl(thread_->message_loop()));
85 83
86 // Create and start our pipeline. 84 // Create and start our pipeline.
87 pipeline_->Start(factories.get(), WideToUTF8(std::wstring(url)), NULL); 85 pipeline_->Start(factories.get(), WideToUTF8(std::wstring(url)), NULL);
88 while (true) { 86 while (true) {
89 PlatformThread::Sleep(100); 87 PlatformThread::Sleep(100);
90 if (pipeline_->IsInitialized()) 88 if (pipeline_->IsInitialized())
91 break; 89 break;
92 if (pipeline_->GetError() != media::PIPELINE_OK) 90 if (pipeline_->GetError() != media::PIPELINE_OK)
93 return false; 91 return false;
94 } 92 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 187 }
190 188
191 // Get Enable/Disable OpenMP state. 189 // Get Enable/Disable OpenMP state.
192 bool Movie::GetOpenMpEnable() { 190 bool Movie::GetOpenMpEnable() {
193 return enable_openmp_; 191 return enable_openmp_;
194 } 192 }
195 193
196 // Teardown. 194 // Teardown.
197 void Movie::Close() { 195 void Movie::Close() {
198 if (pipeline_.get()) { 196 if (pipeline_.get()) {
199 pipeline_->Stop(NULL); 197 pipeline_->Stop();
200 thread_->Stop();
201 pipeline_.reset(); 198 pipeline_.reset();
202 thread_.reset();
203 } 199 }
204 } 200 }
205 201
206 } // namespace media 202 } // 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