summaryrefslogtreecommitdiffstats
path: root/media/player
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-10 21:07:27 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-10 21:07:27 +0000
commit1fd4075a6d185ba580373b58a6de5e62c41f6c96 (patch)
treec517902e1b16ac391f7a213bb6c9bdeff9442c7d /media/player
parent4cdbad1fd0f03fc0db25955acacab5e0d9e8f5c4 (diff)
downloadchromium_src-1fd4075a6d185ba580373b58a6de5e62c41f6c96.zip
chromium_src-1fd4075a6d185ba580373b58a6de5e62c41f6c96.tar.gz
chromium_src-1fd4075a6d185ba580373b58a6de5e62c41f6c96.tar.bz2
Implemented injected message loops for PipelineImpl.
For now both the player and WebMediaPlayerImpl create a thread and inject its message loop into the pipeline. The end result is more-or-less the same as what we have today, but we could end up moving the pipeline onto the render thread. BUG=16008 TEST=layout tests, media_unittests should pass Review URL: http://codereview.chromium.org/155338 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/player')
-rw-r--r--media/player/movie.cc8
-rw-r--r--media/player/movie.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/media/player/movie.cc b/media/player/movie.cc
index e37a497..2bb4001 100644
--- a/media/player/movie.cc
+++ b/media/player/movie.cc
@@ -79,7 +79,9 @@ bool Movie::Open(const wchar_t* url, WtlVideoRenderer* video_renderer) {
factories->AddFactory(
new media::InstanceFilterFactory<WtlVideoRenderer>(video_renderer));
- pipeline_.reset(new PipelineImpl());
+ thread_.reset(new base::Thread("PipelineThread"));
+ thread_->Start();
+ pipeline_.reset(new PipelineImpl(thread_->message_loop()));
// Create and start our pipeline.
pipeline_->Start(factories.get(), WideToUTF8(std::wstring(url)), NULL);
@@ -194,8 +196,10 @@ bool Movie::GetOpenMpEnable() {
// Teardown.
void Movie::Close() {
if (pipeline_.get()) {
- pipeline_->Stop();
+ pipeline_->Stop(NULL);
+ thread_->Stop();
pipeline_.reset();
+ thread_.reset();
}
}
diff --git a/media/player/movie.h b/media/player/movie.h
index fdaa2b5..eb23822 100644
--- a/media/player/movie.h
+++ b/media/player/movie.h
@@ -11,6 +11,7 @@
#include "base/scoped_ptr.h"
#include "base/singleton.h"
+#include "base/thread.h"
class WtlVideoRenderer;
@@ -90,6 +91,7 @@ class Movie : public Singleton<Movie> {
virtual ~Movie();
scoped_ptr<PipelineImpl> pipeline_;
+ scoped_ptr<base::Thread> thread_;
bool enable_audio_;
bool enable_swscaler_;