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 CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // To kick the component from Loaded to Idle before we know the real size of | 128 // To kick the component from Loaded to Idle before we know the real size of |
129 // the video (so can't yet ask for textures) we populate it with fake output | 129 // the video (so can't yet ask for textures) we populate it with fake output |
130 // buffers. Keep track of them here. | 130 // buffers. Keep track of them here. |
131 // TODO(fischman): do away with this madness. | 131 // TODO(fischman): do away with this madness. |
132 std::set<OMX_BUFFERHEADERTYPE*> fake_output_buffers_; | 132 std::set<OMX_BUFFERHEADERTYPE*> fake_output_buffers_; |
133 | 133 |
134 // To expose client callbacks from VideoDecodeAccelerator. | 134 // To expose client callbacks from VideoDecodeAccelerator. |
135 // NOTE: all calls to this object *MUST* be executed in message_loop_. | 135 // NOTE: all calls to this object *MUST* be executed in message_loop_. |
136 Client* client_; | 136 Client* client_; |
137 | 137 |
138 std::vector<uint32> texture_ids_; | 138 // Keep the egl-image handles so that we can destroy them in the end. |
139 std::vector<uint32> context_ids_; | 139 std::vector<void*> egl_images_; |
| 140 |
140 // Method to handle events | 141 // Method to handle events |
141 void EventHandlerCompleteTask(OMX_EVENTTYPE event, | 142 void EventHandlerCompleteTask(OMX_EVENTTYPE event, |
142 OMX_U32 data1, | 143 OMX_U32 data1, |
143 OMX_U32 data2); | 144 OMX_U32 data2); |
144 | 145 |
145 // Method to receive buffers from component's input port | 146 // Method to receive buffers from component's input port |
146 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); | 147 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); |
147 | 148 |
148 // Method to receive buffers from component's output port | 149 // Method to receive buffers from component's output port |
149 void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); | 150 void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); |
(...skipping 18 matching lines...) Expand all Loading... |
168 OMX_PTR event_data); | 169 OMX_PTR event_data); |
169 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, | 170 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, |
170 OMX_PTR priv_data, | 171 OMX_PTR priv_data, |
171 OMX_BUFFERHEADERTYPE* buffer); | 172 OMX_BUFFERHEADERTYPE* buffer); |
172 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, | 173 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
173 OMX_PTR priv_data, | 174 OMX_PTR priv_data, |
174 OMX_BUFFERHEADERTYPE* buffer); | 175 OMX_BUFFERHEADERTYPE* buffer); |
175 }; | 176 }; |
176 | 177 |
177 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 178 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |