libguac
0.9.0
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
guacamole
audio.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2013 Glyptodon LLC
3
*
4
* Permission is hereby granted, free of charge, to any person obtaining a copy
5
* of this software and associated documentation files (the "Software"), to deal
6
* in the Software without restriction, including without limitation the rights
7
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
* copies of the Software, and to permit persons to whom the Software is
9
* furnished to do so, subject to the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included in
12
* all copies or substantial portions of the Software.
13
*
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
* THE SOFTWARE.
21
*/
22
23
24
#ifndef __GUAC_AUDIO_H
25
#define __GUAC_AUDIO_H
26
33
#include <
guacamole/client.h
>
34
#include <
guacamole/stream.h
>
35
36
typedef
struct
guac_audio_stream
guac_audio_stream
;
37
41
typedef
void
guac_audio_encoder_begin_handler
(
guac_audio_stream
* audio);
42
46
typedef
void
guac_audio_encoder_end_handler
(
guac_audio_stream
* audio);
47
51
typedef
void
guac_audio_encoder_write_handler
(
guac_audio_stream
* audio,
52
const
unsigned
char
*
pcm_data
,
int
length
);
53
57
typedef
struct
guac_audio_encoder
{
58
63
const
char
*
mimetype
;
64
68
guac_audio_encoder_begin_handler
*
begin_handler
;
69
73
guac_audio_encoder_write_handler
*
write_handler
;
74
78
guac_audio_encoder_end_handler
*
end_handler
;
79
80
}
guac_audio_encoder
;
81
87
struct
guac_audio_stream
{
88
92
unsigned
char
*
pcm_data
;
93
97
int
used
;
98
102
int
length
;
103
107
unsigned
char
*
encoded_data
;
108
112
int
encoded_data_used
;
113
117
int
encoded_data_length
;
118
123
guac_audio_encoder
*
encoder
;
124
128
guac_client
*
client
;
129
133
guac_stream
*
stream
;
134
138
int
rate
;
139
144
int
channels
;
145
150
int
bps
;
151
155
int
pcm_bytes_written
;
156
160
void
*
data
;
161
162
};
163
178
guac_audio_stream
*
guac_audio_stream_alloc
(
guac_client
* client,
179
guac_audio_encoder
* encoder);
180
186
void
guac_audio_stream_free
(
guac_audio_stream
* stream);
187
198
void
guac_audio_stream_begin
(
guac_audio_stream
* stream,
int
rate,
int
channels,
int
bps);
199
207
void
guac_audio_stream_end
(
guac_audio_stream
* stream);
208
219
void
guac_audio_stream_write_pcm
(
guac_audio_stream
* stream,
220
const
unsigned
char
* data,
int
length);
221
227
void
guac_audio_stream_flush
(
guac_audio_stream
* stream);
228
239
void
guac_audio_stream_write_encoded
(
guac_audio_stream
* audio,
240
const
unsigned
char
* data,
int
length);
241
242
#endif
243
Generated on Fri Mar 28 2014 11:53:04 for libguac by
1.8.1.2