Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Unified Diff: content/common/gpu/media/omx_video_decode_accelerator.h

Issue 11076009: OVDA: Perform an egl sync before reusing a texture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: LOG()->DLOG() Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698