优化rtmp时间戳修正

This commit is contained in:
xiongziliang
2019-08-22 14:56:58 +08:00
parent 7f0fa0ead1
commit fc0544512b
4 changed files with 37 additions and 41 deletions

View File

@@ -33,16 +33,17 @@ using namespace toolkit;
namespace mediakit {
//该类解决时间戳回环、回退问题
//计算相对时间戳或者产生平滑时间戳
class Stamp {
public:
Stamp(bool modifyStamp = false) {_modifyStamp = modifyStamp;};
Stamp() = default;
~Stamp() = default;
void revise(uint32_t dts, uint32_t pts, int64_t &dts_out, int64_t &pts_out);
private:
int64_t _start_dts = 0;
int64_t _dts_inc = 0;
bool _first = true;
bool _modifyStamp;
std::shared_ptr<SmoothTicker> _ticker;
};