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, const gfx::Size& dimensions) OVERRIDE; | 62 uint32 requested_num_of_buffers, const gfx::Size& dimensions) OVERRIDE; |
63 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; | 63 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; |
64 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 64 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
| 65 virtual void NotifyInitializeDone() OVERRIDE; |
65 virtual void NotifyEndOfStream() OVERRIDE; | 66 virtual void NotifyEndOfStream() OVERRIDE; |
66 virtual void NotifyError( | 67 virtual void NotifyError( |
67 media::VideoDecodeAccelerator::Error error) OVERRIDE; | 68 media::VideoDecodeAccelerator::Error error) OVERRIDE; |
68 virtual void NotifyFlushDone() OVERRIDE; | 69 virtual void NotifyFlushDone() OVERRIDE; |
69 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; | 70 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; |
70 virtual void NotifyAbortDone() OVERRIDE; | 71 virtual void NotifyAbortDone() OVERRIDE; |
71 | 72 |
72 private: | 73 private: |
73 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is | 74 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is |
74 // swapped with another. | 75 // swapped with another. |
75 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; | 76 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; |
76 | 77 |
77 // Factory to produce our callbacks. | 78 // Factory to produce our callbacks. |
78 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; | 79 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; |
79 | 80 |
| 81 PP_CompletionCallback initialization_callback_; |
80 PP_CompletionCallback abort_callback_; | 82 PP_CompletionCallback abort_callback_; |
81 PP_CompletionCallback flush_callback_; | 83 PP_CompletionCallback flush_callback_; |
82 PP_CompletionCallback bitstream_buffer_callback_; | 84 PP_CompletionCallback bitstream_buffer_callback_; |
83 | 85 |
84 // Reference to the plugin requesting this interface. | 86 // Reference to the plugin requesting this interface. |
85 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 87 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
86 | 88 |
87 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 89 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
88 }; | 90 }; |
89 | 91 |
90 } // namespace ppapi | 92 } // namespace ppapi |
91 } // namespace webkit | 93 } // namespace webkit |
92 | 94 |
93 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 95 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |