| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 // For output buffer recycling cases. | 167 // For output buffer recycling cases. |
| 168 OutputPictureById pictures_; | 168 OutputPictureById pictures_; |
| 169 | 169 |
| 170 // To kick the component from Loaded to Idle before we know the real size of | 170 // To kick the component from Loaded to Idle before we know the real size of |
| 171 // the video (so can't yet ask for textures) we populate it with fake output | 171 // the video (so can't yet ask for textures) we populate it with fake output |
| 172 // buffers. Keep track of them here. | 172 // buffers. Keep track of them here. |
| 173 // TODO(fischman): do away with this madness. | 173 // TODO(fischman): do away with this madness. |
| 174 std::set<OMX_BUFFERHEADERTYPE*> fake_output_buffers_; | 174 std::set<OMX_BUFFERHEADERTYPE*> fake_output_buffers_; |
| 175 | 175 |
| 176 // Encoded bitstream buffers awaiting decode, queued while the decoder was |
| 177 // Resetting and thus unable to accept them. This will be empty most of the |
| 178 // time, is populated when Decode()'s are received between Reset() is called |
| 179 // and NotifyResetDone() is sent, and is drained right before |
| 180 // NotifyResetDone() is sent. |
| 181 typedef std::vector<media::BitstreamBuffer> BitstreamBufferList; |
| 182 BitstreamBufferList queued_bitstream_buffers_; |
| 183 // Available output picture buffers released during Reset() and awaiting |
| 184 // re-use once Reset is done. Is empty most of the time and drained right |
| 185 // before NotifyResetDone is sent. |
| 186 std::vector<int> queued_picture_buffer_ids_; |
| 187 |
| 176 // To expose client callbacks from VideoDecodeAccelerator. | 188 // To expose client callbacks from VideoDecodeAccelerator. |
| 177 // NOTE: all calls to this object *MUST* be executed in message_loop_. | 189 // NOTE: all calls to this object *MUST* be executed in message_loop_. |
| 178 Client* client_; | 190 Client* client_; |
| 179 | 191 |
| 180 // Method to handle events | 192 // Method to handle events |
| 181 void EventHandlerCompleteTask(OMX_EVENTTYPE event, | 193 void EventHandlerCompleteTask(OMX_EVENTTYPE event, |
| 182 OMX_U32 data1, | 194 OMX_U32 data1, |
| 183 OMX_U32 data2); | 195 OMX_U32 data2); |
| 184 | 196 |
| 185 // Method to receive buffers from component's input port | 197 // Method to receive buffers from component's input port |
| (...skipping 16 matching lines...) Expand all Loading... |
| 202 OMX_PTR event_data); | 214 OMX_PTR event_data); |
| 203 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, | 215 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, |
| 204 OMX_PTR priv_data, | 216 OMX_PTR priv_data, |
| 205 OMX_BUFFERHEADERTYPE* buffer); | 217 OMX_BUFFERHEADERTYPE* buffer); |
| 206 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, | 218 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
| 207 OMX_PTR priv_data, | 219 OMX_PTR priv_data, |
| 208 OMX_BUFFERHEADERTYPE* buffer); | 220 OMX_BUFFERHEADERTYPE* buffer); |
| 209 }; | 221 }; |
| 210 | 222 |
| 211 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 223 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |