libguac  1.0.0
audio.h
Go to the documentation of this file.
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 
21 #ifndef __GUAC_AUDIO_H
22 #define __GUAC_AUDIO_H
23 
30 #include "audio-fntypes.h"
31 #include "audio-types.h"
32 #include "client-types.h"
33 #include "stream-types.h"
34 
36 
41  const char* mimetype;
42 
47 
53 
58 
63 
69 
70 };
71 
73 
78 
83 
88 
92  int rate;
93 
98  int channels;
99 
104  int bps;
105 
109  void* data;
110 
111 };
112 
154  guac_audio_encoder* encoder, int rate, int channels, int bps);
155 
182  guac_audio_encoder* encoder, int rate, int channels, int bps);
183 
198 
206 
222  const unsigned char* data, int length);
223 
233 
234 #endif
235 
void guac_audio_encoder_end_handler(guac_audio_stream *audio)
Handler which is called when the audio stream is closed.
Definition: audio-fntypes.h:54
int bps
The number of bits per sample per channel for PCM data.
Definition: audio.h:104
guac_audio_encoder_flush_handler * flush_handler
Handler which will be called when the audio stream is flushed.
Definition: audio.h:57
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:46
guac_audio_encoder * encoder
Arbitrary codec encoder which will receive raw PCM data.
Definition: audio.h:77
guac_audio_encoder_begin_handler * begin_handler
Handler which will be called when the audio stream is first created.
Definition: audio.h:46
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_audio_encoder_join_handler * join_handler
Handler which will be called when a new user joins the Guacamole connection associated with an audio ...
Definition: audio.h:68
void guac_audio_stream_add_user(guac_audio_stream *audio, guac_user *user)
Notifies the given audio stream that a user has joined the connection.
guac_client * client
The client associated with this audio stream.
Definition: audio.h:82
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:84
Representation of a physical connection within a larger logical connection which may be shared...
Definition: user.h:94
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:52
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...
void guac_audio_encoder_join_handler(guac_audio_stream *audio, guac_user *user)
Handler which is called when a new user has joined the Guacamole connection associated with the audio...
Definition: audio-fntypes.h:67
guac_stream * stream
The actual stream associated with this audio stream.
Definition: audio.h:87
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:109
Guacamole proxy client.
Definition: client.h:46
Type definitions related to simple streaming audio.
const char * mimetype
The mimetype of the audio data encoded by this audio encoder.
Definition: audio.h:41
Basic audio stream.
Definition: audio.h:72
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 at the client level 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:92
Arbitrary audio codec encoder.
Definition: audio.h:35
guac_audio_encoder_end_handler * end_handler
Handler which will be called when the audio stream is closed.
Definition: audio.h:62
Represents a single stream within the Guacamole protocol.
Definition: stream.h:32
int channels
The number of audio channels per sample of PCM data.
Definition: audio.h:98
void guac_audio_encoder_begin_handler(guac_audio_stream *audio)
Handler which is called when the audio stream is opened.
Definition: audio-fntypes.h:38