qiaohaijiao commented on code in PR #7717: URL: https://github.com/apache/nuttx/pull/7717#discussion_r1037151043
########## arch/sim/src/sim/sim_alsa.c: ########## @@ -31,17 +31,31 @@ #include <debug.h> #include <alsa/asoundlib.h> +#include <mad.h> /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ #define AUDMIN(a,b) ((a) > (b) ? (b) : (a)) +#define AUDCODEC_DEC 0x01 +#define AUDCODEC_ENC 0x10 /**************************************************************************** * Private Types ****************************************************************************/ +struct sim_codec_ops_s +{ + uint8_t format; + uint8_t flags; + void *(*init)(void); + int (*get_samples)(void *handle); + int (*process)(void *handle, unsigned char *in, unsigned int insize, + unsigned char *out, unsigned int *outsize); Review Comment: changed to `unsigned char **out`, and remove memcpy in pcm codec. but i think get_sample is necessary: 1, when playback, pcm from decoder wether write to alsa once time. 2, when capture, available pcm of alsa wether meet requirement of encoder. and each codec is different. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org