summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-29 23:36:47 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-29 23:36:47 +0000
commit21f4dfcf190d742c91035a01c381a752f28f7f73 (patch)
tree26acf732ffdeb8d38fa2f79b46a2c2b3a8991600 /media/base
parent6dd643500a204a484397e626443e738a6e668bec (diff)
downloadchromium_src-21f4dfcf190d742c91035a01c381a752f28f7f73.zip
chromium_src-21f4dfcf190d742c91035a01c381a752f28f7f73.tar.gz
chromium_src-21f4dfcf190d742c91035a01c381a752f28f7f73.tar.bz2
Switching decoders to use the injected message loop.
TEST=test should continue to pass, movies stay in sync BUG=none Review URL: http://codereview.chromium.org/146068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/filters.h6
-rw-r--r--media/base/pipeline_impl.cc8
2 files changed, 13 insertions, 1 deletions
diff --git a/media/base/filters.h b/media/base/filters.h
index 7f59138..43f24fd 100644
--- a/media/base/filters.h
+++ b/media/base/filters.h
@@ -174,6 +174,8 @@ class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> {
// Schedules a read. When the |read_callback| is called, the downstream
// filter takes ownership of the buffer by AddRef()'ing the buffer.
+ //
+ // TODO(scherkus): switch Read() callback to scoped_refptr<>.
virtual void Read(Callback1<Buffer*>::Type* read_callback) = 0;
// Given a class that supports the |Interface| and a related static method
@@ -218,6 +220,8 @@ class VideoDecoder : public MediaFilter {
virtual const MediaFormat& media_format() = 0;
// Schedules a read. Decoder takes ownership of the callback.
+ //
+ // TODO(scherkus): switch Read() callback to scoped_refptr<>.
virtual void Read(Callback1<VideoFrame*>::Type* read_callback) = 0;
};
@@ -239,6 +243,8 @@ class AudioDecoder : public MediaFilter {
virtual const MediaFormat& media_format() = 0;
// Schedules a read. Decoder takes ownership of the callback.
+ //
+ // TODO(scherkus): switch Read() callback to scoped_refptr<>.
virtual void Read(Callback1<Buffer*>::Type* read_callbasck) = 0;
};
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 8a43382..5ed70e3 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -23,6 +23,8 @@ template <class Filter>
bool SupportsSetMessageLoop() {
switch (Filter::filter_type()) {
case FILTER_DEMUXER:
+ case FILTER_AUDIO_DECODER:
+ case FILTER_VIDEO_DECODER:
return true;
default:
return false;
@@ -456,7 +458,9 @@ void PipelineThread::StartTask(FilterFactory* filter_factory,
// pipeline's error_ member to PIPELINE_STOPPING. We stop the filters in the
// reverse order.
//
-// TODO(scherkus): beware! this can get posted multiple times! it shouldn't!
+// TODO(scherkus): beware! this can get posted multiple times since we post
+// Stop() tasks even if we've already stopped. Perhaps this should no-op for
+// additional calls, however most of this logic will be changing.
void PipelineThread::StopTask() {
if (PipelineOk()) {
pipeline_->error_ = PIPELINE_STOPPING;
@@ -635,6 +639,8 @@ scoped_refptr<Filter> PipelineThread::CreateFilter(
} else {
// Create a dedicated thread for this filter.
if (SupportsSetMessageLoop<Filter>()) {
+ // TODO(scherkus): figure out a way to name these threads so it matches
+ // the filter type.
scoped_ptr<base::Thread> thread(new base::Thread("FilterThread"));
if (!thread.get() || !thread->Start()) {
NOTREACHED() << "Could not start filter thread";