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

Unified Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 1143223007: media: Reland "Simplify {Audio|Video}Decoder initialization callback." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/video_decoder_shim.cc
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc
index ca5e551c8167238ef525e3fa34869a619461903e..b7bd4cec50cd15ce8a0b215b1ae0a55658b6b88a 100644
--- a/content/renderer/pepper/video_decoder_shim.cc
+++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -633,7 +633,7 @@ class VideoDecoderShim::DecoderImpl {
void Stop();
private:
- void OnPipelineStatus(media::PipelineStatus status);
+ void OnInitDone(bool success);
void DoDecode();
void OnDecodeComplete(media::VideoDecoder::Status status);
void OnOutputComplete(const scoped_refptr<media::VideoFrame>& frame);
@@ -692,7 +692,7 @@ void VideoDecoderShim::DecoderImpl::Initialize(
decoder_->Initialize(
config, true /* low_delay */,
- base::Bind(&VideoDecoderShim::DecoderImpl::OnPipelineStatus,
+ base::Bind(&VideoDecoderShim::DecoderImpl::OnInitDone,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&VideoDecoderShim::DecoderImpl::OnOutputComplete,
weak_ptr_factory_.GetWeakPtr()));
@@ -731,20 +731,8 @@ void VideoDecoderShim::DecoderImpl::Stop() {
// This instance is deleted once we exit this scope.
}
-void VideoDecoderShim::DecoderImpl::OnPipelineStatus(
- media::PipelineStatus status) {
- int32_t result;
- switch (status) {
- case media::PIPELINE_OK:
- result = PP_OK;
- break;
- case media::DECODER_ERROR_NOT_SUPPORTED:
- result = PP_ERROR_NOTSUPPORTED;
- break;
- default:
- result = PP_ERROR_FAILED;
- break;
- }
+void VideoDecoderShim::DecoderImpl::OnInitDone(bool success) {
+ int32_t result = success ? PP_OK : PP_ERROR_NOTSUPPORTED;
// Calculate how many textures the shim should create.
uint32_t shim_texture_pool_size = media::limits::kMaxVideoFrames + 1;
« no previous file with comments | « no previous file | media/base/audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698