OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 OMX_PTR priv_data, | 241 OMX_PTR priv_data, |
242 OMX_EVENTTYPE event, | 242 OMX_EVENTTYPE event, |
243 OMX_U32 data1, OMX_U32 data2, | 243 OMX_U32 data1, OMX_U32 data2, |
244 OMX_PTR event_data); | 244 OMX_PTR event_data); |
245 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, | 245 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, |
246 OMX_PTR priv_data, | 246 OMX_PTR priv_data, |
247 OMX_BUFFERHEADERTYPE* buffer); | 247 OMX_BUFFERHEADERTYPE* buffer); |
248 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, | 248 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
249 OMX_PTR priv_data, | 249 OMX_PTR priv_data, |
250 OMX_BUFFERHEADERTYPE* buffer); | 250 OMX_BUFFERHEADERTYPE* buffer); |
| 251 |
| 252 // When we get a texture back via ReusePictureBuffer(), we want to ensure |
| 253 // that its contents have been read out by rendering layer, before we start |
| 254 // overwriting it with the decoder. This class is used to wait for a sync |
| 255 // object inserted into the GPU command stream at the time of |
| 256 // ReusePictureBuffer. This guarantees that the object gets into the stream |
| 257 // after the corresponding texture commands have been inserted into it. Once |
| 258 // the sync object is signalled, we are sure that the stream reached the sync |
| 259 // object, which ensures that all commands related to the texture we are |
| 260 // getting back have been finished as well. |
| 261 class PictureSyncObject; |
| 262 |
| 263 // Check if the client is done reading out from the texture. If yes, queue |
| 264 // it for reuse by the decoder. Otherwise post self as a delayed task |
| 265 // to check later. |
| 266 void CheckPictureStatus(int32 picture_buffer_id, |
| 267 scoped_ptr<PictureSyncObject> egl_sync_obj); |
| 268 |
| 269 // Queue a picture for use by the decoder, either by sending it directly to it |
| 270 // via OMX_FillThisBuffer, or by queueing it for later if we are RESETTING. |
| 271 void QueuePictureBuffer(int32 picture_buffer_id); |
| 272 |
251 }; | 273 }; |
252 | 274 |
253 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 275 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |