audio-repack.h 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #include <stdint.h>
  6. #include <string.h>
  7. #include <obs.h>
  8. struct audio_repack;
  9. typedef int (*audio_repack_func_t)(struct audio_repack *,
  10. const uint8_t *, uint32_t);
  11. struct audio_repack {
  12. uint8_t *packet_buffer;
  13. uint32_t packet_size;
  14. uint32_t base_src_size;
  15. uint32_t base_dst_size;
  16. uint32_t extra_dst_size;
  17. audio_repack_func_t repack_func;
  18. };
  19. enum _audio_repack_mode {
  20. repack_mode_8to3ch=0,
  21. repack_mode_8to4ch,
  22. repack_mode_8to5ch,
  23. repack_mode_8to6ch,
  24. repack_mode_8to5ch_swap,
  25. repack_mode_8to6ch_swap,
  26. repack_mode_8ch_swap,
  27. repack_mode_8ch,
  28. };
  29. typedef enum _audio_repack_mode audio_repack_mode_t;
  30. extern int audio_repack_init(struct audio_repack *repack,
  31. audio_repack_mode_t repack_mode, uint8_t sample_bit);
  32. extern void audio_repack_free(struct audio_repack *repack);
  33. #ifdef __cplusplus
  34. }
  35. #endif