From 45ebf2ca7dee908d7dad0c7e4e20ba22a65b249e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 5 Aug 2018 13:32:04 -0700 Subject: [PATCH] Add log messages for server GPU, bitrate, and slices --- app/backend/computermanager.cpp | 3 +++ app/backend/computermanager.h | 1 + app/streaming/session.cpp | 13 ++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/backend/computermanager.cpp b/app/backend/computermanager.cpp index bfa12c6e..3432f0e8 100644 --- a/app/backend/computermanager.cpp +++ b/app/backend/computermanager.cpp @@ -52,6 +52,7 @@ NvComputer::NvComputer(QSettings& settings) this->maxLumaPixelsHEVC = 0; this->serverCodecModeSupport = 0; this->pendingQuit = false; + this->gpuModel = nullptr; } void @@ -134,6 +135,7 @@ NvComputer::NvComputer(QString address, QString serverInfo) this->currentGameId = NvHTTP::getCurrentGame(serverInfo); this->appVersion = NvHTTP::getXmlString(serverInfo, "appversion"); this->gfeVersion = NvHTTP::getXmlString(serverInfo, "GfeVersion"); + this->gpuModel = NvHTTP::getXmlString(serverInfo, "gputype"); this->activeAddress = address; this->state = NvComputer::CS_ONLINE; this->pendingQuit = false; @@ -266,6 +268,7 @@ bool NvComputer::update(NvComputer& that) ASSIGN_IF_CHANGED(gfeVersion); ASSIGN_IF_CHANGED(appVersion); ASSIGN_IF_CHANGED(maxLumaPixelsHEVC); + ASSIGN_IF_CHANGED(gpuModel); ASSIGN_IF_CHANGED_AND_NONEMPTY(appList); ASSIGN_IF_CHANGED_AND_NONEMPTY(displayModes); return changed; diff --git a/app/backend/computermanager.h b/app/backend/computermanager.h index 29dbb9cc..f79f16fd 100644 --- a/app/backend/computermanager.h +++ b/app/backend/computermanager.h @@ -65,6 +65,7 @@ public: QVector displayModes; int maxLumaPixelsHEVC; int serverCodecModeSupport; + QString gpuModel; // Persisted traits QString localAddress; diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index ad2d1214..7029abd2 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -236,6 +236,8 @@ Session::Session(NvComputer* computer, NvApp& app) m_DecoderLock(0), m_NeedsIdr(false) { + qDebug() << "Server GPU:" << m_Computer->gpuModel; + LiInitializeVideoCallbacks(&m_VideoCallbacks); m_VideoCallbacks.setup = drSetup; m_VideoCallbacks.submitDecodeUnit = drSubmitDecodeUnit; @@ -244,7 +246,11 @@ Session::Session(NvComputer* computer, NvApp& app) m_VideoCallbacks.capabilities |= CAPABILITY_DIRECT_SUBMIT; // Slice up to 4 times for parallel decode, once slice per core - m_VideoCallbacks.capabilities |= CAPABILITY_SLICES_PER_FRAME(qMin(MAX_SLICES, SDL_GetCPUCount())); + int slices = qMin(MAX_SLICES, SDL_GetCPUCount()); + m_VideoCallbacks.capabilities |= CAPABILITY_SLICES_PER_FRAME(slices); + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Encoder configured for %d slices per frame", + slices); LiInitializeStreamConfiguration(&m_StreamConfig); m_StreamConfig.width = m_Preferences.width; @@ -252,6 +258,11 @@ Session::Session(NvComputer* computer, NvApp& app) m_StreamConfig.fps = m_Preferences.fps; m_StreamConfig.bitrate = m_Preferences.bitrateKbps; m_StreamConfig.hevcBitratePercentageMultiplier = 75; + + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Video bitrate: %d kbps", + m_StreamConfig.bitrate); + RAND_bytes(reinterpret_cast(m_StreamConfig.remoteInputAesKey), sizeof(m_StreamConfig.remoteInputAesKey));