1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine code for bug #151, refine the source functions, add comments.

This commit is contained in:
winlin 2014-10-08 14:28:09 +08:00
parent f33f91c8c2
commit 13b092704d
2 changed files with 27 additions and 11 deletions

View file

@ -224,7 +224,7 @@ private:
* gop cache is disabled for pure audio stream.
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/124
*/
int audio_count_after_last_video;
int audio_after_last_video_count;
/**
* cached gop.
*/
@ -233,6 +233,9 @@ public:
SrsGopCache();
virtual ~SrsGopCache();
public:
/**
* to enable or disable the gop cache.
*/
virtual void set(bool enabled);
/**
* only for h264 codec
@ -240,14 +243,26 @@ public:
* 2. clear gop when got keyframe.
*/
virtual int cache(SrsSharedPtrMessage* msg);
/**
* clear the gop cache.
*/
virtual void clear();
virtual int dump(SrsConsumer* consumer, bool atc, int tba, int tbv, SrsRtmpJitterAlgorithm jitter_algorithm);
/**
* dump the cached gop to consumer.
*/
virtual int dump(SrsConsumer* consumer,
bool atc, int tba, int tbv, SrsRtmpJitterAlgorithm jitter_algorithm
);
/**
* used for atc to get the time of gop cache,
* the atc will adjust the sequence header timestamp to gop cache.
*/
virtual bool empty();
virtual int64_t get_start_time();
/**
* get the start time of gop cache, in ms.
* @return 0 if no packets.
*/
virtual int64_t start_time();
};
/**