audio-repack.h 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 *, const uint8_t *,
  10. 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 pad_dst_size;
  17. uint32_t squash_count;
  18. uint32_t bytes_per_sample;
  19. audio_repack_func_t repack_func;
  20. };
  21. enum _audio_repack_mode {
  22. repack_mode_8to2ch = 0,
  23. repack_mode_8to3ch,
  24. repack_mode_8to4ch,
  25. repack_mode_8to5ch,
  26. repack_mode_8to6ch,
  27. repack_mode_8to5ch_swap,
  28. repack_mode_8to6ch_swap,
  29. repack_mode_8ch_swap,
  30. repack_mode_8ch,
  31. };
  32. typedef enum _audio_repack_mode audio_repack_mode_t;
  33. extern int audio_repack_init(struct audio_repack *repack,
  34. audio_repack_mode_t repack_mode,
  35. uint8_t bits_per_sample);
  36. extern void audio_repack_free(struct audio_repack *repack);
  37. #ifdef __cplusplus
  38. }
  39. #endif