Index: content/renderer/pepper/ppb_video_decoder_impl.cc |
diff --git a/content/renderer/pepper/ppb_video_decoder_impl.cc b/content/renderer/pepper/ppb_video_decoder_impl.cc |
index 05feadc97704cbe387375ab6e562436d7236c86d..bf9e90ff2e8dd39e44c78e8b2315c6b25192e27f 100644 |
--- a/content/renderer/pepper/ppb_video_decoder_impl.cc |
+++ b/content/renderer/pepper/ppb_video_decoder_impl.cc |
@@ -41,10 +41,10 @@ media::VideoCodecProfile PPToMediaProfile( |
const PP_VideoDecoder_Profile pp_profile) { |
switch (pp_profile) { |
case PP_VIDEODECODER_H264PROFILE_NONE: |
- // HACK: PPAPI contains a bogus "none" h264 profile that doesn't |
- // correspond to anything in h.264; but a number of released chromium |
- // versions silently promoted this to Baseline profile, so we retain that |
- // behavior here. Fall through. |
+ // HACK: PPAPI contains a bogus "none" h264 profile that doesn't |
+ // correspond to anything in h.264; but a number of released chromium |
+ // versions silently promoted this to Baseline profile, so we retain that |
+ // behavior here. Fall through. |
case PP_VIDEODECODER_H264PROFILE_BASELINE: |
return media::H264PROFILE_BASELINE; |
case PP_VIDEODECODER_H264PROFILE_MAIN: |
@@ -77,13 +77,13 @@ media::VideoCodecProfile PPToMediaProfile( |
PP_VideoDecodeError_Dev MediaToPPError( |
media::VideoDecodeAccelerator::Error error) { |
switch (error) { |
- case media::VideoDecodeAccelerator::ILLEGAL_STATE : |
+ case media::VideoDecodeAccelerator::ILLEGAL_STATE: |
return PP_VIDEODECODERERROR_ILLEGAL_STATE; |
- case media::VideoDecodeAccelerator::INVALID_ARGUMENT : |
+ case media::VideoDecodeAccelerator::INVALID_ARGUMENT: |
return PP_VIDEODECODERERROR_INVALID_ARGUMENT; |
- case media::VideoDecodeAccelerator::UNREADABLE_INPUT : |
+ case media::VideoDecodeAccelerator::UNREADABLE_INPUT: |
return PP_VIDEODECODERERROR_UNREADABLE_INPUT; |
- case media::VideoDecodeAccelerator::PLATFORM_FAILURE : |
+ case media::VideoDecodeAccelerator::PLATFORM_FAILURE: |
return PP_VIDEODECODERERROR_PLATFORM_FAILURE; |
default: |
NOTREACHED(); |
@@ -96,8 +96,7 @@ PP_VideoDecodeError_Dev MediaToPPError( |
namespace content { |
PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) |
- : PPB_VideoDecoder_Shared(instance), |
- ppp_videodecoder_(NULL) { |
+ : PPB_VideoDecoder_Shared(instance), ppp_videodecoder_(NULL) { |
PluginModule* plugin_module = |
HostGlobals::Get()->GetInstance(pp_instance())->module(); |
if (plugin_module) { |
@@ -106,15 +105,12 @@ PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) |
} |
} |
-PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { |
- Destroy(); |
-} |
+PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { Destroy(); } |
// static |
-PP_Resource PPB_VideoDecoder_Impl::Create( |
- PP_Instance instance, |
- PP_Resource graphics_context, |
- PP_VideoDecoder_Profile profile) { |
+PP_Resource PPB_VideoDecoder_Impl::Create(PP_Instance instance, |
+ PP_Resource graphics_context, |
+ PP_VideoDecoder_Profile profile) { |
EnterResourceNoLock<PPB_Graphics3D_API> enter_context(graphics_context, true); |
if (enter_context.failed()) |
return 0; |
@@ -123,17 +119,18 @@ PP_Resource PPB_VideoDecoder_Impl::Create( |
scoped_refptr<PPB_VideoDecoder_Impl> decoder( |
new PPB_VideoDecoder_Impl(instance)); |
- if (decoder->Init(graphics_context, graphics3d_impl->platform_context(), |
- graphics3d_impl->gles2_impl(), profile)) |
+ if (decoder->Init(graphics_context, |
+ graphics3d_impl->platform_context(), |
+ graphics3d_impl->gles2_impl(), |
+ profile)) |
return decoder->GetReference(); |
return 0; |
} |
-bool PPB_VideoDecoder_Impl::Init( |
- PP_Resource graphics_context, |
- PlatformContext3D* context, |
- gpu::gles2::GLES2Implementation* gles2_impl, |
- PP_VideoDecoder_Profile profile) { |
+bool PPB_VideoDecoder_Impl::Init(PP_Resource graphics_context, |
+ PlatformContext3D* context, |
+ gpu::gles2::GLES2Implementation* gles2_impl, |
+ PP_VideoDecoder_Profile profile) { |
InitCommon(graphics_context, gles2_impl); |
int command_buffer_route_id = context->GetCommandBufferRouteId(); |
@@ -161,10 +158,9 @@ int32_t PPB_VideoDecoder_Impl::Decode( |
PPB_Buffer_Impl* buffer = static_cast<PPB_Buffer_Impl*>(enter.object()); |
DCHECK_GE(bitstream_buffer->id, 0); |
- media::BitstreamBuffer decode_buffer( |
- bitstream_buffer->id, |
- buffer->shared_memory()->handle(), |
- bitstream_buffer->size); |
+ media::BitstreamBuffer decode_buffer(bitstream_buffer->id, |
+ buffer->shared_memory()->handle(), |
+ bitstream_buffer->size); |
if (!SetBitstreamBufferCallback(bitstream_buffer->id, callback)) |
return PP_ERROR_BADARGUMENT; |
@@ -248,8 +244,11 @@ void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
return; |
PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
- ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), pp_resource(), |
- requested_num_of_buffers, &out_dim, texture_target); |
+ ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), |
+ pp_resource(), |
+ requested_num_of_buffers, |
+ &out_dim, |
+ texture_target); |
} |
void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { |
@@ -265,8 +264,8 @@ void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { |
void PPB_VideoDecoder_Impl::DismissPictureBuffer(int32 picture_buffer_id) { |
if (!ppp_videodecoder_) |
return; |
- ppp_videodecoder_->DismissPictureBuffer(pp_instance(), pp_resource(), |
- picture_buffer_id); |
+ ppp_videodecoder_->DismissPictureBuffer( |
+ pp_instance(), pp_resource(), picture_buffer_id); |
} |
void PPB_VideoDecoder_Impl::NotifyError( |
@@ -276,22 +275,18 @@ void PPB_VideoDecoder_Impl::NotifyError( |
PP_VideoDecodeError_Dev pp_error = MediaToPPError(error); |
ppp_videodecoder_->NotifyError(pp_instance(), pp_resource(), pp_error); |
- UMA_HISTOGRAM_ENUMERATION( |
- "Media.PepperVideoDecoderError", error, |
- media::VideoDecodeAccelerator::LARGEST_ERROR_ENUM); |
+ UMA_HISTOGRAM_ENUMERATION("Media.PepperVideoDecoderError", |
+ error, |
+ media::VideoDecodeAccelerator::LARGEST_ERROR_ENUM); |
} |
-void PPB_VideoDecoder_Impl::NotifyResetDone() { |
- RunResetCallback(PP_OK); |
-} |
+void PPB_VideoDecoder_Impl::NotifyResetDone() { RunResetCallback(PP_OK); } |
void PPB_VideoDecoder_Impl::NotifyEndOfBitstreamBuffer( |
int32 bitstream_buffer_id) { |
RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); |
} |
-void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
- RunFlushCallback(PP_OK); |
-} |
+void PPB_VideoDecoder_Impl::NotifyFlushDone() { RunFlushCallback(PP_OK); } |
} // namespace content |