Make audio buffers const.
This commit is contained in:
parent
bfbebe3c16
commit
6e3bbe38d5
@ -153,7 +153,7 @@ void guac_audio_stream_free(guac_audio_stream* audio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void guac_audio_stream_write_pcm(guac_audio_stream* audio,
|
void guac_audio_stream_write_pcm(guac_audio_stream* audio,
|
||||||
unsigned char* data, int length) {
|
const unsigned char* data, int length) {
|
||||||
|
|
||||||
/* Update counter */
|
/* Update counter */
|
||||||
audio->pcm_bytes_written += length;
|
audio->pcm_bytes_written += length;
|
||||||
@ -194,7 +194,7 @@ void guac_audio_stream_flush(guac_audio_stream* audio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void guac_audio_stream_write_encoded(guac_audio_stream* audio,
|
void guac_audio_stream_write_encoded(guac_audio_stream* audio,
|
||||||
unsigned char* data, int length) {
|
const unsigned char* data, int length) {
|
||||||
|
|
||||||
/* Resize audio buffer if necessary */
|
/* Resize audio buffer if necessary */
|
||||||
if (audio->encoded_data_used + length > audio->encoded_data_length) {
|
if (audio->encoded_data_used + length > audio->encoded_data_length) {
|
||||||
|
@ -63,7 +63,7 @@ typedef void guac_audio_encoder_end_handler(guac_audio_stream* audio);
|
|||||||
* Handler which is called when the audio stream is flushed.
|
* Handler which is called when the audio stream is flushed.
|
||||||
*/
|
*/
|
||||||
typedef void guac_audio_encoder_write_handler(guac_audio_stream* audio,
|
typedef void guac_audio_encoder_write_handler(guac_audio_stream* audio,
|
||||||
unsigned char* pcm_data, int length);
|
const unsigned char* pcm_data, int length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Arbitrary audio codec encoder.
|
* Arbitrary audio codec encoder.
|
||||||
@ -231,7 +231,7 @@ void guac_audio_stream_end(guac_audio_stream* stream);
|
|||||||
* @param length The number of bytes of PCM data provided.
|
* @param length The number of bytes of PCM data provided.
|
||||||
*/
|
*/
|
||||||
void guac_audio_stream_write_pcm(guac_audio_stream* stream,
|
void guac_audio_stream_write_pcm(guac_audio_stream* stream,
|
||||||
unsigned char* data, int length);
|
const unsigned char* data, int length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flushes the given audio stream.
|
* Flushes the given audio stream.
|
||||||
@ -251,7 +251,7 @@ void guac_audio_stream_flush(guac_audio_stream* stream);
|
|||||||
* @param length The number of bytes of data provided.
|
* @param length The number of bytes of data provided.
|
||||||
*/
|
*/
|
||||||
void guac_audio_stream_write_encoded(guac_audio_stream* audio,
|
void guac_audio_stream_write_encoded(guac_audio_stream* audio,
|
||||||
unsigned char* data, int length);
|
const unsigned char* data, int length);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void ogg_encoder_end_handler(guac_audio_stream* audio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ogg_encoder_write_handler(guac_audio_stream* audio,
|
void ogg_encoder_write_handler(guac_audio_stream* audio,
|
||||||
unsigned char* pcm_data, int length) {
|
const unsigned char* pcm_data, int length) {
|
||||||
|
|
||||||
/* Get state */
|
/* Get state */
|
||||||
ogg_encoder_state* state = (ogg_encoder_state*) audio->data;
|
ogg_encoder_state* state = (ogg_encoder_state*) audio->data;
|
||||||
|
@ -167,7 +167,7 @@ void wav_encoder_end_handler(guac_audio_stream* audio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wav_encoder_write_handler(guac_audio_stream* audio,
|
void wav_encoder_write_handler(guac_audio_stream* audio,
|
||||||
unsigned char* pcm_data, int length) {
|
const unsigned char* pcm_data, int length) {
|
||||||
|
|
||||||
/* Get state */
|
/* Get state */
|
||||||
wav_encoder_state* state = (wav_encoder_state*) audio->data;
|
wav_encoder_state* state = (wav_encoder_state*) audio->data;
|
||||||
|
Loading…
Reference in New Issue
Block a user