annexb.h 826 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <bfc/platform/types.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. enum
  7. {
  8. AnnexB_UnitAvailable = 0, // data was added succesfully and a new unit is available via GetUnit().
  9. AnnexB_BufferFull = 1, // no start code found within the maximum unit length
  10. AnnexB_NeedMoreData = 2, // no unit ready yet, pass in the next data chunk
  11. AnnexB_Error = 3, // general error (out of memory, null pointer, etc)
  12. };
  13. typedef void *h264_annexb_demuxer_t;
  14. h264_annexb_demuxer_t AnnexB_Create(int size);
  15. void AnnexB_Destroy(h264_annexb_demuxer_t demuxer);
  16. int AnnexB_AddData(h264_annexb_demuxer_t demuxer, const void **data, size_t *data_len);
  17. void AnnexB_EndOfStream(h264_annexb_demuxer_t demuxer);
  18. int AnnexB_GetUnit(h264_annexb_demuxer_t demuxer, const void **data, size_t *data_len);
  19. #ifdef __cplusplus
  20. }
  21. #endif