mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
Added support for AUDIO_PLAYBACK_DVC
Support audio on dynamic channel. Please refer to MS-RDPEA.
This commit is contained in:
parent
c5e4fc71bc
commit
f6f4acc921
@ -673,13 +673,40 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context)
|
|||||||
DWORD bytesReturned;
|
DWORD bytesReturned;
|
||||||
RdpsndServerPrivate* priv = context->priv;
|
RdpsndServerPrivate* priv = context->priv;
|
||||||
UINT error = ERROR_INTERNAL_ERROR;
|
UINT error = ERROR_INTERNAL_ERROR;
|
||||||
priv->ChannelHandle =
|
PULONG pSessionId = NULL;
|
||||||
WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, RDPSND_CHANNEL_NAME);
|
|
||||||
|
|
||||||
if (!priv->ChannelHandle)
|
priv->SessionId = WTS_CURRENT_SESSION;
|
||||||
|
|
||||||
|
if (context->use_dynamic_virtual_channel)
|
||||||
{
|
{
|
||||||
WLog_ERR(TAG, "WTSVirtualChannelOpen failed!");
|
if (WTSQuerySessionInformationA(context->vcm, WTS_CURRENT_SESSION, WTSSessionId,
|
||||||
return ERROR_INTERNAL_ERROR;
|
(LPSTR*)&pSessionId, &bytesReturned))
|
||||||
|
{
|
||||||
|
priv->SessionId = (DWORD)*pSessionId;
|
||||||
|
WTSFreeMemory(pSessionId);
|
||||||
|
priv->ChannelHandle = (HANDLE)WTSVirtualChannelOpenEx(
|
||||||
|
priv->SessionId, "AUDIO_PLAYBACK_DVC", WTS_CHANNEL_OPTION_DYNAMIC);
|
||||||
|
if (!priv->ChannelHandle)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "Open audio dynamic virtual channel (AUDIO_PLAYBACK_DVC) failed!");
|
||||||
|
return ERROR_INTERNAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "WTSQuerySessionInformationA failed!");
|
||||||
|
return ERROR_INTERNAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
priv->ChannelHandle =
|
||||||
|
WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, RDPSND_CHANNEL_NAME);
|
||||||
|
if (!priv->ChannelHandle)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "Open audio static virtual channel (rdpsnd) failed!");
|
||||||
|
return ERROR_INTERNAL_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WTSVirtualChannelQuery(priv->ChannelHandle, WTSVirtualEventHandle, &buffer,
|
if (!WTSVirtualChannelQuery(priv->ChannelHandle, WTSVirtualEventHandle, &buffer,
|
||||||
|
@ -39,6 +39,7 @@ struct _rdpsnd_server_private
|
|||||||
HANDLE StopEvent;
|
HANDLE StopEvent;
|
||||||
HANDLE channelEvent;
|
HANDLE channelEvent;
|
||||||
void* ChannelHandle;
|
void* ChannelHandle;
|
||||||
|
DWORD SessionId;
|
||||||
|
|
||||||
BOOL waitingHeader;
|
BOOL waitingHeader;
|
||||||
DWORD expectedBytes;
|
DWORD expectedBytes;
|
||||||
|
@ -56,6 +56,9 @@ struct _rdpsnd_server_context
|
|||||||
/* Server self-defined pointer. */
|
/* Server self-defined pointer. */
|
||||||
void* data;
|
void* data;
|
||||||
|
|
||||||
|
/* Server to request to use dynamic virtual channel. */
|
||||||
|
BOOL use_dynamic_virtual_channel;
|
||||||
|
|
||||||
/* Server supported formats. Set by server. */
|
/* Server supported formats. Set by server. */
|
||||||
AUDIO_FORMAT* server_formats;
|
AUDIO_FORMAT* server_formats;
|
||||||
size_t num_server_formats;
|
size_t num_server_formats;
|
||||||
|
Loading…
Reference in New Issue
Block a user