1
0

ADTSHeader.h 948 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "foundation/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. size_t nsaac_adts_get_frame_bitrate(nsaac_adts_header_t header);
  29. #ifdef __cplusplus
  30. }
  31. #endif