1
0

ADTSHeader.h 885 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <bfc/platform/types.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef struct ADTSHeader
  7. {
  8. unsigned int syncword;
  9. unsigned int layer;
  10. unsigned int id;
  11. unsigned int protection;
  12. unsigned int profile;
  13. unsigned int sample_rate_index;
  14. unsigned int private_bit;
  15. unsigned int channel_configuration;
  16. unsigned int original;
  17. unsigned int home;
  18. size_t frame_length;
  19. unsigned int buffer_fullness;
  20. unsigned int num_data_blocks;
  21. } ADTSHeader, *nsaac_adts_header_t;
  22. /* must be 7 bytes */
  23. int nsaac_adts_parse(nsaac_adts_header_t header, const uint8_t *buffer);
  24. unsigned int nsaac_adts_get_samplerate(nsaac_adts_header_t header);
  25. int nsaac_adts_match(nsaac_adts_header_t header1, nsaac_adts_header_t header2);
  26. int nsaac_adts_get_channel_count(nsaac_adts_header_t header);
  27. size_t nsaac_adts_get_header_size(nsaac_adts_header_t header);
  28. #ifdef __cplusplus
  29. }
  30. #endif