You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.7KB

  1. #ifndef _hls_param_h_
  2. #define _hls_param_h_
  3. // https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/FrequentlyAskedQuestions/FrequentlyAskedQuestions.html
  4. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/FrequentlyAskedQuestions/FrequentlyAskedQuestions.html
  5. // 1. What kinds of encoders are supported?
  6. // H.264 video and AAC audio (HE-AAC or AAC-LC).
  7. // 2. What are the specifics of the video and audio formats supported?
  8. // Video: H.264 Baseline Level 3.0, Baseline Level 3.1, Main Level 3.1, and High Profile Level 4.1.
  9. // Audio: HE-AAC or AAC-LC up to 48 kHz, stereo audio
  10. // MP3 (MPEG-1 Audio Layer 3) 8 kHz to 48 kHz, stereo audio
  11. // AC-3 (for Apple TV, in pass-through mode only)
  12. // 3. What duration should media files be?
  13. // A duration of 10 seconds of media per file seems to strike a reasonable balance for most broadcast content.
  14. // http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
  15. #define HLS_DURATION 10 // 10s, from Apple recommendation
  16. // 4. How many files should be listed in the index file during a continuous, ongoing session?
  17. // The normal recommendation is 3, but the optimum number may be larger.
  18. #define HLS_LIVE_NUM 3
  19. // HTTP Content-Type
  20. // Playlist files whose names end in .m3u8 and/or have the HTTP Content-
  21. // Type "application/vnd.apple.mpegurl" are encoded in UTF-8[RFC3629].
  22. // Files whose names end with.m3u and/or have the HTTP Content-Type
  23. // [RFC2616] "audio/mpegurl" are encoded in US-ASCII[US_ASCII].
  24. #define HLS_M3U8_TYPE "application/vnd.apple.mpegURL"
  25. #define HLS_M3U_TYPE "audio/mpegurl"
  26. #define HLS_TS_TYPE "video/MP2T"
  27. #define PTS_NO_VALUE INT64_MIN //(int64_t)0x8000000000000000L
  28. // version: 1 (default)
  29. //
  30. // version: 2
  31. // The IV attribute of the EXT-X-KEY tag.
  32. // version: 3
  33. // Floating-point EXTINF duration values.
  34. // version: 4
  35. // The EXT-X-BYTERANGE tag.
  36. // The EXT-X-I-FRAMES-ONLY tag.
  37. // version: 5
  38. // The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY tag.
  39. // The EXT-X-MAP tag.
  40. // version: 6
  41. // The EXT-X-MAP tag in a Media playlist that does not contain EXT-X-I-FRAMES-ONLY.
  42. // 6.2.2. Live Playlists
  43. // 1. The server MUST NOT remove a media segment from the Playlist file if
  44. // the duration of the Playlist file minus the duration of the segment
  45. // is less than three times the target duration
  46. // 2. When the server removes a media segment from the Playlist, the
  47. // corresponding media URI SHOULD remain available to clients for a
  48. // period of time equal to the duration of the segment plus the duration
  49. // of the longest Playlist file distributed by the server containing
  50. // that segment.
  51. // 6.3.3. Playing the Playlist file
  52. // 1. If the EXT-X-ENDLIST tag is not present, the client SHOULD NOT
  53. // choose a segment which starts less than three target durations from
  54. // the end of the Playlist file.
  55. // 2. The client SHOULD attempt to load media segments in advance of when
  56. // they will be required for uninterrupted playback to compensate for
  57. // temporary variations in latency and throughput.
  58. // 3. The client MUST be prepared to reset its parser(s) and decoder(s)
  59. // before playing a media segment that has an EXT-X-DISCONTINUITY tag
  60. // applied to it.
  61. // 6.3.4. Reloading the Playlist file
  62. // 1. The client MUST periodically reload the Media Playlist file unless it
  63. // contains the EXT-X-ENDLIST tag.
  64. // 2. if Playlist file changed since the last time it was loaded, the client MUST wait for
  65. // at least the target duration before attempting to reload the Playlist file again
  66. // 3. if Playlist file not changed then it MUST wait for a period of one-half the target
  67. // duration before retrying
  68. #endif /* !_hls_param_h_ */