| 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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 static const PPB_VideoDecoder_Dev* GetInterface(); | 39 static const PPB_VideoDecoder_Dev* GetInterface(); |
| 40 | 40 |
| 41 // Resource overrides. | 41 // Resource overrides. |
| 42 virtual PPB_VideoDecoder_Impl* AsPPB_VideoDecoder_Impl(); | 42 virtual PPB_VideoDecoder_Impl* AsPPB_VideoDecoder_Impl(); |
| 43 | 43 |
| 44 // PPB_VideoDecoder implementation. | 44 // PPB_VideoDecoder implementation. |
| 45 bool GetConfigs(PP_VideoConfigElement* requested_configs, | 45 bool GetConfigs(PP_VideoConfigElement* requested_configs, |
| 46 PP_VideoConfigElement* matching_configs, | 46 PP_VideoConfigElement* matching_configs, |
| 47 uint32_t matching_configs_size, | 47 uint32_t matching_configs_size, |
| 48 uint32_t* num_of_matching_configs); | 48 uint32_t* num_of_matching_configs); |
| 49 bool Init(PP_VideoConfigElement* dec_config); | 49 bool Init(PP_VideoConfigElement* dec_config, PP_CompletionCallback callback); |
| 50 bool Decode(PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 50 bool Decode(PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 51 PP_CompletionCallback callback); | 51 PP_CompletionCallback callback); |
| 52 void AssignGLESBuffers(uint32_t no_of_buffers, | 52 void AssignGLESBuffers(uint32_t no_of_buffers, |
| 53 PP_GLESBuffer_Dev* buffers); | 53 PP_GLESBuffer_Dev* buffers); |
| 54 void AssignSysmemBuffers(uint32_t no_of_buffers, | 54 void AssignSysmemBuffers(uint32_t no_of_buffers, |
| 55 PP_SysmemBuffer_Dev* buffers); | 55 PP_SysmemBuffer_Dev* buffers); |
| 56 void ReusePictureBuffer(int32_t picture_buffer_id); | 56 void ReusePictureBuffer(int32_t picture_buffer_id); |
| 57 bool Flush(PP_CompletionCallback callback); | 57 bool Flush(PP_CompletionCallback callback); |
| 58 bool Abort(PP_CompletionCallback callback); | 58 bool Abort(PP_CompletionCallback callback); |
| 59 | 59 |
| 60 // media::VideoDecodeAccelerator::Client implementation. | 60 // media::VideoDecodeAccelerator::Client implementation. |
| 61 virtual void ProvidePictureBuffers( | 61 virtual void ProvidePictureBuffers( |
| 62 uint32 requested_num_of_buffers, | 62 uint32 requested_num_of_buffers, |
| 63 const gfx::Size& dimensions, | 63 const gfx::Size& dimensions, |
| 64 media::VideoDecodeAccelerator::MemoryType type) OVERRIDE; | 64 media::VideoDecodeAccelerator::MemoryType type) OVERRIDE; |
| 65 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; | 65 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; |
| 66 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 66 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
| 67 virtual void NotifyInitializeDone() OVERRIDE; |
| 67 virtual void NotifyEndOfStream() OVERRIDE; | 68 virtual void NotifyEndOfStream() OVERRIDE; |
| 68 virtual void NotifyError( | 69 virtual void NotifyError( |
| 69 media::VideoDecodeAccelerator::Error error) OVERRIDE; | 70 media::VideoDecodeAccelerator::Error error) OVERRIDE; |
| 70 virtual void NotifyFlushDone() OVERRIDE; | 71 virtual void NotifyFlushDone() OVERRIDE; |
| 71 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; | 72 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; |
| 72 virtual void NotifyAbortDone() OVERRIDE; | 73 virtual void NotifyAbortDone() OVERRIDE; |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 // 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 |
| 76 // swapped with another. | 77 // swapped with another. |
| 77 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; | 78 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; |
| 78 | 79 |
| 79 // Factory to produce our callbacks. | 80 // Factory to produce our callbacks. |
| 80 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; | 81 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; |
| 81 | 82 |
| 83 PP_CompletionCallback initialization_callback_; |
| 82 PP_CompletionCallback abort_callback_; | 84 PP_CompletionCallback abort_callback_; |
| 83 PP_CompletionCallback flush_callback_; | 85 PP_CompletionCallback flush_callback_; |
| 84 PP_CompletionCallback bitstream_buffer_callback_; | 86 PP_CompletionCallback bitstream_buffer_callback_; |
| 85 | 87 |
| 86 // Reference to the plugin requesting this interface. | 88 // Reference to the plugin requesting this interface. |
| 87 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 89 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 91 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 } // namespace ppapi | 94 } // namespace ppapi |
| 93 } // namespace webkit | 95 } // namespace webkit |
| 94 | 96 |
| 95 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 97 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
| OLD | NEW |