mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[server] fixed build without CHANNEL_AUDIN_SERVER
This commit is contained in:
@@ -38,7 +38,9 @@
|
||||
* will need to fix that later on cleanly
|
||||
*/
|
||||
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
#include <freerdp/server/audin.h>
|
||||
#endif
|
||||
#include <freerdp/server/rdpsnd.h>
|
||||
#include <freerdp/server/cliprdr.h>
|
||||
#include <freerdp/server/echo.h>
|
||||
@@ -69,7 +71,9 @@ extern void freerdp_channels_dummy(void);
|
||||
|
||||
void freerdp_channels_dummy(void)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin_server_context* audin;
|
||||
#endif
|
||||
RdpsndServerContext* rdpsnd;
|
||||
CliprdrServerContext* cliprdr;
|
||||
echo_server_context* echo;
|
||||
@@ -89,8 +93,12 @@ void freerdp_channels_dummy(void)
|
||||
#ifdef WITH_CHANNEL_GFXREDIR
|
||||
GfxRedirServerContext* gfxredir;
|
||||
#endif // WITH_CHANNEL_GFXREDIR
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin = audin_server_context_new(NULL);
|
||||
#endif
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin_server_context_free(audin);
|
||||
#endif
|
||||
rdpsnd = rdpsnd_server_context_new(NULL);
|
||||
rdpsnd_server_context_free(rdpsnd);
|
||||
cliprdr = cliprdr_server_context_new(NULL);
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
#include <freerdp/channels/wtsvc.h>
|
||||
#include <freerdp/channels/rdpsnd.h>
|
||||
|
||||
#if !defined(CHANNEL_AUDIN_SERVER)
|
||||
#error "This header must not be included if CHANNEL_AUDIN_SERVER is not defined"
|
||||
#endif
|
||||
|
||||
typedef struct s_audin_server_context audin_server_context;
|
||||
|
||||
typedef BOOL (*psAudinServerChannelIdAssigned)(audin_server_context* context, UINT32 channelId);
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#include <freerdp/server/encomsp.h>
|
||||
#include <freerdp/server/remdesk.h>
|
||||
#include <freerdp/server/rdpsnd.h>
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
#include <freerdp/server/audin.h>
|
||||
#endif
|
||||
#include <freerdp/server/rdpgfx.h>
|
||||
|
||||
#include <freerdp/codec/color.h>
|
||||
@@ -114,7 +116,9 @@ struct rdp_shadow_client
|
||||
EncomspServerContext* encomsp;
|
||||
RemdeskServerContext* remdesk;
|
||||
RdpsndServerContext* rdpsnd;
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin_server_context* audin;
|
||||
#endif
|
||||
RdpgfxServerContext* rdpgfx;
|
||||
|
||||
BOOL resizeRequested;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <freerdp/log.h>
|
||||
#define TAG SERVER_TAG("sample")
|
||||
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
/**
|
||||
* Function description
|
||||
*
|
||||
@@ -78,11 +79,12 @@ static UINT sf_peer_audin_receive_samples(audin_server_context* context, const A
|
||||
WLog_DBG(TAG, "receive %" PRIdz " frames.", nframes);
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void sf_peer_audin_init(testPeerContext* context)
|
||||
{
|
||||
WINPR_ASSERT(context);
|
||||
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
context->audin = audin_server_context_new(context->vcm);
|
||||
WINPR_ASSERT(context->audin);
|
||||
|
||||
@@ -96,33 +98,48 @@ void sf_peer_audin_init(testPeerContext* context)
|
||||
context->audin->Opening = sf_peer_audin_opening;
|
||||
context->audin->OpenResult = sf_peer_audin_open_result;
|
||||
context->audin->ReceiveSamples = sf_peer_audin_receive_samples;
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL sf_peer_audin_start(testPeerContext* context)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
if (!context || !context->audin || !context->audin->Open)
|
||||
return FALSE;
|
||||
|
||||
return context->audin->Open(context->audin);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL sf_peer_audin_stop(testPeerContext* context)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
if (!context || !context->audin || !context->audin->Close)
|
||||
return FALSE;
|
||||
|
||||
return context->audin->Close(context->audin);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL sf_peer_audin_running(testPeerContext* context)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
if (!context || !context->audin || !context->audin->IsOpen)
|
||||
return FALSE;
|
||||
|
||||
return context->audin->IsOpen(context->audin);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sf_peer_audin_uninit(testPeerContext* context)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin_server_context_free(context->audin);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/listener.h>
|
||||
#include <freerdp/server/audin.h>
|
||||
|
||||
#include "sfreerdp.h"
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
#include <winpr/assert.h>
|
||||
|
||||
#include <freerdp/server/audin.h>
|
||||
|
||||
#include "sf_rdpsnd.h"
|
||||
|
||||
#include <freerdp/server/server-common.h>
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
#if defined(CHANNEL_AINPUT_SERVER)
|
||||
#include <freerdp/server/ainput.h>
|
||||
#endif
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
#include <freerdp/server/audin.h>
|
||||
#endif
|
||||
#include <freerdp/server/rdpsnd.h>
|
||||
#include <freerdp/server/encomsp.h>
|
||||
#include <freerdp/transport_io.h>
|
||||
@@ -56,7 +58,9 @@ struct test_peer_context
|
||||
HANDLE vcm;
|
||||
void* debug_channel;
|
||||
HANDLE debug_channel_thread;
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin_server_context* audin;
|
||||
#endif
|
||||
BOOL audin_open;
|
||||
#if defined(CHANNEL_AINPUT_SERVER)
|
||||
ainput_server_context* ainput;
|
||||
|
||||
@@ -25,8 +25,13 @@
|
||||
#include "shadow_audin.h"
|
||||
#include <freerdp/server/server-common.h>
|
||||
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
#include <freerdp/server/audin.h>
|
||||
#endif
|
||||
|
||||
#define TAG SERVER_TAG("shadow")
|
||||
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
/**
|
||||
* Function description
|
||||
*
|
||||
@@ -92,9 +97,11 @@ static UINT AudinServerReceiveSamples(audin_server_context* context, const AUDIO
|
||||
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL shadow_client_audin_init(rdpShadowClient* client)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
audin_server_context* audin;
|
||||
audin = client->audin = audin_server_context_new(client->vcm);
|
||||
|
||||
@@ -135,14 +142,17 @@ BOOL shadow_client_audin_init(rdpShadowClient* client)
|
||||
fail:
|
||||
audin_server_context_free(audin);
|
||||
client->audin = NULL;
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void shadow_client_audin_uninit(rdpShadowClient* client)
|
||||
{
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
if (client->audin)
|
||||
{
|
||||
audin_server_context_free(client->audin);
|
||||
client->audin = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2223,6 +2223,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
break;
|
||||
|
||||
case DRDYNVC_STATE_READY:
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
if (client->audin && !IFCALLRESULT(TRUE, client->audin->IsOpen, client->audin))
|
||||
{
|
||||
if (!IFCALLRESULT(FALSE, client->audin->Open, client->audin))
|
||||
@@ -2231,6 +2232,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Init RDPGFX dynamic channel */
|
||||
if (settings->SupportGraphicsPipeline && client->rdpgfx && !gfxstatus.gfxOpened)
|
||||
@@ -2341,6 +2343,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
fail:
|
||||
|
||||
/* Free channels early because we establish channels in post connect */
|
||||
#if defined(CHANNEL_AUDIN_SERVER)
|
||||
if (client->audin && !IFCALLRESULT(TRUE, client->audin->IsOpen, client->audin))
|
||||
{
|
||||
if (!IFCALLRESULT(FALSE, client->audin->Close, client->audin))
|
||||
@@ -2348,6 +2351,7 @@ fail:
|
||||
WLog_WARN(TAG, "AUDIN shutdown failure!");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gfxstatus.gfxOpened)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user