Chromium Code Reviews| Index: content/renderer/pepper/pepper_video_decoder_host.h |
| diff --git a/content/renderer/pepper/pepper_video_decoder_host.h b/content/renderer/pepper/pepper_video_decoder_host.h |
| index bc44fe848dffe9778ae846b106db13647c9c5ca0..608ea5318f96d674b4a2d1e80f9beec4d45620ac 100644 |
| --- a/content/renderer/pepper/pepper_video_decoder_host.h |
| +++ b/content/renderer/pepper/pepper_video_decoder_host.h |
| @@ -10,11 +10,11 @@ |
| #include "base/basictypes.h" |
| #include "base/containers/hash_tables.h" |
| -#include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/scoped_vector.h" |
| #include "content/common/content_export.h" |
| #include "gpu/command_buffer/common/mailbox.h" |
| +#include "media/base/video_decoder.h" |
| #include "media/video/video_decode_accelerator.h" |
| #include "ppapi/c/pp_codecs.h" |
| #include "ppapi/host/host_message_context.h" |
| @@ -25,6 +25,37 @@ namespace base { |
| class SharedMemory; |
| } |
| +namespace gpu { |
| +namespace gles2 { |
| +class GLES2Interface; |
| +} |
| +} |
| + |
| +namespace webkit { |
| +namespace gpu { |
| +class ContextProviderWebContext; |
| +} |
| +} |
| + |
| +namespace content { |
| +class SoftwareDecoder; |
| +} |
| + |
| +namespace base { |
| + |
| +template <class T> |
| +struct DefaultDeleter; |
| + |
| +// Specialize DefaultDeleter so that scoped_ptr<content::SoftwareDecoder> |
| +// always uses "Destroy()" instead of trying to use the destructor. |
| +template <> |
| +struct DefaultDeleter<content::SoftwareDecoder> { |
| + public: |
| + void operator()(void* software_decoder) const; |
| +}; |
|
dmichael (off chromium)
2014/06/03 22:27:46
I think in this case, I think you could just make
|
| + |
| +} // namespace base |
| + |
| namespace content { |
| class PPB_Graphics3D_Impl; |
| @@ -50,6 +81,8 @@ class CONTENT_EXPORT PepperVideoDecoderHost |
| const ppapi::host::ReplyMessageContext reply_context; |
| }; |
| + friend class SoftwareDecoder; |
| + |
| // ResourceHost implementation. |
| virtual int32_t OnResourceMessageReceived( |
| const IPC::Message& msg, |
| @@ -61,10 +94,10 @@ class CONTENT_EXPORT PepperVideoDecoderHost |
| uint32 texture_target) OVERRIDE; |
| virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; |
| virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
| - virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; |
| - virtual void NotifyFlushDone() OVERRIDE; |
| virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE; |
| + virtual void NotifyFlushDone() OVERRIDE; |
| virtual void NotifyResetDone() OVERRIDE; |
| + virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; |
| int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, |
| const ppapi::HostResource& graphics_context, |
| @@ -85,11 +118,17 @@ class CONTENT_EXPORT PepperVideoDecoderHost |
| int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); |
| int32_t OnHostMsgReset(ppapi::host::HostMessageContext* context); |
| + void OnInitializeComplete(int32_t result); |
| + void RequestTextures(uint32 requested_num_of_buffers, |
| + const gfx::Size& dimensions, |
| + uint32 texture_target, |
| + const std::vector<gpu::Mailbox>& mailboxes); |
| + void NotifyError(int32_t pp_error); |
| + |
| // Non-owning pointer. |
| RendererPpapiHost* renderer_ppapi_host_; |
| scoped_ptr<media::VideoDecodeAccelerator> decoder_; |
| - scoped_refptr<PPB_Graphics3D_Impl> graphics3d_; |
|
bbudge
2014/06/03 20:16:07
This isn't necessary, since the resource keeps the
|
| // A vector holding our shm buffers, in sync with a similar vector in the |
| // resource. We use a buffer's index in these vectors as its id on both sides |
| @@ -107,6 +146,10 @@ class CONTENT_EXPORT PepperVideoDecoderHost |
| ppapi::host::ReplyMessageContext flush_reply_context_; |
| ppapi::host::ReplyMessageContext reset_reply_context_; |
| + // These are only used when in software fallback mode. |
| + scoped_ptr<SoftwareDecoder> software_decoder_; |
| + ppapi::host::ReplyMessageContext initialize_reply_context_; |
| + |
| bool initialized_; |
| DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); |