mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Make PCM->driver interface about as simple as it will get. Registered callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6688988ec4
commit
d56999890f
19 changed files with 277 additions and 460 deletions
|
|
@ -74,18 +74,13 @@ static void dma_callback(void)
|
|||
{
|
||||
if(!dma_size)
|
||||
{
|
||||
register pcm_more_callback_type get_more = pcm_callback_for_more;
|
||||
if(get_more)
|
||||
get_more(&dma_start_addr, &dma_size);
|
||||
pcm_play_get_more_callback(&dma_start_addr, &dma_size);
|
||||
|
||||
if (!dma_size)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!dma_size)
|
||||
{
|
||||
pcm_play_dma_stop();
|
||||
pcm_play_dma_stopped_callback();
|
||||
}
|
||||
else
|
||||
play_start_pcm();
|
||||
play_start_pcm();
|
||||
}
|
||||
|
||||
void pcm_play_dma_start(const void *addr, size_t size)
|
||||
|
|
@ -275,31 +270,19 @@ static void rec_dma_callback(void)
|
|||
|
||||
if(!rec_dma_size)
|
||||
{
|
||||
register pcm_more_callback_type2 more_ready = pcm_callback_more_ready;
|
||||
if (!more_ready || more_ready(0) < 0)
|
||||
pcm_rec_more_ready_callback(0, &rec_dma_start_addr, &rec_dma_size);
|
||||
|
||||
if(rec_dma_size != 0)
|
||||
{
|
||||
/* Finished recording */
|
||||
pcm_rec_dma_stop();
|
||||
pcm_rec_dma_stopped_callback();
|
||||
return;
|
||||
dump_dcache_range(rec_dma_start_addr, rec_dma_size);
|
||||
#if CONFIG_CPU == AS3525
|
||||
mono_samples = AS3525_UNCACHED_ADDR(rec_dma_start_addr);
|
||||
#endif
|
||||
rec_dma_start();
|
||||
}
|
||||
}
|
||||
|
||||
rec_dma_start();
|
||||
}
|
||||
|
||||
|
||||
void pcm_rec_dma_record_more(void *start, size_t size)
|
||||
{
|
||||
dump_dcache_range(start, size);
|
||||
rec_dma_start_addr = start;
|
||||
#if CONFIG_CPU == AS3525
|
||||
mono_samples = AS3525_UNCACHED_ADDR(start);
|
||||
#endif
|
||||
rec_dma_size = size;
|
||||
}
|
||||
|
||||
|
||||
void pcm_rec_dma_stop(void)
|
||||
{
|
||||
dma_disable_channel(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue