Chromium Code Reviews| Index: content/common/gpu/media/omx_video_decode_accelerator.h |
| diff --git a/content/common/gpu/media/omx_video_decode_accelerator.h b/content/common/gpu/media/omx_video_decode_accelerator.h |
| index 761ff105a5a59ebe56561cb8b5323b2c98554852..9d5d5915866d69638b0dd12750f0c14fee851b2d 100644 |
| --- a/content/common/gpu/media/omx_video_decode_accelerator.h |
| +++ b/content/common/gpu/media/omx_video_decode_accelerator.h |
| @@ -16,6 +16,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/logging.h" |
| #include "base/message_loop.h" |
| +#include "base/threading/thread.h" |
|
piman
2012/10/06 06:42:40
nit: alpha order
|
| #include "base/shared_memory.h" |
| #include "content/common/content_export.h" |
| #include "media/video/video_decode_accelerator.h" |
| @@ -248,6 +249,25 @@ class CONTENT_EXPORT OmxVideoDecodeAccelerator : |
| static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
| OMX_PTR priv_data, |
| OMX_BUFFERHEADERTYPE* buffer); |
| + |
| + // When we get a texture back via ReusePictureBuffer(), we want to ensure |
| + // that its contents have been read out by rendering layer, before we start |
| + // overwriting it with the decoder. This thread is used to wait for a sync |
| + // object inserted into the command stream at the time of |
| + // ReusePictureBuffer. This guarantees that the object is in the stream after |
| + // the corresponding texture commands have been inserted into it. Once the |
| + // sync object is signalled, we are sure that the stream reached the sync |
| + // object, which ensures that all commands related to the texture we are |
| + // getting back have been finished as well. |
| + base::Thread sync_thread_; |
| + |
| + // Run on the sync_thread_. Wait on the given sync object and post a task |
| + // back onto the main thread to queue the texture for reuse. |
| + void WaitForPictureSync(int32 picture_buffer_id, EGLSyncKHR egl_sync_obj); |
| + |
| + // Posted onto the main thread by WaitForPictureSync to queue the texture |
| + // back for reuse. |
| + void QueuePictureBuffer(int32 picture_buffer_id); |
| }; |
| #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |