nxplayer: enqueue streaming data to audio driver.

audio offload playback, change data form to streaming.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
This commit is contained in:
qiaohaijiao1 2023-01-16 11:37:18 +08:00 committed by Xiang Xiao
parent bb8b5493e0
commit 20fb7e1898
4 changed files with 10 additions and 10 deletions

View File

@ -522,9 +522,9 @@ int nxplayer_parse_mp3(int fd, FAR uint32_t *samplerate,
int nxplayer_fill_mp3(int fd, FAR struct ap_buffer_s *apb);
/****************************************************************************
* Name: nxplayer_fill_pcm
* Name: nxplayer_fill_common
*
* Performs read pcm file to apb buffer
* Performs common function to read data to apb buffer
*
* Input Parameters:
* pplayer - Pointer to the context to initialize
@ -534,7 +534,7 @@ int nxplayer_fill_mp3(int fd, FAR struct ap_buffer_s *apb);
*
****************************************************************************/
int nxplayer_fill_pcm(int fd, FAR struct ap_buffer_s *apb);
int nxplayer_fill_common(int fd, FAR struct ap_buffer_s *apb);
#undef EXTERN
#ifdef __cplusplus

View File

@ -23,8 +23,8 @@ include $(APPDIR)/Make.defs
# NxPlayer Library
CSRCS = nxplayer.c
CSRCS += nxplayer_common.c
CSRCS += nxplayer_mp3.c
CSRCS += nxplayer_pcm.c
ifneq ($(CONFIG_NXPLAYER_COMMAND_LINE),)
PROGNAME = nxplayer

View File

@ -131,12 +131,12 @@ static const struct nxplayer_dec_ops_s g_dec_ops[] =
{
AUDIO_FMT_MP3,
nxplayer_parse_mp3,
nxplayer_fill_mp3
nxplayer_fill_common
},
{
AUDIO_FMT_PCM,
NULL,
nxplayer_fill_pcm
nxplayer_fill_common
}
};

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/system/nxplayer/nxplayer_pcm.c
* apps/system/nxplayer/nxplayer_common.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -38,13 +38,13 @@
****************************************************************************/
/****************************************************************************
* Name: nxplayer_fill_pcm
* Name: nxplayer_fill_common
*
* nxplayer_fill_pcm fill pcm data into apb buffer.
* nxplayer_fill_common fill data into apb buffer.
*
****************************************************************************/
int nxplayer_fill_pcm(int fd, FAR struct ap_buffer_s *apb)
int nxplayer_fill_common(int fd, FAR struct ap_buffer_s *apb)
{
/* Read data into the buffer. */