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 PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ |
6 #define PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 13 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
14 #include "ppapi/shared_impl/resource_object_base.h" | 14 #include "ppapi/shared_impl/resource.h" |
15 #include "ppapi/thunk/ppb_video_decoder_api.h" | 15 #include "ppapi/thunk/ppb_video_decoder_api.h" |
16 | 16 |
17 namespace gpu { | 17 namespace gpu { |
18 namespace gles2 { | 18 namespace gles2 { |
19 class GLES2Implementation; | 19 class GLES2Implementation; |
20 } // namespace gles2 | 20 } // namespace gles2 |
21 } // namespace gpu | 21 } // namespace gpu |
22 | 22 |
23 namespace ppapi { | 23 namespace ppapi { |
24 namespace thunk { | 24 namespace thunk { |
(...skipping 29 matching lines...) Expand all Loading... |
54 void RunBitstreamBufferCallback(int32 bitstream_buffer_id, int32 result); | 54 void RunBitstreamBufferCallback(int32 bitstream_buffer_id, int32 result); |
55 | 55 |
56 // Tell command buffer to process all commands it has received so far. | 56 // Tell command buffer to process all commands it has received so far. |
57 void FlushCommandBuffer(); | 57 void FlushCommandBuffer(); |
58 | 58 |
59 // Initialize the underlying decoder and return success status. | 59 // Initialize the underlying decoder and return success status. |
60 virtual bool Init(PP_Resource context3d_id, | 60 virtual bool Init(PP_Resource context3d_id, |
61 thunk::PPB_Context3D_API* context, | 61 thunk::PPB_Context3D_API* context, |
62 const PP_VideoConfigElement* dec_config); | 62 const PP_VideoConfigElement* dec_config); |
63 | 63 |
64 // TODO(fischman/vrk): Remove accordingly when brettw has merged resource | |
65 // trackers. | |
66 virtual void AddRefResource(PP_Resource resource) = 0; | |
67 virtual void UnrefResource(PP_Resource resource) = 0; | |
68 | |
69 private: | 64 private: |
70 // Key: bitstream_buffer_id, value: callback to run when bitstream decode is | 65 // Key: bitstream_buffer_id, value: callback to run when bitstream decode is |
71 // done. | 66 // done. |
72 typedef std::map<int32, PP_CompletionCallback> CallbackById; | 67 typedef std::map<int32, PP_CompletionCallback> CallbackById; |
73 | 68 |
74 PP_CompletionCallback flush_callback_; | 69 PP_CompletionCallback flush_callback_; |
75 PP_CompletionCallback reset_callback_; | 70 PP_CompletionCallback reset_callback_; |
76 CallbackById bitstream_buffer_callbacks_; | 71 CallbackById bitstream_buffer_callbacks_; |
77 | 72 |
78 // The resource ID of the underlying Context3d object being used. Used only | 73 // The resource ID of the underlying Context3d object being used. Used only |
79 // for reference counting to keep it alive for the lifetime of |*this|. | 74 // for reference counting to keep it alive for the lifetime of |*this|. |
80 PP_Resource context3d_id_; | 75 PP_Resource context3d_id_; |
81 | 76 |
82 // Reference to the GLES2Implementation owned by |context3d_id_|. | 77 // Reference to the GLES2Implementation owned by |context3d_id_|. |
83 // Context3D is guaranteed to be alive for the lifetime of this class. | 78 // Context3D is guaranteed to be alive for the lifetime of this class. |
84 // In the out-of-process case, Context3D's gles2_impl() exists in the plugin | 79 // In the out-of-process case, Context3D's gles2_impl() exists in the plugin |
85 // process only, so gles2_impl_ is NULL in that case. | 80 // process only, so gles2_impl_ is NULL in that case. |
86 gpu::gles2::GLES2Implementation* gles2_impl_; | 81 gpu::gles2::GLES2Implementation* gles2_impl_; |
87 | 82 |
88 DISALLOW_COPY_AND_ASSIGN(VideoDecoderImpl); | 83 DISALLOW_COPY_AND_ASSIGN(VideoDecoderImpl); |
89 }; | 84 }; |
90 | 85 |
91 } // namespace ppapi | 86 } // namespace ppapi |
92 | 87 |
93 #endif // PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ | 88 #endif // PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |