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 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool SetBitstreamBufferCallback( | 50 bool SetBitstreamBufferCallback( |
51 int32 bitstream_buffer_id, PP_CompletionCallback callback); | 51 int32 bitstream_buffer_id, PP_CompletionCallback callback); |
52 | 52 |
53 void RunFlushCallback(int32 result); | 53 void RunFlushCallback(int32 result); |
54 void RunResetCallback(int32 result); | 54 void RunResetCallback(int32 result); |
55 void RunBitstreamBufferCallback(int32 bitstream_buffer_id, int32 result); | 55 void RunBitstreamBufferCallback(int32 bitstream_buffer_id, int32 result); |
56 | 56 |
57 // Tell command buffer to process all commands it has received so far. | 57 // Tell command buffer to process all commands it has received so far. |
58 void FlushCommandBuffer(); | 58 void FlushCommandBuffer(); |
59 | 59 |
60 // Initialize the underlying decoder and return success status. | 60 // Initialize the underlying decoder. |
61 virtual bool Init(PP_Resource context3d_id, | 61 void InitCommon(PP_Resource graphics_context, |
62 thunk::PPB_Context3D_API* context, | 62 gpu::gles2::GLES2Implementation* gles2_impl); |
63 const PP_VideoConfigElement* dec_config); | |
64 | 63 |
65 private: | 64 private: |
66 // 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 |
67 // done. | 66 // done. |
68 typedef std::map<int32, PP_CompletionCallback> CallbackById; | 67 typedef std::map<int32, PP_CompletionCallback> CallbackById; |
69 | 68 |
70 PP_CompletionCallback flush_callback_; | 69 PP_CompletionCallback flush_callback_; |
71 PP_CompletionCallback reset_callback_; | 70 PP_CompletionCallback reset_callback_; |
72 CallbackById bitstream_buffer_callbacks_; | 71 CallbackById bitstream_buffer_callbacks_; |
73 | 72 |
74 // 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 |
75 // 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|. |
76 PP_Resource context3d_id_; | 75 PP_Resource graphics_context_; |
77 | 76 |
78 // Reference to the GLES2Implementation owned by |context3d_id_|. | 77 // Reference to the GLES2Implementation owned by |context3d_id_|. |
79 // 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. |
80 // 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 |
81 // process only, so gles2_impl_ is NULL in that case. | 80 // process only, so gles2_impl_ is NULL in that case. |
82 gpu::gles2::GLES2Implementation* gles2_impl_; | 81 gpu::gles2::GLES2Implementation* gles2_impl_; |
83 | 82 |
84 DISALLOW_COPY_AND_ASSIGN(VideoDecoderImpl); | 83 DISALLOW_COPY_AND_ASSIGN(VideoDecoderImpl); |
85 }; | 84 }; |
86 | 85 |
87 } // namespace ppapi | 86 } // namespace ppapi |
88 | 87 |
89 #endif // PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ | 88 #endif // PPAPI_SHARED_IMPL_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |