[host] linux: fix build with new HDR changes (untested)

This commit is contained in:
Geoffrey McRae 2023-10-27 01:19:46 +11:00
parent 6625cd733a
commit 5d7469d23e

View File

@ -49,6 +49,8 @@ struct pipewire
bool formatChanged; bool formatChanged;
int width, height; int width, height;
CaptureFormat format; CaptureFormat format;
bool hdr;
bool hdrPQ;
uint8_t * frameData; uint8_t * frameData;
unsigned int formatVer; unsigned int formatVer;
}; };
@ -153,7 +155,7 @@ static CaptureFormat convertSpaFormat(enum spa_video_format spa)
return CAPTURE_FMT_BGRA; return CAPTURE_FMT_BGRA;
case SPA_VIDEO_FORMAT_xBGR_210LE: case SPA_VIDEO_FORMAT_xBGR_210LE:
return CAPTURE_FMT_RGBA10_HDR; return CAPTURE_FMT_RGBA10;
case SPA_VIDEO_FORMAT_RGBA_F16: case SPA_VIDEO_FORMAT_RGBA_F16:
return CAPTURE_FMT_RGBA16F; return CAPTURE_FMT_RGBA16F;
@ -185,6 +187,10 @@ static void streamParamChangedCallback(void * opaque, uint32_t id,
this->width = info.size.width; this->width = info.size.width;
this->height = info.size.height; this->height = info.size.height;
this->format = convertSpaFormat(info.format); this->format = convertSpaFormat(info.format);
this->hdr = info.format & (
SPA_VIDEO_FORMAT_xBGR_210LE |
SPA_VIDEO_FORMAT_RGBA_F16);
this->hdrPQ = true; // this is assumed and untested
if (this->hasFormat) if (this->hasFormat)
{ {
@ -426,6 +432,8 @@ static CaptureResult pipewire_waitFrame(CaptureFrame * frame,
frame->formatVer = this->formatVer; frame->formatVer = this->formatVer;
frame->format = this->format; frame->format = this->format;
frame->hdr = this->hdr;
frame->hdrPQ = this->hdrPQ;
frame->screenWidth = this->width; frame->screenWidth = this->width;
frame->screenHeight = this->height; frame->screenHeight = this->height;
frame->frameWidth = this->width; frame->frameWidth = this->width;