rdpsnd-messages.h (4968B)
1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20#ifndef GUAC_RDP_CHANNELS_RDPSND_MESSAGES_H 21#define GUAC_RDP_CHANNELS_RDPSND_MESSAGES_H 22 23#include "channels/common-svc.h" 24 25#include <winpr/stream.h> 26 27/** 28 * The header common to all RDPSND PDUs. 29 */ 30typedef struct guac_rdpsnd_pdu_header { 31 32 /** 33 * The type of message represented by this PDU (SNDC_WAVE, etc.) 34 */ 35 int message_type; 36 37 /** 38 * The size of the remainder of the message. 39 */ 40 int body_size; 41 42} guac_rdpsnd_pdu_header; 43 44/** 45 * Handler for the SNDC_FORMATS (Server Audio Formats and Version) PDU. The 46 * SNDC_FORMATS PDU describes all audio formats supported by the RDP server, as 47 * well as the version of RDPSND implemented. 48 * 49 * @param svc 50 * The RDPSND channel receiving the SNDC_FORMATS PDU. 51 * 52 * @param input_stream 53 * The FreeRDP input stream containing the remaining raw bytes (after the 54 * common header) of the SNDC_FORMATS PDU. 55 * 56 * @param header 57 * The header content of the SNDC_FORMATS PDU. All RDPSND messages contain 58 * the same header information. 59 */ 60void guac_rdpsnd_formats_handler(guac_rdp_common_svc* svc, 61 wStream* input_stream, guac_rdpsnd_pdu_header* header); 62 63/** 64 * Handler for the SNDC_TRAINING (Training) PDU. The SNDC_TRAINING PDU is used 65 * to by RDP servers to test audio streaming latency, etc. without actually 66 * sending audio data. See: 67 * 68 * https://msdn.microsoft.com/en-us/library/cc240961.aspx 69 * 70 * @param svc 71 * The RDPSND channel receiving the SNDC_TRAINING PDU. 72 * 73 * @param input_stream 74 * The FreeRDP input stream containing the remaining raw bytes (after the 75 * common header) of the SNDC_TRAINING PDU. 76 * 77 * @param header 78 * The header content of the SNDC_TRAINING PDU. All RDPSND messages contain 79 * the same header information. 80 */ 81void guac_rdpsnd_training_handler(guac_rdp_common_svc* svc, 82 wStream* input_stream, guac_rdpsnd_pdu_header* header); 83 84/** 85 * Handler for the SNDC_WAVE (WaveInfo) PDU. The SNDC_WAVE immediately precedes 86 * a SNDWAV PDU and describes the data about to be received. It also (very 87 * strangely) contains exactly 4 bytes of audio data. The following SNDWAV PDU 88 * then contains 4 bytes of padding prior to the audio data where it would make 89 * perfect sense for this data to go. See: 90 * 91 * https://msdn.microsoft.com/en-us/library/cc240963.aspx 92 * 93 * @param svc 94 * The RDPSND channel receiving the SNDC_WAVE PDU. 95 * 96 * @param input_stream 97 * The FreeRDP input stream containing the remaining raw bytes (after the 98 * common header) of the SNDC_WAVE PDU. 99 * 100 * @param header 101 * The header content of the SNDC_WAVE PDU. All RDPSND messages contain 102 * the same header information. 103 */ 104void guac_rdpsnd_wave_info_handler(guac_rdp_common_svc* svc, 105 wStream* input_stream, guac_rdpsnd_pdu_header* header); 106 107/** 108 * Handler for the SNDWAV (Wave) PDU which follows any WaveInfo PDU. The SNDWAV 109 * PDU contains the actual audio data, less the four bytes of audio data 110 * included in the SNDC_WAVE PDU. 111 * 112 * @param svc 113 * The RDPSND channel receiving the SNDWAV PDU. 114 * 115 * @param input_stream 116 * The FreeRDP input stream containing the remaining raw bytes (after the 117 * common header) of the SNDWAV PDU. 118 * 119 * @param header 120 * The header content of the SNDWAV PDU. All RDPSND messages contain 121 * the same header information. 122 */ 123void guac_rdpsnd_wave_handler(guac_rdp_common_svc* svc, 124 wStream* input_stream, guac_rdpsnd_pdu_header* header); 125 126/** 127 * Handler for the SNDC_CLOSE (Close) PDU. This PDU is sent when audio 128 * streaming has stopped. This PDU is currently ignored by Guacamole. See: 129 * 130 * https://msdn.microsoft.com/en-us/library/cc240970.aspx 131 * 132 * @param svc 133 * The RDPSND channel receiving the SNDC_CLOSE PDU. 134 * 135 * @param input_stream 136 * The FreeRDP input stream containing the remaining raw bytes (after the 137 * common header) of the SNDC_CLOSE PDU. 138 * 139 * @param header 140 * The header content of the SNDC_CLOSE PDU. All RDPSND messages contain 141 * the same header information. 142 */ 143void guac_rdpsnd_close_handler(guac_rdp_common_svc* svc, 144 wStream* input_stream, guac_rdpsnd_pdu_header* header); 145 146#endif 147