diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-12 01:08:45 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-12 01:08:45 +0000 |
commit | 979a3e154357700ffe18e0e92eab7206e8a9ac1a (patch) | |
tree | 05d8bee91136b303af246fd107c149855003dc4c /content/renderer/media | |
parent | 97e9ccd6a43b365d11972c81aeb3faa0c3aa3503 (diff) | |
download | chromium_src-979a3e154357700ffe18e0e92eab7206e8a9ac1a.zip chromium_src-979a3e154357700ffe18e0e92eab7206e8a9ac1a.tar.gz chromium_src-979a3e154357700ffe18e0e92eab7206e8a9ac1a.tar.bz2 |
Merge PlatformVideoDecoder into PPB_VideoDecoder_Impl
PlatformVideoDecoder is just a simple shell around
media::VideoDecodeAccelerator, dating from when PPB* were in webkit/
It's not needed any more, so just merge it into PPB_VideoDecoder_Impl.
BUG=None
Review URL: https://codereview.chromium.org/235953002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media')
-rw-r--r-- | content/renderer/media/pepper_platform_video_decoder.cc | 121 | ||||
-rw-r--r-- | content/renderer/media/pepper_platform_video_decoder.h | 66 |
2 files changed, 0 insertions, 187 deletions
diff --git a/content/renderer/media/pepper_platform_video_decoder.cc b/content/renderer/media/pepper_platform_video_decoder.cc deleted file mode 100644 index ca1d2f2..0000000 --- a/content/renderer/media/pepper_platform_video_decoder.cc +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/renderer/media/pepper_platform_video_decoder.h" - -#include "base/bind.h" -#include "base/logging.h" -#include "content/child/child_process.h" -#include "content/common/gpu/client/gpu_channel_host.h" -#include "content/renderer/render_thread_impl.h" - -using media::BitstreamBuffer; - -namespace content { - -PlatformVideoDecoder::PlatformVideoDecoder(int32 command_buffer_route_id) - : command_buffer_route_id_(command_buffer_route_id) {} - -PlatformVideoDecoder::~PlatformVideoDecoder() {} - -bool PlatformVideoDecoder::Initialize( - media::VideoCodecProfile profile, - media::VideoDecodeAccelerator::Client* client) { - client_ = client; - - // TODO(vrk): Support multiple decoders. - if (decoder_) - return true; - - RenderThreadImpl* render_thread = RenderThreadImpl::current(); - - // This is not synchronous, but subsequent IPC messages will be buffered, so - // it is okay to immediately send IPC messages through the returned channel. - GpuChannelHost* channel = - render_thread->EstablishGpuChannelSync( - CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); - - if (!channel) - return false; - - // Send IPC message to initialize decoder in GPU process. - decoder_ = channel->CreateVideoDecoder(command_buffer_route_id_); - return (decoder_ && decoder_->Initialize(profile, this)); -} - -void PlatformVideoDecoder::Decode(const BitstreamBuffer& bitstream_buffer) { - DCHECK(decoder_.get()); - decoder_->Decode(bitstream_buffer); -} - -void PlatformVideoDecoder::AssignPictureBuffers( - const std::vector<media::PictureBuffer>& buffers) { - DCHECK(decoder_.get()); - decoder_->AssignPictureBuffers(buffers); -} - -void PlatformVideoDecoder::ReusePictureBuffer(int32 picture_buffer_id) { - DCHECK(decoder_.get()); - decoder_->ReusePictureBuffer(picture_buffer_id); -} - -void PlatformVideoDecoder::Flush() { - DCHECK(decoder_.get()); - decoder_->Flush(); -} - -void PlatformVideoDecoder::Reset() { - DCHECK(decoder_.get()); - decoder_->Reset(); -} - -void PlatformVideoDecoder::Destroy() { - if (decoder_) - decoder_.release()->Destroy(); - client_ = NULL; - delete this; -} - -void PlatformVideoDecoder::NotifyError( - VideoDecodeAccelerator::Error error) { - DCHECK(RenderThreadImpl::current()); - client_->NotifyError(error); -} - -void PlatformVideoDecoder::ProvidePictureBuffers( - uint32 requested_num_of_buffers, - const gfx::Size& dimensions, - uint32 texture_target) { - DCHECK(RenderThreadImpl::current()); - client_->ProvidePictureBuffers(requested_num_of_buffers, dimensions, - texture_target); -} - -void PlatformVideoDecoder::DismissPictureBuffer(int32 picture_buffer_id) { - DCHECK(RenderThreadImpl::current()); - client_->DismissPictureBuffer(picture_buffer_id); -} - -void PlatformVideoDecoder::PictureReady(const media::Picture& picture) { - DCHECK(RenderThreadImpl::current()); - client_->PictureReady(picture); -} - -void PlatformVideoDecoder::NotifyEndOfBitstreamBuffer( - int32 bitstream_buffer_id) { - DCHECK(RenderThreadImpl::current()); - client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); -} - -void PlatformVideoDecoder::NotifyFlushDone() { - DCHECK(RenderThreadImpl::current()); - client_->NotifyFlushDone(); -} - -void PlatformVideoDecoder::NotifyResetDone() { - DCHECK(RenderThreadImpl::current()); - client_->NotifyResetDone(); -} - -} // namespace content diff --git a/content/renderer/media/pepper_platform_video_decoder.h b/content/renderer/media/pepper_platform_video_decoder.h deleted file mode 100644 index 386de8c..0000000 --- a/content/renderer/media/pepper_platform_video_decoder.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_RENDERER_MEDIA_PEPPER_PLATFORM_VIDEO_DECODER_H_ -#define CONTENT_RENDERER_MEDIA_PEPPER_PLATFORM_VIDEO_DECODER_H_ - -#include <vector> - -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "base/message_loop/message_loop.h" -#include "media/video/video_decode_accelerator.h" - -namespace content { - -class PlatformVideoDecoder : public media::VideoDecodeAccelerator, - public media::VideoDecodeAccelerator::Client { - public: - explicit PlatformVideoDecoder(int32 command_buffer_route_id); - virtual ~PlatformVideoDecoder(); - - // PlatformVideoDecoder (a.k.a. VideoDecodeAccelerator) implementation. - virtual bool Initialize(media::VideoCodecProfile profile, - media::VideoDecodeAccelerator::Client* client) - OVERRIDE; - virtual void Decode( - const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; - virtual void AssignPictureBuffers( - const std::vector<media::PictureBuffer>& buffers) OVERRIDE; - virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; - virtual void Flush() OVERRIDE; - virtual void Reset() OVERRIDE; - virtual void Destroy() OVERRIDE; - - // VideoDecodeAccelerator::Client implementation. - virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, - const gfx::Size& dimensions, - uint32 texture_target) OVERRIDE; - virtual void PictureReady(const media::Picture& picture) OVERRIDE; - virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; - virtual void NotifyError( - media::VideoDecodeAccelerator::Error error) OVERRIDE; - virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE; - virtual void NotifyFlushDone() OVERRIDE; - virtual void NotifyResetDone() OVERRIDE; - - private: - // Client lifetime must exceed lifetime of this class. - // TODO(vrk/fischman): We should take another look at the overall - // arcitecture of PPAPI Video Decode to make sure lifetime/ownership makes - // sense, including lifetime of this client. - media::VideoDecodeAccelerator::Client* client_; - - // Route ID for the command buffer associated with video decoder's context. - int32 command_buffer_route_id_; - - // Holds a GpuVideoDecodeAcceleratorHost. - scoped_ptr<media::VideoDecodeAccelerator> decoder_; - - DISALLOW_COPY_AND_ASSIGN(PlatformVideoDecoder); -}; - -} // namespace content - -#endif // CONTENT_RENDERER_MEDIA_PEPPER_PLATFORM_VIDEO_DECODER_H_ |