mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-03 08:15:37 +00:00
Add logging callbacks for SLAudio and SLVideo
This commit is contained in:
parent
f1c7c5f02c
commit
477fa8fedf
@ -6,6 +6,7 @@ SLAudioRenderer::SLAudioRenderer()
|
||||
: m_AudioContext(nullptr),
|
||||
m_AudioStream(nullptr)
|
||||
{
|
||||
SLAudio_SetLogFunction(SLAudioRenderer::slLogCallback, nullptr);
|
||||
}
|
||||
|
||||
bool SLAudioRenderer::prepareForPlayback(const OPUS_MULTISTREAM_CONFIGURATION* opusConfig)
|
||||
@ -56,3 +57,30 @@ bool SLAudioRenderer::submitAudio(short* audioBuffer, int audioSize)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SLAudioRenderer::slLogCallback(void *context, ESLAudioLog logLevel, const char *message)
|
||||
{
|
||||
SDL_LogPriority priority;
|
||||
|
||||
switch (logLevel)
|
||||
{
|
||||
case k_ESLAudioLogError:
|
||||
priority = SDL_LOG_PRIORITY_ERROR;
|
||||
break;
|
||||
case k_ESLAudioLogWarning:
|
||||
priority = SDL_LOG_PRIORITY_WARN;
|
||||
break;
|
||||
case k_ESLAudioLogInfo:
|
||||
priority = SDL_LOG_PRIORITY_INFO;
|
||||
break;
|
||||
default:
|
||||
case k_ESLAudioLogDebug:
|
||||
priority = SDL_LOG_PRIORITY_DEBUG;
|
||||
break;
|
||||
}
|
||||
|
||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION,
|
||||
priority,
|
||||
"SLAudio: %s",
|
||||
message);
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ public:
|
||||
virtual bool submitAudio(short* audioBuffer, int audioSize);
|
||||
|
||||
private:
|
||||
static void slLogCallback(void* context, ESLAudioLog logLevel, const char* message);
|
||||
|
||||
CSLAudioContext* m_AudioContext;
|
||||
CSLAudioStream* m_AudioStream;
|
||||
};
|
||||
|
@ -4,7 +4,7 @@ SLVideoDecoder::SLVideoDecoder(bool)
|
||||
: m_VideoContext(nullptr),
|
||||
m_VideoStream(nullptr)
|
||||
{
|
||||
|
||||
SLVideo_SetLogFunction(SLVideoDecoder::slLogCallback, nullptr);
|
||||
}
|
||||
|
||||
SLVideoDecoder::~SLVideoDecoder()
|
||||
@ -108,3 +108,30 @@ SLVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
|
||||
|
||||
return DR_OK;
|
||||
}
|
||||
|
||||
void SLVideoDecoder::slLogCallback(void *context, ESLVideoLog logLevel, const char *message)
|
||||
{
|
||||
SDL_LogPriority priority;
|
||||
|
||||
switch (logLevel)
|
||||
{
|
||||
case k_ESLVideoLogError:
|
||||
priority = SDL_LOG_PRIORITY_ERROR;
|
||||
break;
|
||||
case k_ESLVideoLogWarning:
|
||||
priority = SDL_LOG_PRIORITY_WARN;
|
||||
break;
|
||||
case k_ESLVideoLogInfo:
|
||||
priority = SDL_LOG_PRIORITY_INFO;
|
||||
break;
|
||||
default:
|
||||
case k_ESLVideoLogDebug:
|
||||
priority = SDL_LOG_PRIORITY_DEBUG;
|
||||
break;
|
||||
}
|
||||
|
||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION,
|
||||
priority,
|
||||
"SLVideo: %s",
|
||||
message);
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ public:
|
||||
virtual void renderFrameOnMainThread() {}
|
||||
|
||||
private:
|
||||
static void slLogCallback(void* context, ESLVideoLog logLevel, const char* message);
|
||||
|
||||
CSLVideoContext* m_VideoContext;
|
||||
CSLVideoStream* m_VideoStream;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user