mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
support hls republish
This commit is contained in:
parent
f25c6558a5
commit
5758551508
3 changed files with 54 additions and 6 deletions
|
@ -116,6 +116,8 @@ public:
|
|||
SrsTSMuxer* muxer;
|
||||
// current segment start dts for m3u8
|
||||
int64_t segment_start_dts;
|
||||
// whether current segement is sequence header.
|
||||
bool is_sequence_header;
|
||||
|
||||
SrsHlsSegment();
|
||||
virtual ~SrsHlsSegment();
|
||||
|
@ -167,6 +169,7 @@ public:
|
|||
* use 0 for the first segment of HLS.
|
||||
*/
|
||||
virtual int segment_open(int64_t segment_start_dts);
|
||||
virtual int on_sequence_header();
|
||||
/**
|
||||
* whether video overflow,
|
||||
* that is whether the current segment duration >= the segment in config
|
||||
|
@ -233,6 +236,13 @@ public:
|
|||
virtual int on_publish(SrsHlsMuxer* muxer, SrsRequest* req, int64_t segment_start_dts);
|
||||
virtual int on_unpublish(SrsHlsMuxer* muxer);
|
||||
/**
|
||||
* when get sequence header,
|
||||
* must write a #EXT-X-DISCONTINUITY to m3u8.
|
||||
* @see: hls-m3u8-draft-pantos-http-live-streaming-12.txt
|
||||
* @see: 3.4.11. EXT-X-DISCONTINUITY
|
||||
*/
|
||||
virtual int on_sequence_header(SrsHlsMuxer* muxer);
|
||||
/**
|
||||
* write audio to cache, if need to flush, flush to muxer.
|
||||
*/
|
||||
virtual int write_audio(SrsCodec* codec, SrsHlsMuxer* muxer, int64_t pts, SrsCodecSample* sample);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue