Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

45 lines
1.3KB

  1. #ifndef _hls_m3u8_h_
  2. #define _hls_m3u8_h_
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef struct hls_m3u8_t hls_m3u8_t;
  9. ///@param[in] live 1-live streaming, 0-vod
  10. ///@param[in] version m3u8 version 3-TS, 7-MP4
  11. hls_m3u8_t* hls_m3u8_create(int live, int version);
  12. void hls_m3u8_destroy(hls_m3u8_t* m3u8);
  13. /// EXT-X-MAP
  14. int hls_m3u8_set_x_map(hls_m3u8_t* m3u8, const char* name);
  15. ///@param[in] pts present timestamp (millisecond)
  16. ///@param[in] duration segment duration (millisecond)
  17. ///@param[in] discontinuity 1-EXT-X-DISCONTINUITY flag, 0-ignore
  18. ///@return 0-ok, other-error
  19. int hls_m3u8_add(hls_m3u8_t* m3u8, const char* name, int64_t pts, int64_t duration, int discontinuity);
  20. /// EXT-X-BYTERANGE(version 4 and above)
  21. /// @param[in] offset offset position in file
  22. /// @param[in] bytes length (offset, offset + bytes)
  23. ///@return 0-ok, other-error
  24. int hls_m3u8_add_with_offset(hls_m3u8_t* m3u8, const char* name, int64_t pts, int64_t duration, int discontinuity, int64_t offset, int64_t bytes);
  25. ///@return media segment count
  26. size_t hls_m3u8_count(hls_m3u8_t* m3u8);
  27. ///Get m3u8 playlist file
  28. ///@param[in] eof 1-EXT-X-ENDLIST, 0-ignore
  29. ///@return 0-ok, other-error
  30. int hls_m3u8_playlist(hls_m3u8_t* m3u8, int eof, char* playlist, size_t bytes);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif /* !_hls_m3u8_h_ */