Commit 444deb8a authored by g3gg0's avatar g3gg0
Browse files

mlv_snd: report back using ml-cbr when recording audio

--HG--
branch : unified
parent 543f54586359
......@@ -30,6 +30,7 @@
#include <beep.h>
#include <propvalues.h>
#include <raw.h>
#include "ml-cbr.h"
#include "../trace/trace.h"
#include "../mlv_rec/mlv.h"
......@@ -44,11 +45,6 @@ static CONFIG_INT("mlv.snd.bit.depth", mlv_snd_in_bits_per_sample, 16);
static CONFIG_INT("mlv.snd.sample.rate", mlv_snd_in_sample_rate, 48000);
static CONFIG_INT("mlv.snd.sample.rate.selection", mlv_snd_rate_sel, 0);
int mlv_snd_is_enabled()
{
return mlv_snd_enabled;
}
extern int StartASIFDMAADC(void *, uint32_t, void *, uint32_t, void (*)(), uint32_t);
extern int SetNextASIFADCBuffer(void *, uint32_t);
extern WEAK_FUNC(ret_0) int PowerAudioOutput();
......@@ -104,6 +100,20 @@ audio_data_t *mlv_snd_next_buffer = NULL;
static uint32_t mlv_snd_state = MLV_SND_STATE_IDLE;
/* this tells the audio backend that we are going to record sound */
static ml_cbr_action mlv_snd_snd_rec_cbr (const char *event, void *data)
{
uint32_t *status = (uint32_t*)data;
if(mlv_snd_enabled)
{
*status = 1;
return ML_CBR_STOP;
}
return ML_CBR_CONTINUE;
}
static void mlv_snd_asif_in_cbr()
{
/* the next buffer is now being filled, so update timestamp. do this first to be closer to real start. */
......@@ -633,6 +643,7 @@ MODULE_INFO_END()
MODULE_CBRS_START()
MODULE_CBR(CBR_VSYNC, mlv_snd_vsync, 0)
MODULE_NAMED_CBR("snd_rec_enabled", mlv_snd_snd_rec_cbr)
MODULE_CBRS_END()
MODULE_CONFIGS_START()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment