From a78d9c2b90ecce6bed677735345e1b7721813800 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 11 Oct 2020 20:42:09 +1100 Subject: [PATCH] [obs] added RGBA16F support --- obs/lg.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/obs/lg.c b/obs/lg.c index ad8a1c8e..6b530721 100644 --- a/obs/lg.c +++ b/obs/lg.c @@ -31,6 +31,7 @@ typedef struct char * shmFile; uint32_t width, height; FrameType type; + int bpp; struct IVSHMEM shmDev; PLGMPClient lgmp; PLGMPClientQueue frameQueue, pointerQueue; @@ -474,11 +475,18 @@ static void lgVideoTick(void * data, float seconds) } enum gs_color_format format; + this->bpp = 4; switch(this->type) { - case FRAME_TYPE_BGRA : format = GS_BGRA ; break; - case FRAME_TYPE_RGBA : format = GS_RGBA ; break; - case FRAME_TYPE_RGBA10: format = GS_R10G10B10A2; break; + case FRAME_TYPE_BGRA : format = GS_BGRA ; break; + case FRAME_TYPE_RGBA : format = GS_RGBA ; break; + case FRAME_TYPE_RGBA10 : format = GS_R10G10B10A2; break; + + case FRAME_TYPE_RGBA16F: + this->bpp = 8; + format = GS_RGBA16F; + break; + default: printf("invalid type %d\n", this->type); os_sem_post(this->frameSem); @@ -508,7 +516,7 @@ static void lgVideoTick(void * data, float seconds) this->linesize, // dstpitch frame->height, // height frame->width, // width - 4, // bpp + this->bpp, // bpp frame->pitch // linepitch );