diff --git a/src/protocols/rdp/Makefile.am b/src/protocols/rdp/Makefile.am index bc57a1e2..aa62913f 100644 --- a/src/protocols/rdp/Makefile.am +++ b/src/protocols/rdp/Makefile.am @@ -89,6 +89,11 @@ noinst_HEADERS = \ rdp_pointer.h \ wav_encoder.h +# Add compatibility layer for WinPR if not available +if ! ENABLE_WINPR + noinst_HEADERS += winpr-compat/stream.h +endif + # Compile OGG support if available if ENABLE_OGG libguac_client_rdp_la_SOURCES += ogg_encoder.c diff --git a/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.c b/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.c index 3937f807..7b8b5c63 100644 --- a/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.c +++ b/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.c @@ -40,9 +40,14 @@ #include #include #include -#include #include +#ifdef ENABLE_WINPR +#include +#else +#include "winpr-compat/stream.h" +#endif + #include #include "audio.h" diff --git a/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.h b/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.h index 12c5e717..55832a39 100644 --- a/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.h +++ b/src/protocols/rdp/guac_rdpsnd/rdpsnd_messages.h @@ -127,35 +127,35 @@ typedef struct guac_rdpsnd_pdu_header { * Handler for the SNDC_FORMATS (Server Audio Formats and Version) PDU. */ void guac_rdpsnd_formats_handler(guac_rdpsndPlugin* rdpsnd, - audio_stream* audio, STREAM* input_stream, + audio_stream* audio, wStream* input_stream, guac_rdpsnd_pdu_header* header); /** * Handler for the SNDC_TRAINING (Training) PDU. */ void guac_rdpsnd_training_handler(guac_rdpsndPlugin* rdpsnd, - audio_stream* audio, STREAM* input_stream, + audio_stream* audio, wStream* input_stream, guac_rdpsnd_pdu_header* header); /** * Handler for the SNDC_WAVE (WaveInfo) PDU. */ void guac_rdpsnd_wave_info_handler(guac_rdpsndPlugin* rdpsnd, - audio_stream* audio, STREAM* input_stream, + audio_stream* audio, wStream* input_stream, guac_rdpsnd_pdu_header* header); /** * Handler for the SNDWAV (Wave) PDU which follows any WaveInfo PDU. */ void guac_rdpsnd_wave_handler(guac_rdpsndPlugin* rdpsnd, - audio_stream* audio, STREAM* input_stream, + audio_stream* audio, wStream* input_stream, guac_rdpsnd_pdu_header* header); /** * Handler for the SNDC_CLOSE (Close) PDU. */ void guac_rdpsnd_close_handler(guac_rdpsndPlugin* rdpsnd, - audio_stream* audio, STREAM* input_stream, + audio_stream* audio, wStream* input_stream, guac_rdpsnd_pdu_header* header); #endif diff --git a/src/protocols/rdp/guac_rdpsnd/rdpsnd_service.h b/src/protocols/rdp/guac_rdpsnd/rdpsnd_service.h index d843d7f9..841cd872 100644 --- a/src/protocols/rdp/guac_rdpsnd/rdpsnd_service.h +++ b/src/protocols/rdp/guac_rdpsnd/rdpsnd_service.h @@ -129,7 +129,7 @@ void guac_rdpsnd_process_connect(rdpSvcPlugin* plugin); * Handler called when this plugin receives data along its designated channel. */ void guac_rdpsnd_process_receive(rdpSvcPlugin* plugin, - STREAM* input_stream); + wStream* input_stream); /** * Handler called when this plugin is being unloaded. diff --git a/src/protocols/rdp/winpr-compat/stream.h b/src/protocols/rdp/winpr-compat/stream.h new file mode 100644 index 00000000..13101e65 --- /dev/null +++ b/src/protocols/rdp/winpr-compat/stream.h @@ -0,0 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is libguac-client-rdp. + * + * The Initial Developer of the Original Code is + * Michael Jumper. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef __GUAC_WINPR_STREAM_COMPAT_H +#define __GUAC_WINPR_STREAM_COMPAT_H + +/* FreeRDP 1.0 streams */ + +#define Stream_Write_UINT8 stream_write_uint8 +#define wStream STREAM + +#endif +