/* =========================================================================

DESCRIPTION
   Netease && Xunfei speech processing main program

Copyright (c) 2017 by Netease, Co,LTD.  All Rights Reserved.
============================================================================ */

/* =========================================================================

                             REVISION

when                       who why
--------                    ---------
-------------------------------------------
2017/06/28          wangzijiao                                  Created.
============================================================================ */

#ifndef __AUDIOBYPASS_H__
#define __AUDIOBYPASS_H__

#ifdef __cplusplus
extern "C" {
#endif /* C++ */

#include "AudioQueue.h"
#include "cae.h"

/* ------------------------------------------------------------------------
** Types
** ------------------------------------------------------------------------ */
typedef enum {
    AUDIO_BYPASS_CHANNEL_MSC_IAT = 1 << 0,
    AUDIO_BYPASS_CHANNEL_YUNXIN = 1 << 1,
//    AUDIO_BYPASS_CHANNEL_NETEASE= 1 << 2,
} AUDIO_BYPASS_CHANNEL_NO;

struct audio_bypass {
    audio_queue_t *queue;
    char *queue_buf;
    pthread_t tid_queue_bypass;
    //CAEDATA **cae;
    pthread_mutex_t mutex;

    char running;
    unsigned int chan;
};

int Netease_audiobypass_init(struct audio_bypass **bypass, void **cae,
                             unsigned int chan);
void Netease_audiobypass_start(struct audio_bypass *bypass);
void Netease_audiobypass_write(struct audio_bypass *bypass, const void *audio,
                               unsigned int audio_len);
void Netease_audiobypass_destroy(struct audio_bypass **bypass);
void Netease_audiobypass_channel_set(struct audio_bypass *bypass,
                                     AUDIO_BYPASS_CHANNEL_NO no);
void Netease_audiobypass_channel_unset(struct audio_bypass *bypass,
                                       AUDIO_BYPASS_CHANNEL_NO no);

#ifdef __cplusplus
} /* extern "C" */
#endif /* C++ */

#endif /* __AUDIOBYPASS_H__ */
