Remove redundant initializtion of SDL video
This commit is contained in:
parent
d2cff86c97
commit
c0bf8b9c25
2 changed files with 13 additions and 20 deletions
|
|
@ -289,12 +289,8 @@ int Session::getDecoderCapabilities(StreamingPreferences::VideoDecoderSelection
|
||||||
{
|
{
|
||||||
IVideoDecoder* decoder;
|
IVideoDecoder* decoder;
|
||||||
|
|
||||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) {
|
// Video must already be initialized to use this function
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_assert(SDL_WasInit(SDL_INIT_VIDEO));
|
||||||
"SDL_InitSubSystem(SDL_INIT_VIDEO) failed: %s",
|
|
||||||
SDL_GetError());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Window* window = SDL_CreateWindow("", 0, 0, width, height, SDL_WINDOW_HIDDEN);
|
SDL_Window* window = SDL_CreateWindow("", 0, 0, width, height, SDL_WINDOW_HIDDEN);
|
||||||
if (!window) {
|
if (!window) {
|
||||||
|
|
@ -319,8 +315,6 @@ int Session::getDecoderCapabilities(StreamingPreferences::VideoDecoderSelection
|
||||||
// the renderer may want to interact with the window
|
// the renderer may want to interact with the window
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
|
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -601,13 +595,6 @@ bool Session::validateLaunch()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the capability flags from the chosen decoder/renderer
|
|
||||||
m_VideoCallbacks.capabilities |= getDecoderCapabilities(m_Preferences->videoDecoderSelection,
|
|
||||||
m_StreamConfig.supportsHevc ? VIDEO_FORMAT_H265 : VIDEO_FORMAT_H264,
|
|
||||||
m_StreamConfig.width,
|
|
||||||
m_StreamConfig.height,
|
|
||||||
m_StreamConfig.fps);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -932,6 +919,14 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
hostInfo.serverInfoGfeVersion = siGfeVersion.data();
|
hostInfo.serverInfoGfeVersion = siGfeVersion.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the capability flags from the chosen decoder/renderer
|
||||||
|
// Requires SDL_INIT_VIDEO already done.
|
||||||
|
m_VideoCallbacks.capabilities |= getDecoderCapabilities(m_Preferences->videoDecoderSelection,
|
||||||
|
m_StreamConfig.supportsHevc ? VIDEO_FORMAT_H265 : VIDEO_FORMAT_H264,
|
||||||
|
m_StreamConfig.width,
|
||||||
|
m_StreamConfig.height,
|
||||||
|
m_StreamConfig.fps);
|
||||||
|
|
||||||
int err = LiStartConnection(&hostInfo, &m_StreamConfig, &k_ConnCallbacks,
|
int err = LiStartConnection(&hostInfo, &m_StreamConfig, &k_ConnCallbacks,
|
||||||
&m_VideoCallbacks,
|
&m_VideoCallbacks,
|
||||||
m_AudioDisabled ? nullptr : &k_AudioCallbacks,
|
m_AudioDisabled ? nullptr : &k_AudioCallbacks,
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,6 @@ public:
|
||||||
bool isHardwareDecodeAvailable(StreamingPreferences::VideoDecoderSelection vds,
|
bool isHardwareDecodeAvailable(StreamingPreferences::VideoDecoderSelection vds,
|
||||||
int videoFormat, int width, int height, int frameRate);
|
int videoFormat, int width, int height, int frameRate);
|
||||||
|
|
||||||
static
|
|
||||||
int getDecoderCapabilities(StreamingPreferences::VideoDecoderSelection vds,
|
|
||||||
int videoFormat, int width, int height, int frameRate);
|
|
||||||
|
|
||||||
static Session* get()
|
static Session* get()
|
||||||
{
|
{
|
||||||
return s_ActiveSession;
|
return s_ActiveSession;
|
||||||
|
|
@ -64,7 +60,9 @@ private:
|
||||||
|
|
||||||
void emitLaunchWarning(QString text);
|
void emitLaunchWarning(QString text);
|
||||||
|
|
||||||
int getDecoderCapabilities();
|
static
|
||||||
|
int getDecoderCapabilities(StreamingPreferences::VideoDecoderSelection vds,
|
||||||
|
int videoFormat, int width, int height, int frameRate);
|
||||||
|
|
||||||
IAudioRenderer* createAudioRenderer();
|
IAudioRenderer* createAudioRenderer();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue