xref: /OK3568_Linux_fs/external/common_algorithm/misc/include/audio_server.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  * Copyright (c) 2020 Rockchip Electronics Co., Ltd
5  */
6 
7 #ifndef _AUDIO_SERVER_H_
8 #define _AUDIO_SERVER_H_
9 
10 #ifndef bool
11 #define bool    _Bool
12 #endif
13 
14 #define    AUDIO_SERVER_DATA_SHARE_MAX 2
15 
16 typedef void *audio_player_semaphore_handle;
17 typedef void *audio_player_mutex_handle;
18 typedef void *audio_player_thread_handle;
19 typedef void *audio_player_timer_handle;
20 
21 typedef struct audio_player_queue audio_player_queue_t;
22 typedef struct audio_player_stream audio_player_stream_t;
23 
24 typedef struct player *player_handle_t;
25 typedef int (*decode_input_t)(void *userdata, char *data, size_t data_len);
26 typedef int (*decode_output_t)(void *userdata, char *data, size_t data_len);
27 typedef int (*decode_post_t)(void *userdata, int samplerate, int bits, int channels);
28 
29 typedef struct recorder *recorder_handle_t;
30 typedef int (*encode_input_t)(void *userdata, char *data, size_t data_len);
31 typedef int (*encode_output_t)(void *userdata, const char *data, size_t data_len);
32 typedef int (*encode_post_t)(void *userdata, int samplerate, int bits, int channels);
33 
34 typedef short ssrc_type;
35 
36 /***************************** enum definition **************************/
37 
38 /**
39  * enum audio_data_type for codec select
40  */
41 typedef enum
42 {
43     TYPE_AUDIO_MP3_DEC,
44     TYPE_AUDIO_AMR_DEC,
45     TYPE_AUDIO_AMR_ENC,
46     TYPE_AUDIO_SPEEX_ENC,
47 
48     TYPE_DATA_MAX
49 } audio_data_type;
50 
51 /**
52  * enum MSGBOX_SYSTEM_CMD for function select
53  */
54 typedef enum _MSGBOX_SYSTEM_CMD
55 {
56     MEDIA_MSGBOX_CMD_DECODE_OPEN,
57     MEDIA_MSGBOX_CMD_DECODE_OPEN_CMPL,
58 
59     MEDIA_MSGBOX_CMD_DECODE,
60     MEDIA_MSGBOX_CMD_DECODE_CMPL,
61 
62     MEDIA_MSGBOX_CMD_DECODE_CLOSE,
63     MEDIA_MSGBOX_CMD_DECODE_CLOSE_CMPL,
64 
65     MEDIA_MSGBOX_CMD_ENCODE_OPEN,
66     MEDIA_MSGBOX_CMD_ENCODE_OPEN_CMPL,
67 
68     MEDIA_MSGBOX_CMD_ENCODE,
69     MEDIA_MSGBOX_CMD_ENCODE_CMPL,
70 
71     MEDIA_MSGBOX_CMD_ENCODE_FINISH,
72     MEDIA_MSGBOX_CMD_ENCODE_FINISH_CMPL,
73 
74     MEDIA_MSGBOX_CMD_ENCODE_CLOSE,
75     MEDIA_MSGBOX_CMD_ENCODE_CLOSE_CMPL,
76 
77     MEDIA_MSGBOX_CMD_ASR_OPEN,
78     MEDIA_MSGBOX_CMD_ASR_OPEN_CMPL,
79 
80     MEDIA_MSGBOX_CMD_ASR_PROCESS,
81     MEDIA_MSGBOX_CMD_ASR_PROCESS_CMPL,
82 
83     MEDIA_MSGBOX_CMD_ASR_CLOSE,
84     MEDIA_MSGBOX_CMD_ASR_CLOSE_CMPL,
85 
86     MEDIA_MSGBOX_CMD_MAX,
87 
88 } MSGBOX_SYSTEM_CMD;
89 
90 /**
91  * enum play_decoder_error_t
92  */
93 typedef enum
94 {
95     PLAY_DECODER_SUCCESS = 0,
96     PLAY_DECODER_INPUT_ERROR,
97     PLAY_DECODER_OUTPUT_ERROR,
98     PLAY_DECODER_DECODE_ERROR,
99 } play_decoder_error_t;
100 
101 /**
102  * enum play_info_t for player callback
103  */
104 typedef enum
105 {
106     PLAY_INFO_SUCCESS = 0,
107     PLAY_INFO_PREPROCESS,
108     PLAY_INFO_DECODE,
109     PLAY_INFO_PAUSED,
110     PLAY_INFO_RESUMED,
111     PLAY_INFO_IDLE,
112     PLAY_INFO_STOP,
113 } play_info_t;
114 
115 /**
116  * enum player_state_t for player state
117  */
118 typedef enum
119 {
120     PLAYER_STATE_IDLE = 0,
121     PLAYER_STATE_RUNNING,
122     PLAYER_STATE_PAUSED,
123     PLAYER_STATE_ERROR,
124     PLAYER_STATE_STOP
125 } player_state_t;
126 
127 /**
128  * enum play_freq_info_t
129  * @UNUSED
130  */
131 typedef enum
132 {
133     PLAY_FREQ_NULL = 0,
134     PLAY_FREQ_LOCALPLAY,
135     PLAY_FREQ_NETPLAY,
136     PLAY_FREQ_MAX,
137 } play_freq_info_t;
138 
139 /**
140  * enum record_encoder_error_t
141  */
142 typedef enum
143 {
144     RECORD_ENCODER_SUCCESS = 0,
145     RECORD_ENCODER_INPUT_ERROR,
146     RECORD_ENCODER_OUTPUT_ERROR,
147     RECORD_ENCODER_ENCODE_ERROR,
148 } record_encoder_error_t;
149 
150 /**
151  * enum record_info_t for recorder callback
152  */
153 typedef enum
154 {
155     RECORD_INFO_SUCCESS = 0,
156     RECORD_INFO_WRITER,
157     RECORD_INFO_ENCODE,
158     RECORD_INFO_PAUSED,
159     RECORD_INFO_RESUMED,
160     RECORD_INFO_IDLE,
161     RECORD_INFO_STOP,
162 } record_info_t;
163 
164 /**
165  * enum recorder_state_t for recorder state
166  */
167 typedef enum
168 {
169     RECORDER_STATE_IDLE = 0,
170     RECORDER_STATE_RUNNING,
171     RECORDER_STATE_PAUSED
172 } recorder_state_t;
173 
174 /**
175  * enum record_freq_info_t
176  * @UNUSED
177  */
178 typedef enum
179 {
180     RECORD_FREQ_NULL = 0,
181     RECORD_FREQ_LOCAL,
182     RECORD_FREQ_MAX,
183 } record_freq_info_t;
184 
185 /**
186  * enum media_sdk_msg_type_t for queue msg
187  */
188 typedef enum
189 {
190     CMD_RECORDER_START,
191     CMD_RECORDER_STOP,
192     CMD_PLAYER_PLAY,
193     CMD_PLAYER_SEEK,
194 } media_sdk_msg_type_t;
195 
196 /**
197  * enum media_sdk_msg_type_t for queue msg
198  */
199 typedef enum
200 {
201     PLAY_MODE_PROMPT = 0,
202     RECORD_MODE_PROMPT,
203 } media_sdk_play_mode_t;
204 
205 /***************************** struct definition **************************/
206 
207 /**
208  * struct audio_config
209  */
210 struct audio_config
211 {
212     int sample_rate;
213     int bits;
214     int channels;
215     int32_t bitrate;
216 };
217 
218 /**
219  * struct audio_server_data_share
220  */
221 struct audio_server_data_share
222 {
223     size_t type;
224     size_t dat[AUDIO_SERVER_DATA_SHARE_MAX];
225 };
226 
227 /**
228  * struct wav_header
229  */
230 struct wav_header
231 {
232     char chunk_id[4];   //The "RIFF" chunk descriptor
233     uint32_t chunk_size;
234     char format[4];     //"WAVE"
235 
236     char subchunk1_id[4];//"fmt "
237     uint32_t subchunk1_size;
238     uint16_t audio_format;
239     uint16_t num_channels;
240     uint32_t samplerate;
241     uint32_t byterate;
242     uint16_t block_align;
243     uint16_t bits_per_sample;
244 
245     char subchunk2_id[4];//"data"
246     uint32_t subchunk2_size;
247 };
248 
249 /**
250  * struct playback_device_cfg_t
251  */
252 typedef struct playback_device_cfg
253 {
254     int samplerate;
255     int bits;
256     int channels;
257     const char *card_name;
258     const char *device_name;
259     int frame_size;
260 } playback_device_cfg_t;
261 
262 /**
263  * struct playback_device_t
264  */
265 typedef struct playback_device
266 {
267     int (*open)(struct playback_device *self, playback_device_cfg_t *cfg);
268     int (*start)(struct playback_device *self);
269     int (*write)(struct playback_device *self, const char *data, size_t data_len);
270     int (*stop)(struct playback_device *self);
271     int (*abort)(struct playback_device *self);
272     void (*close)(struct playback_device *self);
273     void *userdata;
274 } playback_device_t;
275 
276 /**
277  * struct play_preprocessor_cfg_t
278  */
279 typedef struct play_preprocessor_cfg
280 {
281     char *target;
282     const char *tag;
283     int frame_size;
284     char type[32];
285     char isOta;
286     uint32_t seek_pos;
287     uint32_t file_size;
288 } play_preprocessor_cfg_t;
289 
290 /**
291  * struct play_preprocessor_t
292  */
293 typedef struct play_preprocessor
294 {
295     const char *type;
296     int (*init)(struct play_preprocessor *self, play_preprocessor_cfg_t *cfg);
297     int (*read)(struct play_preprocessor *self, char *data, size_t data_len);
298     int (*seek)(struct play_preprocessor *self, play_preprocessor_cfg_t *cfg);
299     void (*destroy)(struct play_preprocessor *self);
300     void *userdata;
301 } play_preprocessor_t;
302 
303 /**
304  * struct play_decoder_cfg_t
305  */
306 typedef struct play_decoder_cfg
307 {
308     decode_input_t input;
309     decode_output_t output;
310     decode_post_t post;
311     uint32_t start_time;
312     void *userdata;
313 } play_decoder_cfg_t;
314 
315 /**
316  * struct play_decoder_cfg_t
317  */
318 typedef struct play_decoder
319 {
320     struct play_decoder *next;
321     uint8_t support_seek;
322     char *type;
323 #if  CONFIG_FWANALYSIS_SEGMENT
324     char segment;
325 #endif
326     int (*check)(char *buf, int len);
327     int (*init)(struct play_decoder *self, play_decoder_cfg_t *cfg);
328     play_decoder_error_t (*process)(struct play_decoder *self);
329     bool (*get_post_state)(struct play_decoder *self);
330     void (*destroy)(struct play_decoder *self);
331     void *userdata;
332 } play_decoder_t;
333 
334 /**
335  * struct player_cfg_t for player_create
336  */
337 typedef void (*player_listen_cb)(player_handle_t self, play_info_t info, void *userdata);
338 typedef struct player_cfg
339 {
340     const char *tag;
341     char *name;
342     playback_device_t device;
343     size_t preprocess_buf_size;
344     size_t decode_buf_size;
345     uint32_t preprocess_stack_size;
346     uint32_t decoder_stack_size;
347     uint32_t playback_stack_size;
348 
349     player_listen_cb listen;
350     int resample_rate;
351     int out_ch;
352     int diff_out;
353     void *userdata;
354 } player_cfg_t;
355 
356 /**
357  * struct play_cfg_t for player_play
358  */
359 typedef struct play_cfg
360 {
361     char *target;
362     bool need_free;
363     play_preprocessor_t preprocessor;
364 
365     int samplerate;
366     int bits;
367     int channels;
368     uint32_t start_time;
369 
370     int freq_t;
371     int enable_reverb;
372     int enable_mix;
373     int info_only;
374 } play_cfg_t;
375 
376 /**
377  * struct record_encoder_cfg_t
378  */
379 typedef struct record_encoder_cfg
380 {
381     encode_input_t input;
382     encode_output_t output;
383     encode_post_t post;
384     int header_size;
385     void *userdata;
386 } record_encoder_cfg_t;
387 
388 /**
389  * struct record_encoder_cfg_t
390  */
391 typedef struct record_encoder
392 {
393     struct record_encoder *next;
394     char *type;
395     int (*init)(struct record_encoder *self, record_encoder_cfg_t *cfg);
396     record_encoder_error_t (*process)(struct record_encoder *self);
397     bool (*get_post_state)(struct record_encoder *self);
398     void (*destroy)(struct record_encoder *self);
399     void *userdata;
400 } record_encoder_t;
401 
402 /**
403  * struct capture_device_cfg_t
404  */
405 typedef struct capture_device_cfg
406 {
407     int samplerate;
408     int bits;
409     int channels;
410     const char *device_name;
411     int frame_size;
412 } capture_device_cfg_t;
413 
414 /**
415  * struct capture_device_t
416  */
417 typedef struct capture_device
418 {
419     int (*open)(struct capture_device *self, capture_device_cfg_t *cfg);
420     int (*start)(struct capture_device *self);
421     int (*read)(struct capture_device *self, const char *data, size_t data_len);
422     int (*stop)(struct capture_device *self);
423     int (*abort)(struct capture_device *self);
424     int (*close)(struct capture_device *self);
425     void *userdata;
426 } capture_device_t;
427 
428 /**
429  * struct recorder_cfg_t for recorder_create
430  */
431 typedef void (*recorder_listen_cb)(recorder_handle_t self, record_info_t info, void *userdata);
432 typedef struct recorder_cfg
433 {
434     const char *tag;
435     char *device_name;
436     capture_device_t device;
437     size_t record_buf_size;
438     size_t encode_buf_size;
439     uint32_t recordr_stack_size;
440     uint32_t encoder_stack_size;
441     uint32_t writer_stack_size;
442 
443     recorder_listen_cb listen;
444     void *userdata;
445 } recorder_cfg_t;
446 
447 /**
448  * struct record_writer_cfg_t
449  */
450 typedef struct record_writer_cfg
451 {
452     char *target;
453     const char *tag;
454     int frame_size;
455     char type[32];
456 } record_writer_cfg_t;
457 
458 /**
459  * struct record_writer_t
460  */
461 typedef struct record_writer
462 {
463     const char *type;
464     int (*init)(struct record_writer *self, record_writer_cfg_t *cfg);
465     int (*write)(struct record_writer *self, char *data, size_t data_len);
466     void (*destroy)(struct record_writer *self);
467     void *fd;
468     uint32_t out_bytes;
469     void *userdata;
470 } record_writer_t;
471 
472 /**
473  * struct record_cfg_t for recorder_record
474  */
475 typedef struct record_cfg
476 {
477     char *target;
478     char *type;
479     bool need_free;
480     record_writer_t writer;
481 
482     int samplerate;
483     int bits;
484     int channels;
485     long duration;
486 
487     int freq_t;
488 } record_cfg_t;
489 
490 /**
491  * struct media_sdk_msg_t for queue msg
492  */
493 typedef struct media_sdk_msg
494 {
495     media_sdk_msg_type_t type;
496     union
497     {
498         struct
499         {
500             media_sdk_play_mode_t mode;
501             char *target;
502             char *type;
503             bool need_free;
504             uint32_t seek_pos;
505             bool end_session;
506             char *priv_data;
507         } player;
508         struct
509         {
510             media_sdk_play_mode_t mode;
511             char *target;
512             char *type;
513             bool need_free;
514             record_writer_t writer;
515             bool end_session;
516             char *priv_data;
517         } recorder;
518     };
519 } media_sdk_msg_t;
520 
521 /***************************** Function Declare ******************************/
522 
523 /* *
524  * Player Funtions
525  */
526 uint32_t player_get_target_and_seek(char *file_name);
527 uint32_t player_get_target(player_handle_t self, char *file_name);
528 void player_set_seek(long offset);
529 int player_init(void);
530 int player_list_decoder(void);
531 int player_register_decoder(const char *type, play_decoder_t *decoder);
532 int player_unregister_decoder(const char *type);
533 int player_register_mp3dec(void);
534 int player_register_amrdec(void);
535 int player_register_apedec(void);
536 player_handle_t player_create(player_cfg_t *cfg);
537 int player_play(player_handle_t self, play_cfg_t *cfg);
538 player_state_t player_get_state(player_handle_t self);
539 int player_stop(player_handle_t self);
540 int player_device_stop(player_handle_t self, int wait);
541 int player_pause(player_handle_t self);
542 int player_resume(player_handle_t self);
543 int player_wait_idle(player_handle_t self);
544 int player_close(player_handle_t self);
545 void player_destroy(player_handle_t self);
546 void player_deinit(void);
547 
548 int player_get_cur_time(player_handle_t self);
549 void player_set_total_time(player_handle_t self, uint32_t time);
550 uint32_t player_get_total_time(player_handle_t self);
551 uint32_t player_get_file_length(player_handle_t self);
552 int player_preprocess_seek(player_handle_t self, uint32_t pos);
553 
554 int playback_device_open_impl(playback_device_t *self, playback_device_cfg_t *cfg);
555 int playback_device_start_impl(playback_device_t *self);
556 int playback_set_volume(int vol);
557 int playback_device_write_impl(playback_device_t *self, const char *data, size_t data_len);
558 int playback_device_stop_impl(playback_device_t *self);
559 int playback_device_abort_impl(playback_device_t *self);
560 void playback_device_close_impl(playback_device_t *self);
561 
562 #define DEFAULT_PLAYBACK_DEVICE { \
563     .open = playback_device_open_impl, \
564     .start = playback_device_start_impl, \
565     .write = playback_device_write_impl, \
566     .stop = playback_device_stop_impl, \
567     .abort = playback_device_abort_impl, \
568     .close = playback_device_close_impl, \
569 }
570 
571 int file_preprocessor_init_impl(play_preprocessor_t *self, play_preprocessor_cfg_t *cfg);
572 int file_preprocessor_read_impl(play_preprocessor_t *self, char *data, size_t data_len);
573 int file_preprocessor_seek_impl(play_preprocessor_t *self, play_preprocessor_cfg_t *cfg);
574 void file_preprocessor_destroy_impl(play_preprocessor_t *self);
575 
576 #define DEFAULT_FILE_PREPROCESSOR { \
577     .type = "file", \
578     .init = file_preprocessor_init_impl, \
579     .read = file_preprocessor_read_impl, \
580     .seek = file_preprocessor_seek_impl, \
581     .destroy = file_preprocessor_destroy_impl \
582 }
583 
584 int http_preprocessor_init_impl(play_preprocessor_t *self, play_preprocessor_cfg_t *cfg);
585 int http_preprocessor_read_impl(play_preprocessor_t *self, char *data, size_t data_len);
586 int http_preprocessor_seek_impl(play_preprocessor_t *self, play_preprocessor_cfg_t *cfg);
587 void http_preprocessor_destroy_impl(play_preprocessor_t *self);
588 
589 #define DEFAULT_HTTP_PREPROCESSOR { \
590     .type = "http", \
591     .init = http_preprocessor_init_impl, \
592     .read = http_preprocessor_read_impl, \
593     .seek = http_preprocessor_seek_impl, \
594     .destroy = http_preprocessor_destroy_impl \
595 }
596 
597 /**
598  * Recorder Funtions
599  */
600 recorder_handle_t recorder_create(recorder_cfg_t *cfg);
601 int recorder_init(void);
602 int recorder_list_encoder(void);
603 int recorder_register_encoder(const char *type, record_encoder_t *encoder);
604 int recorder_unregister_encoder(const char *type);
605 int recorder_register_amrenc(void);
606 int recorder_record(recorder_handle_t self, record_cfg_t *cfg);
607 uint32_t recorder_get_cur_time(recorder_handle_t self);
608 recorder_state_t recorder_get_state(recorder_handle_t self);
609 int recorder_stop(recorder_handle_t self);
610 int recorder_wait_idle(recorder_handle_t self);
611 int recorder_close(recorder_handle_t self);
612 void recorder_destroy(recorder_handle_t self);
613 void recorder_deinit(void);
614 
615 int capture_device_open_impl(capture_device_t *self, capture_device_cfg_t *cfg);
616 int capture_device_start_impl(capture_device_t *self);
617 int capture_device_read_impl(capture_device_t *self, const char *data, size_t data_len);
618 int capture_device_stop_impl(capture_device_t *self);
619 int capture_device_abort_impl(capture_device_t *self);
620 int capture_device_close_impl(capture_device_t *self);
621 
622 #define DEFAULT_CAPTURE_DEVICE { \
623         .open = capture_device_open_impl, \
624         .start = capture_device_start_impl, \
625         .read = capture_device_read_impl, \
626         .stop = capture_device_stop_impl, \
627         .abort = capture_device_abort_impl, \
628         .close = capture_device_close_impl, \
629     }
630 
631 int file_writer_init_impl(record_writer_t *self, record_writer_cfg_t *cfg);
632 int file_writer_write_impl(record_writer_t *self, char *data, size_t data_len);
633 void file_writer_destroy_impl(record_writer_t *self);
634 
635 #define DEFAULT_FILE_WRITER { \
636         .type = "file", \
637         .init = file_writer_init_impl, \
638         .write = file_writer_write_impl, \
639         .destroy = file_writer_destroy_impl \
640     }
641 struct audio_player_queue *audio_queue_create(size_t item_count, size_t item_size);
642 int audio_queue_send(struct audio_player_queue *self, const void *data);
643 int audio_queue_send_font(struct audio_player_queue *self, const void *data);
644 int audio_queue_receive(struct audio_player_queue *self, void *data);
645 int audio_queue_receive_back(struct audio_player_queue *self, void *data);
646 int audio_queue_stop(struct audio_player_queue *self);
647 bool audio_queue_is_full(struct audio_player_queue *self);
648 bool audio_queue_is_empty(struct audio_player_queue *self);
649 int audio_queue_finish(struct audio_player_queue *self);
650 int audio_queue_peek(struct audio_player_queue *self, void *data);
651 void audio_queue_destroy(struct audio_player_queue *self);
652 struct audio_player_stream *audio_stream_create(size_t size);
653 int audio_stream_start(struct audio_player_stream *self);
654 int audio_stream_read(struct audio_player_stream *self, char *data, size_t data_len);
655 int audio_stream_read2(struct audio_player_stream *self, char *data, size_t data_len);
656 int audio_stream_write(struct audio_player_stream *self, const char *data, size_t data_len);
657 int audio_stream_write2(struct audio_player_stream *self, const char *data, size_t data_len);
658 int audio_stream_finish(struct audio_player_stream *self);
659 int audio_stream_stop(struct audio_player_stream *self);
660 int audio_stream_stop2(struct audio_player_stream *self);
661 int audio_stream_reset(struct audio_player_stream *self);
662 int audio_stream_resume(struct audio_player_stream *self);
663 void audio_stream_destroy(struct audio_player_stream *self);
664 
665 /**
666  * wav_header Functions
667  */
668 int wav_header_init(struct wav_header *head, int samplerate, int bits, int channels);
669 int wav_header_complete(struct wav_header *head, int samples);
670 
671 /**
672  * Resample Funtions
673  */
674 /****************************************************************************
675  *
676  * The number of taps in the sample rate conversion filters.  This is an
677  * indication of the number of MACs in the unrolled filter loop.  There is a
678  * direct correlation between the number of taps and the execution time of
679  * the sample rate converter.  There is one MAC per tap per output sample.
680  * This is also the amount of extra memory required before any input data
681  * buffer passed to the sample rate converter.
682  *
683  ****************************************************************************/
684 
685 #define NUMTAPS_4CH (64)
686 
687 /****************************************************************************
688  *
689  * The perisistent state of the sample rate converter.
690  *
691  ****************************************************************************/
692 
693 typedef short ssrc_type;
694 
695 typedef struct
696 {
697     /* The internal, persistent state of the sample rate converter. */
698     unsigned char ucInternal[12];
699     short *psFilter;
700     int lFilterIncr;
701     int lFilterSize;
702     int lFilterOffset;
703     ssrc_type lastSample1;
704     ssrc_type lastSample2;
705     ssrc_type lastSample3;
706     ssrc_type lastSample4;
707     ssrc_type Left[NUMTAPS_4CH * 4];
708 } SRCState_4ch;
709 
710 typedef struct
711 {
712     //
713     // The internal, persistent state of the sample rate converter.
714     //
715     unsigned char ucInternal[12];
716     short *psFilter;
717     int lFilterIncr;
718     int lFilterOffset;
719     int lFilterSize;
720     //BufferState sInputBuffer;
721     //short Left_right[NUMTAPS*2];
722     int Left_right[64 * 2];
723     int Last_sample[180 * 2];
724     int last_sample_num;
725     int process_num;
726     short numtaps;
727     short lastSampleLeft;
728     short lastSampleRight;
729 } SRCState;
730 
731 long resample_48to16_4ch_init(SRCState_4ch *pSRC, unsigned long ulInputRate,
732                               unsigned long ulOutputRate);
733 void resample_48to16_4ch_process(SRCState_4ch *pSRC, ssrc_type *psInData, ssrc_type *psOutData,
734                                  long lNumInputSamples, long *plNumOutputSamples);
735 int SRCInit(SRCState *pSRC, unsigned long ulInputRate,
736             unsigned long ulOutputRate);
737 long SRCFilter(SRCState *pSRC, short *psLeft, short *psRight,
738                long lNumSamples);
739 
740 #endif
741