Loading...
Searching...
No Matches
GLCaptureUpload.hpp File Reference

OpenGL-specific upload helpers for GPU-direct video CAPTURE strategies that land a captured frame in a QRhi GL texture. More...

Detailed Description

OpenGL-specific upload helpers for GPU-direct video CAPTURE strategies that land a captured frame in a QRhi GL texture.

Shared by the per-strategy capture headers, which would otherwise each carry the same glTexSubImage2D upload skeleton. The backend-neutral plumbing (slot handoff, byte-size validation) lives in CaptureStrategyCommon.hpp, which this file includes; the vendor-specific concerns (DMABufferLock, buffer allocation, P2P/DVP bridge calls, pacing) stay in the addon.

The two upload helpers differ deliberately:

  • uploadClientToGLTexture (sysmem staging) resets pixel-unpack state, since the decoder/QRhi may have left a stale ROW_LENGTH/SKIP that would shear a client-pointer upload.
  • uploadGLBufferToGLTexture (P2P: data already in a GL buffer) binds the source buffer and uploads from offset 0.

Go to the source code of this file.

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.
 

Functions

void score::gfx::interop::uploadClientToGLTexture (QOpenGLContext &glctx, QRhiTexture &outTex, const void *src, bool bgra) noexcept
 Upload one captured frame from client memory into a QRhi GL texture.
 
void score::gfx::interop::uploadGLBufferToGLTexture (QOpenGLContext &glctx, QRhiTexture &outTex, std::uint32_t srcGlBuffer, bool bgra) noexcept
 Upload one captured frame from a GL buffer (bound as PIXEL_UNPACK_BUFFER) into a QRhi GL texture.
 

Function Documentation

◆ uploadClientToGLTexture()

void score::gfx::interop::uploadClientToGLTexture ( QOpenGLContext &  glctx,
QRhiTexture &  outTex,
const void *  src,
bool  bgra 
)
inlinenoexcept

Upload one captured frame from client memory into a QRhi GL texture.

For the CPU-staging path: the vendor DMA'd the frame into a page-locked host buffer; this copies it sysmem -> VRAM. Resets pixel-unpack state first (PIXEL_UNPACK_BUFFER unbound + ALIGNMENT/ROW_LENGTH/SKIP defaults) so a stale setting left by the decoder doesn't misalign rows.

bgra selects GL_BGRA vs GL_RGBA (ARGB framestores are BGRA in memory).

◆ uploadGLBufferToGLTexture()

void score::gfx::interop::uploadGLBufferToGLTexture ( QOpenGLContext &  glctx,
QRhiTexture &  outTex,
std::uint32_t  srcGlBuffer,
bool  bgra 
)
inlinenoexcept

Upload one captured frame from a GL buffer (bound as PIXEL_UNPACK_BUFFER) into a QRhi GL texture.

For the P2P path: the vendor P2P-wrote straight into the GL buffer's VRAM, so the "upload" is a server-side buffer -> texture copy from offset 0.

srcGlBuffer the GL buffer object name holding the captured frame. bgra selects GL_BGRA vs GL_RGBA.