pkarashchenko commented on code in PR #1440: URL: https://github.com/apache/nuttx-apps/pull/1440#discussion_r1037706680
########## include/system/nxplayer.h: ########## @@ -39,6 +39,14 @@ * Public Type Declarations ****************************************************************************/ +struct nxplayer_dec_ops_s +{ + int format; + CODE int (*pre_parse)(int fd, uint32_t *samplerate, + uint8_t *chans, uint8_t *bps); Review Comment: ```suggestion CODE int (*pre_parse)(int fd, FAR uint32_t *samplerate, - FAR uint8_t *chans, FAR uint8_t *bps); ``` ########## include/system/nxplayer.h: ########## @@ -72,6 +80,8 @@ struct nxplayer_s uint16_t treble; /* Treble as a whole % */ uint16_t bass; /* Bass as a whole % */ #endif + + const struct nxplayer_dec_ops_s *ops; Review Comment: ```suggestion FAR const struct nxplayer_dec_ops_s *ops; ``` ########## system/nxplayer/nxplayer.c: ########## @@ -121,6 +131,27 @@ static const struct nxplayer_ext_fmt_s g_known_ext[] = static const int g_known_ext_count = sizeof(g_known_ext) / sizeof(struct nxplayer_ext_fmt_s); + +static const struct nxplayer_dec_ops_s g_dec_mp3 = +{ + AUDIO_FMT_MP3, + nxplayer_parse_mp3, + nxplayer_fill_mp3 +}; + +static const struct nxplayer_dec_ops_s g_dec_pcm = +{ + AUDIO_FMT_PCM, + NULL, + nxplayer_fill_pcm +}; + +static const struct nxplayer_dec_ops_s g_dec_s[] = Review Comment: can we use reference to `g_dec_pcm` and `g_dec_mp3` instead of copy? -- 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