summaryrefslogtreecommitdiffstats
path: root/include/freerdp/channels/audin.h
blob: 17254e650541214a6162ec84817d83acfa067634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
 * FreeRDP: A Remote Desktop Protocol Implementation
 * Audio Input Redirection Virtual Channel
 *
 * Copyright 2010-2011 Vic Lee
 * Copyright 2023 Pascal Nowack <Pascal.Nowack@gmx.de>
 *
 * Licensed 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 FREERDP_CHANNEL_AUDIN_H
#define FREERDP_CHANNEL_AUDIN_H

#include <freerdp/api.h>
#include <freerdp/codec/audio.h>
#include <freerdp/dvc.h>
#include <freerdp/types.h>

#define AUDIN_CHANNEL_NAME "audin"
#define AUDIN_DVC_CHANNEL_NAME "AUDIO_INPUT"

typedef struct
{
	BYTE MessageId;
} SNDIN_PDU;

typedef enum
{
	SNDIN_VERSION_Version_1 = 0x00000001,
	SNDIN_VERSION_Version_2 = 0x00000002,
} SNDIN_VERSION_Version;

typedef struct
{
	SNDIN_PDU Header;
	SNDIN_VERSION_Version Version;
} SNDIN_VERSION;

typedef struct
{
	SNDIN_PDU Header;
	UINT32 NumFormats;
	UINT32 cbSizeFormatsPacket;
	AUDIO_FORMAT* SoundFormats;
	size_t ExtraDataSize;
} SNDIN_FORMATS;

typedef enum
{
	SPEAKER_FRONT_LEFT = 0x00000001,
	SPEAKER_FRONT_RIGHT = 0x00000002,
	SPEAKER_FRONT_CENTER = 0x00000004,
	SPEAKER_LOW_FREQUENCY = 0x00000008,
	SPEAKER_BACK_LEFT = 0x00000010,
	SPEAKER_BACK_RIGHT = 0x00000020,
	SPEAKER_FRONT_LEFT_OF_CENTER = 0x00000040,
	SPEAKER_FRONT_RIGHT_OF_CENTER = 0x00000080,
	SPEAKER_BACK_CENTER = 0x00000100,
	SPEAKER_SIDE_LEFT = 0x00000200,
	SPEAKER_SIDE_RIGHT = 0x00000400,
	SPEAKER_TOP_CENTER = 0x00000800,
	SPEAKER_TOP_FRONT_LEFT = 0x00001000,
	SPEAKER_TOP_FRONT_CENTER = 0x00002000,
	SPEAKER_TOP_FRONT_RIGHT = 0x00004000,
	SPEAKER_TOP_BACK_LEFT = 0x00008000,
	SPEAKER_TOP_BACK_CENTER = 0x00010000,
	SPEAKER_TOP_BACK_RIGHT = 0x00020000,
} AUDIN_SPEAKER;

typedef struct
{
	union
	{
		UINT16 wValidBitsPerSample;
		UINT16 wSamplesPerBlock;
		UINT16 wReserved;
	} Samples;
	AUDIN_SPEAKER dwChannelMask;
	GUID SubFormat;
} WAVEFORMAT_EXTENSIBLE;

typedef struct
{
	SNDIN_PDU Header;
	UINT32 FramesPerPacket;
	UINT32 initialFormat;
	AUDIO_FORMAT captureFormat;
	WAVEFORMAT_EXTENSIBLE* ExtraFormatData;
} SNDIN_OPEN;

typedef struct
{
	SNDIN_PDU Header;
	UINT32 Result;
} SNDIN_OPEN_REPLY;

typedef struct
{
	SNDIN_PDU Header;
} SNDIN_DATA_INCOMING;

typedef struct
{
	SNDIN_PDU Header;
	wStream* Data;
} SNDIN_DATA;

typedef struct
{
	SNDIN_PDU Header;
	UINT32 NewFormat;
} SNDIN_FORMATCHANGE;

#endif /* FREERDP_CHANNEL_AUDIN_H */