summaryrefslogtreecommitdiffstats
path: root/media/base/pipeline_impl.cc
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-10 01:03:23 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-10 01:03:23 +0000
commit907bc6fb0e9db6b31eef1d3403b116e43ea7bec9 (patch)
treeeb41d143dab8fca0cb5c55296125160462617833 /media/base/pipeline_impl.cc
parentbb12d853e4af985379bd56ba3025ec0d2b087148 (diff)
downloadchromium_src-907bc6fb0e9db6b31eef1d3403b116e43ea7bec9.zip
chromium_src-907bc6fb0e9db6b31eef1d3403b116e43ea7bec9.tar.gz
chromium_src-907bc6fb0e9db6b31eef1d3403b116e43ea7bec9.tar.bz2
Revert 113895 - <video> decode in hardware!
This uses the GpuVideoDecodeAccelerator machinery (already written to enable ppapi to take advantage of OpenMAX HW where available) to decode <video> data. This increases idle CPU from 20% to 45% on one particularly large (internal) test video (red0.mp4), on an ARM crosbook. HW decode is done on a best-effort basis; if the GPU code doesn't know how to deal with a codec/profile we still fall back to ffmpeg for decode. Because the vast majority of chrome installs will be on HW with no video decode support (yet) we only attempt HW video decode on platforms we know have a shot at it. BUG=104579 TEST=manual testing w/ video test matrix, trybots. Review URL: http://codereview.chromium.org/8686010 TBR=fischman@chromium.org Review URL: http://codereview.chromium.org/8897022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_impl.cc')
-rw-r--r--media/base/pipeline_impl.cc32
1 files changed, 11 insertions, 21 deletions
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index aa5ac3b..d4c1b8e 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -586,10 +586,10 @@ void PipelineImpl::DisableAudioRenderer() {
}
// Called from any thread.
-void PipelineImpl::OnFilterInitialize(PipelineStatus status) {
+void PipelineImpl::OnFilterInitialize() {
// Continue the initialize task by proceeding to the next stage.
- message_loop_->PostTask(
- FROM_HERE, base::Bind(&PipelineImpl::InitializeTask, this, status));
+ message_loop_->PostTask(FROM_HERE,
+ base::Bind(&PipelineImpl::InitializeTask, this));
}
// Called from any thread.
@@ -661,21 +661,9 @@ void PipelineImpl::StartTask(FilterCollection* filter_collection,
// TODO(hclam): InitializeTask() is now starting the pipeline asynchronously. It
// works like a big state change table. If we no longer need to start filters
// in order, we need to get rid of all the state change.
-void PipelineImpl::InitializeTask(PipelineStatus last_stage_status) {
+void PipelineImpl::InitializeTask() {
DCHECK_EQ(MessageLoop::current(), message_loop_);
- if (last_stage_status != PIPELINE_OK) {
- // Currently only VideoDecoders have a recoverable error code.
- if (state_ == kInitVideoDecoder &&
- last_stage_status == DECODER_ERROR_NOT_SUPPORTED) {
- pipeline_init_state_->composite_->RemoveFilter(
- pipeline_init_state_->video_decoder_.get());
- state_ = kInitAudioRenderer;
- } else {
- SetError(last_stage_status);
- }
- }
-
// If we have received the stop or error signal, return immediately.
if (IsPipelineStopPending() || IsPipelineStopped() || !IsPipelineOk())
return;
@@ -1123,8 +1111,10 @@ void PipelineImpl::FinishDestroyingFiltersTask() {
bool PipelineImpl::PrepareFilter(scoped_refptr<Filter> filter) {
bool ret = pipeline_init_state_->composite_->AddFilter(filter.get());
- if (!ret)
+
+ if (!ret) {
SetError(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ }
return ret;
}
@@ -1165,7 +1155,7 @@ void PipelineImpl::OnDemuxerBuilt(PipelineStatus status, Demuxer* demuxer) {
clock_->SetTime(demuxer_->GetStartTime());
}
- OnFilterInitialize(PIPELINE_OK);
+ OnFilterInitialize();
}
bool PipelineImpl::InitializeAudioDecoder(
@@ -1193,7 +1183,7 @@ bool PipelineImpl::InitializeAudioDecoder(
pipeline_init_state_->audio_decoder_ = audio_decoder;
audio_decoder->Initialize(
stream,
- base::Bind(&PipelineImpl::OnFilterInitialize, this, PIPELINE_OK),
+ base::Bind(&PipelineImpl::OnFilterInitialize, this),
base::Bind(&PipelineImpl::OnUpdateStatistics, this));
return true;
}
@@ -1250,7 +1240,7 @@ bool PipelineImpl::InitializeAudioRenderer(
audio_renderer_->Initialize(
decoder,
- base::Bind(&PipelineImpl::OnFilterInitialize, this, PIPELINE_OK),
+ base::Bind(&PipelineImpl::OnFilterInitialize, this),
base::Bind(&PipelineImpl::OnAudioUnderflow, this));
return true;
}
@@ -1274,7 +1264,7 @@ bool PipelineImpl::InitializeVideoRenderer(
video_renderer_->Initialize(
decoder,
- base::Bind(&PipelineImpl::OnFilterInitialize, this, PIPELINE_OK),
+ base::Bind(&PipelineImpl::OnFilterInitialize, this),
base::Bind(&PipelineImpl::OnUpdateStatistics, this));
return true;
}