mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-14 21:32:27 +00:00
Fix incorrect colorspace in MMAL renderer
This commit is contained in:
parent
808933cd70
commit
08175de069
2 changed files with 14 additions and 0 deletions
|
@ -144,6 +144,12 @@ bool MmalRenderer::initialize(PDECODER_PARAMETERS params)
|
||||||
m_InputPort->format->es->video.crop.y = 0;
|
m_InputPort->format->es->video.crop.y = 0;
|
||||||
m_InputPort->format->es->video.crop.width = params->width;
|
m_InputPort->format->es->video.crop.width = params->width;
|
||||||
m_InputPort->format->es->video.crop.height = params->height;
|
m_InputPort->format->es->video.crop.height = params->height;
|
||||||
|
|
||||||
|
// Setting colorspace like this doesn't seem to make a difference,
|
||||||
|
// but we'll do it just in case it starts working in the future.
|
||||||
|
// The default appears to be Rec. 709 already.
|
||||||
|
m_InputPort->format->es->video.color_space = MMAL_COLOR_SPACE_ITUR_BT709;
|
||||||
|
|
||||||
status = mmal_port_format_commit(m_InputPort);
|
status = mmal_port_format_commit(m_InputPort);
|
||||||
if (status != MMAL_SUCCESS) {
|
if (status != MMAL_SUCCESS) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
@ -204,6 +210,13 @@ bool MmalRenderer::initialize(PDECODER_PARAMETERS params)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MmalRenderer::getDecoderColorspace()
|
||||||
|
{
|
||||||
|
// MMAL seems to always use Rec. 709 colorspace for rendering
|
||||||
|
// even when we try to set something else in the input format.
|
||||||
|
return COLORSPACE_REC_709;
|
||||||
|
}
|
||||||
|
|
||||||
void MmalRenderer::setupBackground(PDECODER_PARAMETERS params)
|
void MmalRenderer::setupBackground(PDECODER_PARAMETERS params)
|
||||||
{
|
{
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
|
|
|
@ -17,6 +17,7 @@ public:
|
||||||
virtual enum AVPixelFormat getPreferredPixelFormat(int videoFormat) override;
|
virtual enum AVPixelFormat getPreferredPixelFormat(int videoFormat) override;
|
||||||
virtual bool needsTestFrame() override;
|
virtual bool needsTestFrame() override;
|
||||||
virtual int getRendererAttributes() override;
|
virtual int getRendererAttributes() override;
|
||||||
|
virtual int getDecoderColorspace() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void InputPortCallback(MMAL_PORT_T* port, MMAL_BUFFER_HEADER_T* buffer);
|
static void InputPortCallback(MMAL_PORT_T* port, MMAL_BUFFER_HEADER_T* buffer);
|
||||||
|
|
Loading…
Reference in a new issue