Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,29 @@ then

fi

# Check for WinPR HashTable_Insert (may be missing on older FreeRDP/WinPR 2.x)
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([for HashTable_Insert in WinPR])
SAVE_LIBS="$LIBS"
LIBS="$RDP_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <winpr/collections.h>
int main(void) {
wHashTable* t = HashTable_New(FALSE);
const char* k = "k"; const char* v = "v";
(void)HashTable_Insert(t, k, v);
return 0;
}
]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_WINPR_HASHTABLE_INSERT], 1, [WinPR provides HashTable_Insert])],
[AC_MSG_RESULT([no])])
LIBS="$SAVE_LIBS"
fi

/* Removed unused WinPR HashTable checks; only HashTable_Insert is required */

# It is difficult or impossible to test for variations in FreeRDP behavior in
# between releases, as the change in behavior may not (yet) be associated with
# a corresponding change in version number and may not have any detectable
Expand Down
22 changes: 22 additions & 0 deletions src/libguac/guacamole/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,28 @@ struct guac_user {
*/
guac_user_audio_handler* audio_handler;

/**
* Handler for video events sent by the Guacamole web-client. This handler
* will be called whenever the web-client wishes to send a continuous
* stream of video data from some arbitrary source (a camera, for
* example).
*
* The handler takes a guac_stream, which contains the stream index and
* will persist through the duration of the transfer, and the mimetype
* of the data being transferred.
*
* Example:
* @code
* int video_handler(guac_user* user, guac_stream* stream,
* char* mimetype);
*
* int guac_user_init(guac_user* user, int argc, char** argv) {
* user->video_handler = video_handler;
* }
* @endcode
*/
guac_user_audio_handler* video_handler;

/**
* Handler for argv events (updates to the connection parameters of an
* in-progress connection) sent by the Guacamole web-client.
Expand Down
24 changes: 24 additions & 0 deletions src/libguac/user-handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ __guac_instruction_handler_mapping __guac_instruction_handler_map[] = {
{"get", __guac_handle_get},
{"put", __guac_handle_put},
{"audio", __guac_handle_audio},
{"video", __guac_handle_video},
{"argv", __guac_handle_argv},
{"nop", __guac_handle_nop},
{NULL, NULL}
Expand Down Expand Up @@ -344,6 +345,29 @@ int __guac_handle_audio(guac_user* user, int argc, char** argv) {

}

int __guac_handle_video(guac_user* user, int argc, char** argv) {

/* Pull corresponding stream */
int stream_index = atoi(argv[0]);
guac_stream* stream = __init_input_stream(user, stream_index);
if (stream == NULL)
return 0;

/* If supported, call handler */
if (user->video_handler)
return user->video_handler(
user,
stream,
argv[1] /* mimetype */
);

/* Otherwise, abort */
guac_protocol_send_ack(user->socket, stream,
"Video input unsupported", GUAC_PROTOCOL_STATUS_UNSUPPORTED);
return 0;

}

int __guac_handle_clipboard(guac_user* user, int argc, char** argv) {

/* Pull corresponding stream */
Expand Down
7 changes: 7 additions & 0 deletions src/libguac/user-handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ __guac_instruction_handler __guac_handle_key;
*/
__guac_instruction_handler __guac_handle_audio;

/**
* Internal initial handler for the video instruction. When a video
* instruction is received, this handler will be called. The client's video
* handler will be invoked if defined.
*/
__guac_instruction_handler __guac_handle_video;

/**
* Internal initial handler for the clipboard instruction. When a clipboard
* instruction is received, this handler will be called. The client's clipboard
Expand Down
39 changes: 38 additions & 1 deletion src/protocols/rdp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ libguac_client_rdp_la_SOURCES = \
channels/audio-input/audio-buffer.c \
channels/audio-input/audio-input.c \
channels/cliprdr.c \
channels/rdpecam/rdpecam.c \
channels/rdpecam/rdpecam_caps.c \
channels/rdpecam/rdpecam_sink.c \
channels/common-svc.c \
channels/disp.c \
channels/pipe-svc.c \
Expand Down Expand Up @@ -89,6 +92,9 @@ noinst_HEADERS = \
channels/audio-input/audio-buffer.h \
channels/audio-input/audio-input.h \
channels/cliprdr.h \
channels/rdpecam/rdpecam.h \
channels/rdpecam/rdpecam_caps.h \
channels/rdpecam/rdpecam_sink.h \
channels/common-svc.h \
channels/disp.h \
channels/pipe-svc.h \
Expand Down Expand Up @@ -120,6 +126,8 @@ noinst_HEADERS = \
plugins/channels.h \
plugins/guacai/guacai-messages.h \
plugins/guacai/guacai.h \
plugins/guacrdpecam/guacrdpecam.h \
plugins/guacrdpecam/rdpecam_proto.h \
plugins/ptr-string.h \
pointer.h \
print-job.h \
Expand Down Expand Up @@ -153,7 +161,8 @@ libguac_client_rdp_la_LIBADD = \

freerdp_LTLIBRARIES = \
libguac-common-svc-client.la \
libguacai-client.la
libguacai-client.la \
libguacrdpecam-client.la

freerdpdir = @FREERDP_PLUGIN_DIR@

Expand Down Expand Up @@ -202,6 +211,34 @@ libguacai_client_la_LIBADD = \
@COMMON_LTLIB@ \
@LIBGUAC_LTLIB@

#
# RDPECAM (Camera Redirection) - FreeRDP plugin
#

libguacrdpecam_client_la_SOURCES = \
plugins/guacrdpecam/guacrdpecam.c \
plugins/guacrdpecam/rdpecam_proto.c

libguacrdpecam_client_la_CFLAGS = \
@COMMON_INCLUDE@ \
@COMMON_SSH_INCLUDE@ \
@LIBGUAC_INCLUDE@ \
@RDP_CFLAGS@

libguacrdpecam_client_la_LDFLAGS = \
-module -avoid-version -shared \
@PTHREAD_LIBS@ \
@RDP_LIBS@

libguacrdpecam_client_la_LIBADD = \
@COMMON_LTLIB@ \
@LIBGUAC_LTLIB@ \
libguac-client-rdp.la

#
# RDPECAM (Camera Redirection) - included in main RDP library
#

#
# Optional SFTP support
#
Expand Down
Loading