diff options
author | Mansoor Chishtie <mchishtie@blackberry.com> | 2014-05-27 19:35:12 -0500 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-02 20:49:50 +0200 |
commit | 5e5a99fa374d4b83e548ada8c76fa191a27e4b51 (patch) | |
tree | 9ed2144ddc001fbbb7ca1964772b78bae015a61e /src/core/chromium_gpu_helper.cpp | |
parent | 65bf1a1334acce38983896241d3b211e1fa4659a (diff) |
Support EGLStream video streaming on QNX platform
On QNX platform, we implement video streaming via OpenGL
EGLStream streams. Changes were added to StreamVideo class
to support EGLStream objects. For non-QNX platforms, we
kept the StreamVideoNode class unchanged - assuming other
platforms will continue to support streaming via EGLImage
objects.
On QNX, cc::StreamVideoDrawQuad contains an
external OES texture that is associated with an
EGLStream. Before we draw with that texture, an
'acquire' is performed to grab latest video frame.
See EGL_KHR_stream specs from Khronos.
Change-Id: Ia3fe25e9047f475594a55591e3e11caa0eab1e6a
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/chromium_gpu_helper.cpp')
-rw-r--r-- | src/core/chromium_gpu_helper.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/chromium_gpu_helper.cpp b/src/core/chromium_gpu_helper.cpp index 8782f5d98..663b1ec17 100644 --- a/src/core/chromium_gpu_helper.cpp +++ b/src/core/chromium_gpu_helper.cpp @@ -51,6 +51,12 @@ #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/texture_manager.h" +#include <QtGlobal> // We need this for the Q_OS_QNX define. + +#ifdef Q_OS_QNX +#include "content/common/gpu/stream_texture_qnx.h" +#endif + static void addSyncPointCallbackDelegate(content::SyncPointManager *syncPointManager, uint32 sync_point, const base::Closure& callback) { syncPointManager->AddSyncPointCallback(sync_point, callback); @@ -112,3 +118,15 @@ unsigned int service_id(gpu::gles2::Texture *tex) { return tex->service_id(); } + +#ifdef Q_OS_QNX +EGLStreamData eglstream_connect_consumer(gpu::gles2::Texture *tex) +{ + EGLStreamData egl_stream; + content::StreamTexture* image = static_cast<content::StreamTexture *>(tex->GetLevelImage(GL_TEXTURE_EXTERNAL_OES, 0)); + if (image) { + image->ConnectConsumerIfNeeded(&egl_stream.egl_display, &egl_stream.egl_str_handle); + } + return egl_stream; +} +#endif |