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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 public ::ppapi::VideoDecoderImpl, | 46 public ::ppapi::VideoDecoderImpl, |
47 public media::VideoDecodeAccelerator::Client { | 47 public media::VideoDecodeAccelerator::Client { |
48 public: | 48 public: |
49 virtual ~PPB_VideoDecoder_Impl(); | 49 virtual ~PPB_VideoDecoder_Impl(); |
50 // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & | 50 // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & |
51 // initialize. | 51 // initialize. |
52 static PP_Resource Create(PluginInstance* instance, | 52 static PP_Resource Create(PluginInstance* instance, |
53 PP_Resource context3d_id, | 53 PP_Resource context3d_id, |
54 const PP_VideoConfigElement* config); | 54 const PP_VideoConfigElement* config); |
55 | 55 |
56 // ResourceObjectBase overrides. | 56 // Resource overrides. |
57 virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; | 57 virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; |
58 | 58 |
59 // PPB_VideoDecoder_API implementation. | 59 // PPB_VideoDecoder_API implementation. |
60 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 60 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
61 PP_CompletionCallback callback) OVERRIDE; | 61 PP_CompletionCallback callback) OVERRIDE; |
62 virtual void AssignPictureBuffers( | 62 virtual void AssignPictureBuffers( |
63 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE; | 63 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE; |
64 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; | 64 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; |
65 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; | 65 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; |
66 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; | 66 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
77 media::VideoDecodeAccelerator::Error error) OVERRIDE; | 77 media::VideoDecodeAccelerator::Error error) OVERRIDE; |
78 virtual void NotifyFlushDone() OVERRIDE; | 78 virtual void NotifyFlushDone() OVERRIDE; |
79 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; | 79 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) OVERRIDE; |
80 virtual void NotifyResetDone() OVERRIDE; | 80 virtual void NotifyResetDone() OVERRIDE; |
81 | 81 |
82 protected: | 82 protected: |
83 // VideoDecoderImpl implementation. | 83 // VideoDecoderImpl implementation. |
84 virtual bool Init(PP_Resource context3d_id, | 84 virtual bool Init(PP_Resource context3d_id, |
85 ::ppapi::thunk::PPB_Context3D_API* context, | 85 ::ppapi::thunk::PPB_Context3D_API* context, |
86 const PP_VideoConfigElement* dec_config) OVERRIDE; | 86 const PP_VideoConfigElement* dec_config) OVERRIDE; |
87 virtual void AddRefResource(PP_Resource resource) OVERRIDE; | |
88 virtual void UnrefResource(PP_Resource resource) OVERRIDE; | |
89 | 87 |
90 private: | 88 private: |
91 explicit PPB_VideoDecoder_Impl(PluginInstance* instance); | 89 explicit PPB_VideoDecoder_Impl(PluginInstance* instance); |
92 | 90 |
93 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is | 91 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is |
94 // swapped with another. | 92 // swapped with another. |
95 scoped_refptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; | 93 scoped_refptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; |
96 | 94 |
97 // Reference to the plugin requesting this interface. | 95 // Reference to the plugin requesting this interface. |
98 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 96 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
99 | 97 |
100 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 98 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
101 }; | 99 }; |
102 | 100 |
103 } // namespace ppapi | 101 } // namespace ppapi |
104 } // namespace webkit | 102 } // namespace webkit |
105 | 103 |
106 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ | 104 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |