Skip to content

Commit 654f322

Browse files
committed
Fixes for mouse cursor and deadlock at high resolution
1 parent 0900150 commit 654f322

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
# AMD Interactive Streaming SDK
1+
# Advanced Interactive Streaming SDK
22

3-
AMD Interactive Streaming SDK is a C++ library that provides building blocks and samples for low latency streaming applications, such as Cloud Game Streaming, Virtual Desktop Interface (VDI),
3+
Advanced Interactive Streaming SDK is a C++ library that provides building blocks and samples for low latency streaming applications, such as Cloud Game Streaming, Virtual Desktop Interface (VDI),
44
Virtual and Augmented Reality, etc. using AMD Radeon graphics. It allows you to build a complete streaming solution including video and audio capture, video and audio encoder/decoder/pre-post-processing pipelines, a robust and secure network stack, or use some of its components, while implementing the rest yourself.
55

66
## Changelog:
7-
- Initial revision
7+
- v1.0.1 - bug fixes:
8+
- System mouse cursor doesn't get hidden correctly in some games
9+
- Deadlock on server exit when streaming at high (8K) resolution
810

911
## Dependencies:
10-
AMD Interactive Streaming SDK depends on a number of other components from AMD and third parties:
12+
Advanced Interactive Streaming SDK depends on a number of other components from AMD and third parties:
1113
- [Advanced Media Framework (AMF SDK)](https://github.com/GPUOpen-LibrariesAndSDKs/AMF) for video encoding/decoding/processing
1214
- [MbedTLS](https://github.com/Mbed-TLS/mbedtls) for encryption
1315
- [Ffmpeg](https://github.com/FFmpeg/FFmpeg) for audio encoding/decoding/resampling
1416

1517
## License:
16-
AMD Interactive Streaming SDK is distributed in open source under the [MIT license](LICENSE.md)
18+
Advanced Interactive Streaming SDK is distributed in open source under the [MIT license](LICENSE.md)
1719

1820
## Documentation:
1921
Comprehensive documentation is provided by the [Streaming SDK Wiki](https://github.com/GPUOpen-LibrariesAndSDKs/Streaming-SDK/wiki)

samples/RemoteDesktopServer/AVStreamer.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,6 @@ void AVStreamer::CaptureVideo()
603603
{
604604
amf::AMFSurfacePtr frame(capturedData);
605605
m_TimestampCalibrator.SubmitVideo(frame); // This synchronizes low latency video timestamp to audio. See notes in sdk/util/pipeline/TimestampCalibrator.h for detailed explanations
606-
amf::AMFLock lock(&m_Guard);
607606
m_VideoOutput->SubmitInput(frame, lastOriginPts, timeOfLastOriginPts);
608607
}
609608
}
@@ -615,7 +614,6 @@ void AVStreamer::CaptureAudio()
615614
{
616615
amf::AMFAudioBufferPtr buffer(capturedData);
617616
m_TimestampCalibrator.SubmitAudio(buffer);
618-
amf::AMFLock lock(&m_Guard);
619617
m_AudioOutput->SubmitInput(buffer);
620618
}
621619
}

sdk/controllers/client/win/MouseCursorWin.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace ssdk::ctls
5252
{
5353
amf::AMFLock lock(&m_cs);
5454

55-
if (m_pCursor == nullptr || m_bShowCursor == false)
55+
if (m_pCursor == nullptr)
5656
{
5757
return;
5858
}
@@ -183,7 +183,7 @@ namespace ssdk::ctls
183183

184184
if (bShownOld != bShownNew)
185185
{
186-
if (m_pCursor == nullptr || m_bShowCursor == false)
186+
if (m_pCursor == nullptr)
187187
{
188188
::PostMessage(HWND(m_hWindow), WM_USER_SHOW_CURSOR, 0, FALSE);
189189
}
@@ -198,6 +198,8 @@ namespace ssdk::ctls
198198
void MouseCursorWin::OnCursorHidden()
199199
{
200200
::PostMessage(HWND(m_hWindow), WM_USER_SHOW_CURSOR, 0, FALSE);
201+
amf::AMFLock lock(&m_cs);
202+
m_pCursor = nullptr;
201203
}
202204

203205
//-------------------------------------------------------------------------------------------------

sdk/controllers/server/ControllerManagerSvr.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ namespace ssdk::ctls::svr
244244

245245
void ControllerManager::OnConnectionEstablished()
246246
{
247+
amf::AMFLock lock(&m_Guard);
247248
for (std::vector<ControllerBase::Ptr>::iterator it = m_Controllers.begin(); it != m_Controllers.end(); it++)
248249
{
249250
(*it)->OnConnectionEstablished();
@@ -252,6 +253,7 @@ namespace ssdk::ctls::svr
252253

253254
void ControllerManager::OnConnectionTerminated()
254255
{
256+
amf::AMFLock lock(&m_Guard);
255257
for (std::vector<ControllerBase::Ptr>::iterator it = m_Controllers.begin(); it != m_Controllers.end(); it++)
256258
{
257259
(*it)->OnConnectionTerminated();
@@ -260,6 +262,7 @@ namespace ssdk::ctls::svr
260262

261263
void ControllerManager::Update()
262264
{
265+
amf::AMFLock lock(&m_Guard);
263266
for (std::vector<ControllerBase::Ptr>::iterator it = m_Controllers.begin(); it != m_Controllers.end(); it++)
264267
{
265268
(*it)->Update();

sdk/transports/transport-amd/ServerTransportImpl.cpp

+16-13
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ namespace ssdk::transport_amd
858858
// Find subscriber and send video data to client
859859
Result result = Result::FAIL;
860860
Subscriber::Ptr pSubscriber = FindSubscriber(m_Sessions[session]);
861-
amf::AMFLock lock(&m_Guard);
862861
if (pSubscriber != nullptr)
863862
{
864863
result = pSubscriber->TransmitMessage(Channel::VIDEO_OUT, bufToSend.GetData(), bufToSend.GetSize());
@@ -1545,24 +1544,28 @@ namespace ssdk::transport_amd
15451544
//-------------------------------------------------------------------------------------------------
15461545
bool ServerTransportImpl::DeleteSubscriber(Session* session, TerminationReason reason)
15471546
{
1548-
amf::AMFLock lock(&m_Guard);
1549-
1550-
Subscribers::iterator it = m_Subscribers.find(session);
1551-
if (it != m_Subscribers.end())
1547+
ConnectionManagerCallback* pCMCallback = nullptr;
1548+
SessionHandle hSession = session->GetSessionHandle();
1549+
bool result = false;
15521550
{
1553-
Subscriber::Ptr pSubscriber = it->second;
1554-
m_Subscribers.erase(it);
1551+
amf::AMFLock lock(&m_Guard);
15551552

1556-
ConnectionManagerCallback* pCMCallback = m_InitParams.GetConnectionManagerCallback();
1557-
SessionHandle hSession = session->GetSessionHandle();
1558-
if (pCMCallback != nullptr)
1553+
Subscribers::iterator it = m_Subscribers.find(session);
1554+
if (it != m_Subscribers.end())
15591555
{
1560-
pCMCallback->OnClientDisconnected(hSession, reason == TerminationReason::DISCONNECT ? ConnectionManagerCallback::DisconnectReason::CLIENT_DISCONNECTED : ConnectionManagerCallback::DisconnectReason::TIMEOUT);
1556+
Subscriber::Ptr pSubscriber = it->second;
1557+
m_Subscribers.erase(it);
1558+
1559+
pCMCallback = m_InitParams.GetConnectionManagerCallback();
1560+
result = true;
15611561
}
1562-
return true;
1562+
}
1563+
if (pCMCallback != nullptr)
1564+
{
1565+
pCMCallback->OnClientDisconnected(hSession, reason == TerminationReason::DISCONNECT ? ConnectionManagerCallback::DisconnectReason::CLIENT_DISCONNECTED : ConnectionManagerCallback::DisconnectReason::TIMEOUT);
15631566
}
15641567

1565-
return false;
1568+
return result;
15661569
}
15671570

15681571
ssdk::util::AESPSKCipher::Ptr ServerTransportImpl::FindCipherForSession(SessionHandle session)

0 commit comments

Comments
 (0)