| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_callback_factory.h" | 12 #include "base/memory/scoped_callback_factory.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ppapi/c/dev/pp_video_dev.h" | 14 #include "ppapi/c/dev/pp_video_dev.h" |
| 15 #include "ppapi/c/pp_var.h" | 15 #include "ppapi/c/pp_var.h" |
| 16 #include "ppapi/thunk/ppb_video_decoder_api.h" | 16 #include "ppapi/thunk/ppb_video_decoder_api.h" |
| 17 #include "webkit/plugins/ppapi/plugin_delegate.h" | 17 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 18 #include "webkit/plugins/ppapi/resource.h" | 18 #include "webkit/plugins/ppapi/resource.h" |
| 19 | 19 |
| 20 struct PP_GLESBuffer_Dev; | 20 struct PP_PictureBuffer_Dev; |
| 21 struct PP_VideoDecoderConfig_Dev; | 21 struct PP_VideoDecoderConfig_Dev; |
| 22 struct PP_VideoBitstreamBuffer_Dev; | 22 struct PP_VideoBitstreamBuffer_Dev; |
| 23 struct PPB_VideoDecoder_Dev; | 23 struct PPB_VideoDecoder_Dev; |
| 24 struct PPP_VideoDecoder_Dev; | 24 struct PPP_VideoDecoder_Dev; |
| 25 | 25 |
| 26 namespace webkit { | 26 namespace webkit { |
| 27 namespace ppapi { | 27 namespace ppapi { |
| 28 | 28 |
| 29 class PluginInstance; | 29 class PluginInstance; |
| 30 | 30 |
| 31 class PPB_VideoDecoder_Impl : public Resource, | 31 class PPB_VideoDecoder_Impl : public Resource, |
| 32 public ::ppapi::thunk::PPB_VideoDecoder_API, | 32 public ::ppapi::thunk::PPB_VideoDecoder_API, |
| 33 public media::VideoDecodeAccelerator::Client { | 33 public media::VideoDecodeAccelerator::Client { |
| 34 public: | 34 public: |
| 35 explicit PPB_VideoDecoder_Impl(PluginInstance* instance); | 35 explicit PPB_VideoDecoder_Impl(PluginInstance* instance); |
| 36 virtual ~PPB_VideoDecoder_Impl(); | 36 virtual ~PPB_VideoDecoder_Impl(); |
| 37 | 37 |
| 38 // ResourceObjectBase overrides. | 38 // ResourceObjectBase overrides. |
| 39 virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; | 39 virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; |
| 40 | 40 |
| 41 // PPB_VideoDecoder implementation. | 41 // PPB_VideoDecoder implementation. |
| 42 virtual int32_t Initialize(PP_Resource context_id, | 42 virtual int32_t Initialize(PP_Resource context_id, |
| 43 const PP_VideoConfigElement* dec_config, | 43 const PP_VideoConfigElement* dec_config, |
| 44 PP_CompletionCallback callback) OVERRIDE; | 44 PP_CompletionCallback callback) OVERRIDE; |
| 45 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 45 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 46 PP_CompletionCallback callback) OVERRIDE; | 46 PP_CompletionCallback callback) OVERRIDE; |
| 47 virtual void AssignGLESBuffers(uint32_t no_of_buffers, | 47 virtual void AssignPictureBuffers( |
| 48 const PP_GLESBuffer_Dev* buffers) OVERRIDE; | 48 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE; |
| 49 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; | 49 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; |
| 50 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; | 50 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; |
| 51 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; | 51 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; |
| 52 virtual void Destroy() OVERRIDE; | 52 virtual void Destroy() OVERRIDE; |
| 53 | 53 |
| 54 // media::VideoDecodeAccelerator::Client implementation. | 54 // media::VideoDecodeAccelerator::Client implementation. |
| 55 virtual void ProvidePictureBuffers( | 55 virtual void ProvidePictureBuffers( |
| 56 uint32 requested_num_of_buffers, | 56 uint32 requested_num_of_buffers, const gfx::Size& dimensions) OVERRIDE; |
| 57 const gfx::Size& dimensions, | |
| 58 media::VideoDecodeAccelerator::MemoryType type) OVERRIDE; | |
| 59 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; | 57 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; |
| 60 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 58 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
| 61 virtual void NotifyInitializeDone() OVERRIDE; | 59 virtual void NotifyInitializeDone() OVERRIDE; |
| 62 virtual void NotifyEndOfStream() OVERRIDE; | 60 virtual void NotifyEndOfStream() OVERRIDE; |
| 63 virtual void NotifyError( | 61 virtual void NotifyError( |
| 64 media::VideoDecodeAccelerator::Error error) OVERRIDE; | 62 media::VideoDecodeAccelerator::Error error) OVERRIDE; |
| 65 virtual void NotifyFlushDone() OVERRIDE; | 63 virtual void NotifyFlushDone() OVERRIDE; |
| 66 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; | 64 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; |
| 67 virtual void NotifyResetDone() OVERRIDE; | 65 virtual void NotifyResetDone() OVERRIDE; |
| 68 | 66 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 90 // Reference to the plugin requesting this interface. | 88 // Reference to the plugin requesting this interface. |
| 91 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 89 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
| 92 | 90 |
| 93 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 91 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
| 94 }; | 92 }; |
| 95 | 93 |
| 96 } // namespace ppapi | 94 } // namespace ppapi |
| 97 } // namespace webkit | 95 } // namespace webkit |
| 98 | 96 |
| 99 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 97 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
| OLD | NEW |