00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef __GUAC_AUDIO_H
00039 #define __GUAC_AUDIO_H
00040
00041 #include <guacamole/client.h>
00042 #include <guacamole/stream.h>
00043
00050 typedef struct guac_audio_stream guac_audio_stream;
00051
00055 typedef void guac_audio_encoder_begin_handler(guac_audio_stream* audio);
00056
00060 typedef void guac_audio_encoder_end_handler(guac_audio_stream* audio);
00061
00065 typedef void guac_audio_encoder_write_handler(guac_audio_stream* audio,
00066 const unsigned char* pcm_data, int length);
00067
00071 typedef struct guac_audio_encoder {
00072
00077 const char* mimetype;
00078
00082 guac_audio_encoder_begin_handler* begin_handler;
00083
00087 guac_audio_encoder_write_handler* write_handler;
00088
00092 guac_audio_encoder_end_handler* end_handler;
00093
00094 } guac_audio_encoder;
00095
00101 struct guac_audio_stream {
00102
00106 unsigned char* pcm_data;
00107
00111 int used;
00112
00116 int length;
00117
00121 unsigned char* encoded_data;
00122
00126 int encoded_data_used;
00127
00131 int encoded_data_length;
00132
00137 guac_audio_encoder* encoder;
00138
00142 guac_client* client;
00143
00147 guac_stream* stream;
00148
00152 int rate;
00153
00158 int channels;
00159
00164 int bps;
00165
00169 int pcm_bytes_written;
00170
00174 void* data;
00175
00176 };
00177
00192 guac_audio_stream* guac_audio_stream_alloc(guac_client* client,
00193 guac_audio_encoder* encoder);
00194
00200 void guac_audio_stream_free(guac_audio_stream* stream);
00201
00212 void guac_audio_stream_begin(guac_audio_stream* stream, int rate, int channels, int bps);
00213
00221 void guac_audio_stream_end(guac_audio_stream* stream);
00222
00233 void guac_audio_stream_write_pcm(guac_audio_stream* stream,
00234 const unsigned char* data, int length);
00235
00241 void guac_audio_stream_flush(guac_audio_stream* stream);
00242
00253 void guac_audio_stream_write_encoded(guac_audio_stream* audio,
00254 const unsigned char* data, int length);
00255
00256 #endif
00257