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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 AssignGLESBuffers(uint32_t no_of_buffers, |
48 const PP_GLESBuffer_Dev* buffers) OVERRIDE; | 48 const PP_GLESBuffer_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 int32_t Destroy(PP_CompletionCallback callback) 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, |
57 const gfx::Size& dimensions, | 57 const gfx::Size& dimensions, |
58 media::VideoDecodeAccelerator::MemoryType type) OVERRIDE; | 58 media::VideoDecodeAccelerator::MemoryType type) OVERRIDE; |
59 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; | 59 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; |
60 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | 60 virtual void PictureReady(const media::Picture& picture) OVERRIDE; |
61 virtual void NotifyInitializeDone() OVERRIDE; | 61 virtual void NotifyInitializeDone() OVERRIDE; |
62 virtual void NotifyEndOfStream() OVERRIDE; | 62 virtual void NotifyEndOfStream() OVERRIDE; |
63 virtual void NotifyError( | 63 virtual void NotifyError( |
64 media::VideoDecodeAccelerator::Error error) OVERRIDE; | 64 media::VideoDecodeAccelerator::Error error) OVERRIDE; |
65 virtual void NotifyFlushDone() OVERRIDE; | 65 virtual void NotifyFlushDone() OVERRIDE; |
66 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; | 66 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; |
67 virtual void NotifyResetDone() OVERRIDE; | 67 virtual void NotifyResetDone() OVERRIDE; |
68 virtual void NotifyDestroyDone() OVERRIDE; | |
69 | 68 |
70 private: | 69 private: |
71 // Key: bitstream_buffer_id, value: callback to run when bitstream decode is | 70 // Key: bitstream_buffer_id, value: callback to run when bitstream decode is |
72 // done. | 71 // done. |
73 typedef std::map<int32, PP_CompletionCallback> CallbackById; | 72 typedef std::map<int32, PP_CompletionCallback> CallbackById; |
74 | 73 |
75 // 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 |
76 // swapped with another. | 75 // swapped with another. |
77 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; | 76 scoped_refptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; |
78 | 77 |
79 // Factory to produce our callbacks. | 78 // Factory to produce our callbacks. |
80 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; | 79 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; |
81 | 80 |
82 // The resource ID of the underlying Context3d object being used. Used only | 81 // The resource ID of the underlying Context3d object being used. Used only |
83 // for reference counting to keep it alive for the lifetime of |*this|. | 82 // for reference counting to keep it alive for the lifetime of |*this|. |
84 PP_Resource context3d_id_; | 83 PP_Resource context3d_id_; |
85 | 84 |
86 PP_CompletionCallback initialization_callback_; | 85 PP_CompletionCallback initialization_callback_; |
87 PP_CompletionCallback destroy_callback_; | |
88 PP_CompletionCallback flush_callback_; | 86 PP_CompletionCallback flush_callback_; |
89 PP_CompletionCallback reset_callback_; | 87 PP_CompletionCallback reset_callback_; |
90 CallbackById bitstream_buffer_callbacks_; | 88 CallbackById bitstream_buffer_callbacks_; |
91 | 89 |
92 // Reference to the plugin requesting this interface. | 90 // Reference to the plugin requesting this interface. |
93 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 91 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
94 | 92 |
95 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 93 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
96 }; | 94 }; |
97 | 95 |
98 } // namespace ppapi | 96 } // namespace ppapi |
99 } // namespace webkit | 97 } // namespace webkit |
100 | 98 |
101 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 99 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |