| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 namespace ppapi { | 31 namespace ppapi { |
| 32 | 32 |
| 33 class PPB_VideoDecoder_Impl : public ::ppapi::PPB_VideoDecoder_Shared, | 33 class PPB_VideoDecoder_Impl : public ::ppapi::PPB_VideoDecoder_Shared, |
| 34 public media::VideoDecodeAccelerator::Client { | 34 public media::VideoDecodeAccelerator::Client { |
| 35 public: | 35 public: |
| 36 virtual ~PPB_VideoDecoder_Impl(); | 36 virtual ~PPB_VideoDecoder_Impl(); |
| 37 // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & | 37 // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & |
| 38 // initialize. | 38 // initialize. |
| 39 static PP_Resource Create(PP_Instance instance, | 39 static PP_Resource Create(PP_Instance instance, |
| 40 PP_Resource graphics_context, | 40 PP_Resource graphics_context, |
| 41 PP_VideoDecoder_Profile profile); | 41 PP_VideoDecoder_Profile profile, |
| 42 const gfx::Size& frame_size, |
| 43 const std::vector<uint8_t>& extra_data); |
| 42 | 44 |
| 43 // PPB_VideoDecoder_API implementation. | 45 // PPB_VideoDecoder_API implementation. |
| 44 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 46 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 45 PP_CompletionCallback callback) OVERRIDE; | 47 PP_CompletionCallback callback) OVERRIDE; |
| 46 virtual void AssignPictureBuffers( | 48 virtual void AssignPictureBuffers( |
| 47 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE; | 49 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE; |
| 48 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; | 50 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; |
| 49 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; | 51 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; |
| 50 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; | 52 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; |
| 51 virtual void Destroy() OVERRIDE; | 53 virtual void Destroy() OVERRIDE; |
| 52 | 54 |
| 53 // media::VideoDecodeAccelerator::Client implementation. | 55 // media::VideoDecodeAccelerator::Client implementation. |
| 54 virtual void ProvidePictureBuffers( | 56 virtual void ProvidePictureBuffers( |
| 55 uint32 requested_num_of_buffers, const gfx::Size& dimensions) OVERRIDE; | 57 uint32 requested_num_of_buffers, const gfx::Size& dimensions) OVERRIDE; |
| 56 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; | 58 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; |
| 57 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 59 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
| 58 virtual void NotifyInitializeDone() OVERRIDE; | 60 virtual void NotifyInitializeDone() OVERRIDE; |
| 59 virtual void NotifyError( | 61 virtual void NotifyError( |
| 60 media::VideoDecodeAccelerator::Error error) OVERRIDE; | 62 media::VideoDecodeAccelerator::Error error) OVERRIDE; |
| 61 virtual void NotifyFlushDone() OVERRIDE; | 63 virtual void NotifyFlushDone() OVERRIDE; |
| 62 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; | 64 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; |
| 63 virtual void NotifyResetDone() OVERRIDE; | 65 virtual void NotifyResetDone() OVERRIDE; |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 explicit PPB_VideoDecoder_Impl(PP_Instance instance); | 68 explicit PPB_VideoDecoder_Impl(PP_Instance instance); |
| 67 bool Init(PP_Resource graphics_context, | 69 bool Init(PP_Resource graphics_context, |
| 68 PluginDelegate::PlatformContext3D* context, | 70 PluginDelegate::PlatformContext3D* context, |
| 69 gpu::gles2::GLES2Implementation* gles2_impl, | 71 gpu::gles2::GLES2Implementation* gles2_impl, |
| 70 PP_VideoDecoder_Profile profile); | 72 PP_VideoDecoder_Profile profile, |
| 73 const gfx::Size& frame_size, |
| 74 const std::vector<uint8_t>& extra_data); |
| 71 | 75 |
| 72 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is | 76 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is |
| 73 // swapped with another. | 77 // swapped with another. |
| 74 scoped_refptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; | 78 scoped_refptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; |
| 75 | 79 |
| 76 // Reference to the plugin requesting this interface. | 80 // Reference to the plugin requesting this interface. |
| 77 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 81 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
| 78 | 82 |
| 79 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 83 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
| 80 }; | 84 }; |
| 81 | 85 |
| 82 } // namespace ppapi | 86 } // namespace ppapi |
| 83 } // namespace webkit | 87 } // namespace webkit |
| 84 | 88 |
| 85 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 89 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
| OLD | NEW |