1
0
Fork 0
forked from len0rd/rockbox

Refactor audio thread to run both recording and playback.

Eliminates the pcmrec thread and keeps playback and recording engine
operation mutually-exclusive.

audio_thread.c contains the audio thread which branches to the
correct engine depending upon the request. It also handles the main
audio initialization.

Moves pcm_init into main.c just before dsp_init because I don't want
that one in audio_init in the new file.

(Also makes revision df6e1bc pointless ;)

Change-Id: Ifc1db24404e6d8dd9ac42d9f4dfbc207aa9a26e1
This commit is contained in:
Michael Sevakis 2013-05-31 02:41:02 -04:00
parent df6e1bcce5
commit 5857c44017
11 changed files with 553 additions and 564 deletions

View file

@ -92,68 +92,6 @@ size_t audio_get_filebuflen(void);
otherwise the result is undefined. */
bool audio_automatic_skip(void);
/* Define one constant that includes recording related functionality */
#if defined(HAVE_RECORDING) && !defined(SIMULATOR)
#define AUDIO_HAVE_RECORDING
#endif
enum {
Q_NULL = 0, /* reserved */
/* -> audio */
Q_AUDIO_PLAY = 1,
Q_AUDIO_STOP,
Q_AUDIO_PAUSE,
Q_AUDIO_SKIP,
Q_AUDIO_PRE_FF_REWIND,
Q_AUDIO_FF_REWIND,
Q_AUDIO_FLUSH,
Q_AUDIO_DIR_SKIP,
/* pcmbuf -> audio */
Q_AUDIO_TRACK_CHANGED,
/* audio -> audio */
Q_AUDIO_FILL_BUFFER, /* continue buffering next track */
/* buffering -> audio */
Q_AUDIO_BUFFERING, /* some buffer event */
Q_AUDIO_FINISH_LOAD_TRACK, /* metadata is buffered */
Q_AUDIO_HANDLE_FINISHED, /* some other type is buffered */
/* codec -> audio (*) */
Q_AUDIO_CODEC_SEEK_COMPLETE,
Q_AUDIO_CODEC_COMPLETE,
/* audio -> codec */
Q_CODEC_LOAD,
Q_CODEC_RUN,
Q_CODEC_PAUSE,
Q_CODEC_SEEK,
Q_CODEC_STOP,
Q_CODEC_UNLOAD,
/*- miscellanous -*/
#ifdef AUDIO_HAVE_RECORDING
/* -> codec */
Q_AUDIO_LOAD_ENCODER, /* load an encoder for recording */
#endif
/* -> codec */
Q_CODEC_DO_CALLBACK,
/*- settings -*/
#ifdef HAVE_DISK_STORAGE
/* -> audio */
Q_AUDIO_UPDATE_WATERMARK, /* buffering watermark needs updating */
#endif
/* -> audio */
Q_AUDIO_REMAKE_AUDIO_BUFFER, /* buffer needs to be reinitialized */
};
/* (*) If you change these, you must check audio_clear_track_notifications
in playback.c for correctness */
unsigned int playback_status(void);
#endif /* _PLAYBACK_H */