GUACAMOLE-25: Add support for multiple versions of IWTSVirtualChannelCallback.

This commit is contained in:
Michael Jumper 2016-04-16 23:28:50 -07:00
parent ac94fd4cd0
commit 1088332376
2 changed files with 51 additions and 0 deletions

View File

@ -764,6 +764,28 @@ then
[Whether the legacy rdpBitmap API was found])])
fi
#
# FreeRDP: IWTSVirtualChannelCallback
#
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([whether IWTSVirtualChannelCallback.OnDataReceived() uses a wStream])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <winpr/wtypes.h>
#include <freerdp/dvc.h>
#include <freerdp/freerdp.h>
int __data_received(
IWTSVirtualChannelCallback* channel_callback,
wStream* stream);
IWTSVirtualChannelCallback cb = {
.OnDataReceived = __data_received
};]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_DEFINE([LEGACY_IWTSVIRTUALCHANNELCALLBACK],,
[Whether the legacy IWTSVirtualChannelCallback API was found])])
fi
#
# FreeRDP: Decompression function variants
#

View File

@ -62,6 +62,7 @@ static void guac_rdp_ai_handle_data(guac_client* client, wStream* stream) {
}
#if LEGACY_IWTSVIRTUALCHANNELCALLBACK
/**
* Callback which is invoked when data is received along a connection to the
* AUDIO_INPUT plugin. This callback is specific to FreeRDP 1.1 and older.
@ -93,6 +94,34 @@ static int guac_rdp_ai_data(IWTSVirtualChannelCallback* channel_callback,
return 0;
}
#else
/**
* Callback which is invoked when data is received along a connection to the
* AUDIO_INPUT plugin. This callback is specific to FreeRDP 1.2 and newer.
*
* @param channel_callback
* The IWTSVirtualChannelCallback structure to which this callback was
* originally assigned.
*
* @param stream
* The data received.
*
* @return
* Always zero.
*/
static int guac_rdp_ai_data(IWTSVirtualChannelCallback* channel_callback,
wStream* stream) {
guac_rdp_ai_channel_callback* ai_channel_callback =
(guac_rdp_ai_channel_callback*) channel_callback;
/* Invoke generalized (API-independent) data handler */
guac_rdp_ai_handle_data(ai_channel_callback->client, stream);
return 0;
}
#endif
/**
* Callback which is invoked when a connection to the AUDIO_INPUT plugin is