From da6cebb6b0b17b4a75a2bd4f51b7cf70b5dafe40 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 2 May 2012 17:22:28 -0400 Subject: Use buflib for the allocation of voice PCM resources. Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3 --- firmware/export/mp3_playback.h | 3 +++ firmware/export/pcm_mixer.h | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'firmware/export') diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h index de27a2a46d..7434021611 100644 --- a/firmware/export/mp3_playback.h +++ b/firmware/export/mp3_playback.h @@ -27,7 +27,10 @@ #include /* callback fn */ +#ifndef MP3_PLAY_CALLBACK_DEFINED +#define MP3_PLAY_CALLBACK_DEFINED typedef void (*mp3_play_callback_t)(const void **start, size_t* size); +#endif /* functions formerly in mpeg.c */ void mp3_init(int volume, int bass, int treble, int balance, int loudness, diff --git a/firmware/export/pcm_mixer.h b/firmware/export/pcm_mixer.h index 6e1632d5ae..5d8deb2bbf 100644 --- a/firmware/export/pcm_mixer.h +++ b/firmware/export/pcm_mixer.h @@ -22,6 +22,8 @@ #ifndef PCM_MIXER_H #define PCM_MIXER_H +#include + /** Simple config **/ /* Length of PCM frames (always) */ @@ -111,6 +113,10 @@ const void * mixer_channel_get_buffer(enum pcm_mixer_channel channel, int *count void mixer_channel_calculate_peaks(enum pcm_mixer_channel channel, int *left, int *right); +/* Adjust channel pointer by a given offset to support movable buffers */ +void mixer_adjust_channel_address(enum pcm_mixer_channel channel, + off_t offset); + /* Stop ALL channels and PCM and reset state */ void mixer_reset(void); -- cgit v1.2.3