airtalk_def.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __AIRTALK_H__
  2. #define __AIRTALK_H__
  3. #include "luat_network_adapter.h"
  4. #include "luat_rtos.h"
  5. #define UPLOAD_CACHE_MAX (32)
  6. #define DOWNLOAD_CACHE_MAX (32)
  7. #define RECORD_DATA_MAX (320)
  8. enum
  9. {
  10. AIRTALK_EVENT_AMR_ENCODE_ONCE = 1,
  11. AIRTALK_EVENT_AMR_DECODE_ONCE,
  12. AIRTALK_EVENT_AMR_START, //audio处理流程开始
  13. AIRTALK_EVENT_AMR_RECORD_STOP, //录音停止
  14. AIRTALK_EVENT_AMR_PLAY_STOP, //播放停止
  15. AIRTALK_EVENT_NETWORK_DOWNLINK_DATA, //下行数据,需要解码播放
  16. AIRTALK_EVENT_NETWORK_UPLINK_DATA, //上行数据,已经编码过了
  17. AIRTALK_EVENT_NETWORK_UPLINK_END,
  18. AIRTALK_EVENT_NETWORK_READY_START,
  19. AIRTALK_EVENT_NETWORK_FORCE_SYNC, //重新同步数据
  20. AIRTALK_EVENT_NETWORK_FORCE_STOP, //停止对讲流程
  21. AIRTALK_EVENT_NETWORK_MSG, //其他消息
  22. };
  23. typedef struct
  24. {
  25. llist_head node;
  26. uint64_t local_tamp;
  27. uint32_t total_len;
  28. uint8_t save_data[RECORD_DATA_MAX];
  29. }record_data_struct;
  30. typedef struct
  31. {
  32. luat_rtos_task_handle task_handle;
  33. llist_head upload_cache_head;
  34. llist_head download_cache_head;
  35. llist_head free_cache_head;
  36. record_data_struct *cur_record_node;
  37. uint32_t download_cache_time;
  38. luat_rtos_timer_t download_check_timer;
  39. CBDataFun_t send_function;
  40. CBDataFun_t recv_function;
  41. HANDLE record_cache_locker;
  42. uint32_t remote_ssrc;
  43. uint32_t local_ssrc;
  44. uint8_t remote_ssrc_exsit;
  45. uint8_t data_sync_ok;
  46. uint8_t is_ready;
  47. uint8_t audio_data_protocl;
  48. uint8_t is_16k;
  49. uint8_t work_mode;
  50. uint8_t debug_on_off;
  51. }airtalk_network_ctrl_t;
  52. #endif