GUACAMOLE-249: Migrate loading of RDPSND support ("guacsnd" plugin) to abstract function.

This commit is contained in:
Michael Jumper 2019-12-21 14:03:32 -08:00
parent f3cef7e2f0
commit 0497a33ece
4 changed files with 86 additions and 6 deletions

View File

@ -59,6 +59,7 @@ libguac_client_rdp_la_SOURCES = \
rdp_pointer.c \ rdp_pointer.c \
rdp_settings.c \ rdp_settings.c \
rdp_stream.c \ rdp_stream.c \
rdpsnd.c \
resolution.c \ resolution.c \
svc.c \ svc.c \
unicode.c \ unicode.c \
@ -100,6 +101,7 @@ noinst_HEADERS = \
rdp_settings.h \ rdp_settings.h \
rdp_status.h \ rdp_status.h \
rdp_stream.h \ rdp_stream.h \
rdpsnd.h \
resolution.h \ resolution.h \
svc.h \ svc.h \
unicode.h \ unicode.h \

View File

@ -38,6 +38,7 @@
#include "rdp_glyph.h" #include "rdp_glyph.h"
#include "rdp_pointer.h" #include "rdp_pointer.h"
#include "rdp_stream.h" #include "rdp_stream.h"
#include "rdpsnd.h"
#include "svc.h" #include "svc.h"
#ifdef ENABLE_COMMON_SSH #ifdef ENABLE_COMMON_SSH
@ -116,12 +117,7 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) {
"printing will not work. Sound MAY not work."); "printing will not work. Sound MAY not work.");
/* Load RDPSND plugin */ /* Load RDPSND plugin */
if (guac_freerdp_channels_load_plugin(channels, instance->settings, guac_rdpsnd_load_plugin(context);
"guacsnd", client))
guac_client_log(client, GUAC_LOG_WARNING,
"Failed to load guacsnd alongside guacdr plugin. Sound "
"will not work. Drive redirection and printing MAY not "
"work.");
} }

View File

@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "channels.h"
#include "rdp.h"
#include <freerdp/freerdp.h>
#include <guacamole/client.h>
void guac_rdpsnd_load_plugin(rdpContext* context) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
/* Load RDPSND plugin */
if (guac_freerdp_channels_load_plugin(context->channels, context->settings, "guacsnd", client)) {
guac_client_log(client, GUAC_LOG_WARNING, "Support for the RDPSND "
"channel (audio output) could not be loaded. Sound will not "
"work. Drive redirection and printing MAY not work.");
return;
}
guac_client_log(client, GUAC_LOG_DEBUG, "Support for RDPSND (audio "
"output) registered. Awaiting channel connection.");
}

View File

@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_RDP_RDPSND_H
#define GUAC_RDP_RDPSND_H
#include "config.h"
/**
* Initializes audio output support for RDP and handling of the RDPSND channel.
* If failures occur, messages noting the specifics of those failures will be
* logged, and the RDP side of audio output support will not be functional.
*
* This MUST be called within the PreConnect callback of the freerdp instance
* for RDPSND support to be loaded.
*
* @param rdpContext
* The rdpContext associated with the FreeRDP side of the RDP connection.
*/
void guac_rdpsnd_load_plugin(rdpContext* context);
#endif