nuttx/audio: add offload buffer size config
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
This commit is contained in:
parent
31fe15b6e0
commit
45d41af6db
@ -319,6 +319,24 @@ endchoice
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
config SIM_OFFLOAD_NUM_BUFFERS
|
||||||
|
int "Number of offload buffers for audio processing"
|
||||||
|
default 2
|
||||||
|
---help---
|
||||||
|
Specifies the number of offload buffers to allocate for audio processing.
|
||||||
|
If Driver Specified buffer sizes is enabled (below), then the
|
||||||
|
low-level drivers will have the opportunity to override this
|
||||||
|
value.
|
||||||
|
|
||||||
|
config SIM_OFFLOAD_BUFFER_NUMBYTES
|
||||||
|
int "Size of each offload buffer for audio processing"
|
||||||
|
default 32767
|
||||||
|
---help---
|
||||||
|
Specifies the allocation size for each offload buffer
|
||||||
|
If Driver Specified buffer sizes is enabled (below), then the
|
||||||
|
low-level drivers will have the opportunity to override this
|
||||||
|
value.
|
||||||
|
|
||||||
config SIM_CAMERA
|
config SIM_CAMERA
|
||||||
bool "Simulated video support"
|
bool "Simulated video support"
|
||||||
depends on VIDEO
|
depends on VIDEO
|
||||||
|
@ -723,6 +723,12 @@ static int sim_audio_ioctl(struct audio_lowerhalf_s *dev, int cmd,
|
|||||||
struct ap_buffer_info_s *info =
|
struct ap_buffer_info_s *info =
|
||||||
(struct ap_buffer_info_s *)arg;
|
(struct ap_buffer_info_s *)arg;
|
||||||
|
|
||||||
|
if (priv->offload && priv->playback)
|
||||||
|
{
|
||||||
|
priv->nbuffers = CONFIG_SIM_OFFLOAD_NUM_BUFFERS;
|
||||||
|
priv->buffer_size = CONFIG_SIM_OFFLOAD_BUFFER_NUMBYTES;
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->ops && priv->ops->get_samples)
|
if (priv->ops && priv->ops->get_samples)
|
||||||
{
|
{
|
||||||
priv->buffer_size = MAX(priv->buffer_size,
|
priv->buffer_size = MAX(priv->buffer_size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user