libguac  0.9.9
audio.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 "audio-fntypes.h"
34 #include "audio-types.h"
35 #include "client-types.h"
36 #include "stream-types.h"
37 
39 
44  const char* mimetype;
45 
50 
56 
61 
66 
67 };
68 
70 
75 
80 
85 
89  int rate;
90 
95  int channels;
96 
101  int bps;
102 
106  void* data;
107 
108 };
109 
141  guac_audio_encoder* encoder, int rate, int channels, int bps);
142 
169  guac_audio_encoder* encoder, int rate, int channels, int bps);
170 
178 
194  const unsigned char* data, int length);
195 
205 
206 #endif
207 
void guac_audio_encoder_end_handler(guac_audio_stream *audio)
Handler which is called when the audio stream is closed.
Definition: audio-fntypes.h:47
int bps
The number of bits per sample per channel for PCM data.
Definition: audio.h:101
guac_audio_encoder_flush_handler * flush_handler
Handler which will be called when the audio stream is flushed.
Definition: audio.h:60
void guac_audio_encoder_flush_handler(guac_audio_stream *audio)
Handler which is called when the audio stream needs to be flushed.
Definition: audio-fntypes.h:42
guac_audio_encoder * encoder
Arbitrary codec encoder which will receive raw PCM data.
Definition: audio.h:74
guac_audio_encoder_begin_handler * begin_handler
Handler which will be called when the audio stream is first created.
Definition: audio.h:49
Type definitions related to Guacamole protocol streams.
void guac_audio_stream_write_pcm(guac_audio_stream *stream, const unsigned char *data, int length)
Writes PCM data to the given audio stream.
Type definitions related to the Guacamole client structure, guac_client.
Function type definitions related to simple streaming audio.
guac_client * client
The client associated with this audio stream.
Definition: audio.h:79
void guac_audio_encoder_write_handler(guac_audio_stream *audio, const unsigned char *pcm_data, int length)
Handler which is called when PCM data is written to the audio stream.
Definition: audio-fntypes.h:52
guac_audio_encoder_write_handler * write_handler
Handler which will be called when PCM data is written to the audio stream for encoding.
Definition: audio.h:55
void guac_audio_stream_flush(guac_audio_stream *stream)
Flushes the underlying audio buffer, if any, ensuring that all audio previously written via guac_audi...
guac_stream * stream
The actual stream associated with this audio stream.
Definition: audio.h:84
void guac_audio_stream_free(guac_audio_stream *stream)
Closes and frees the given audio stream.
void * data
Encoder-specific state data.
Definition: audio.h:106
Guacamole proxy client.
Definition: client.h:94
Type definitions related to simple streaming audio.
const char * mimetype
The mimetype of the audio data encoded by this audio encoder.
Definition: audio.h:44
Basic audio stream.
Definition: audio.h:69
guac_audio_stream * guac_audio_stream_alloc(guac_client *client, guac_audio_encoder *encoder, int rate, int channels, int bps)
Allocates a new audio stream which encodes audio data using the given encoder.
void guac_audio_stream_reset(guac_audio_stream *audio, guac_audio_encoder *encoder, int rate, int channels, int bps)
Resets the given audio stream, switching to the given encoder, rate, channels, and bits per sample...
int rate
The number of samples per second of PCM data sent to this stream.
Definition: audio.h:89
Arbitrary audio codec encoder.
Definition: audio.h:38
guac_audio_encoder_end_handler * end_handler
Handler which will be called when the audio stream is closed.
Definition: audio.h:65
Represents a single stream within the Guacamole protocol.
Definition: stream.h:35
int channels
The number of audio channels per sample of PCM data.
Definition: audio.h:95
void guac_audio_encoder_begin_handler(guac_audio_stream *audio)
Handler which is called when the audio stream is opened.
Definition: audio-fntypes.h:37