audio-repack.h 839 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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=3,
  21. repack_mode_8to4ch,
  22. repack_mode_8to5ch,
  23. repack_mode_8to6ch,
  24. };
  25. typedef enum _audio_repack_mode audio_repack_mode_t;
  26. extern int audio_repack_init(struct audio_repack *repack,
  27. audio_repack_mode_t repack_mode, uint8_t sample_bit);
  28. extern void audio_repack_free(struct audio_repack *repack);
  29. #ifdef __cplusplus
  30. }
  31. #endif