mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-22 00:42:22 +08:00
完善nack与丢包重传
This commit is contained in:
37
tests/test_rtcp_nack.cpp
Normal file
37
tests/test_rtcp_nack.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2016 The ZLToolKit project authors. All Rights Reserved.
|
||||
*
|
||||
* This file is part of ZLToolKit(https://github.com/xia-chu/ZLToolKit).
|
||||
*
|
||||
* Use of this source code is governed by MIT license that can be found in the
|
||||
* LICENSE file in the root of the source tree. All contributing project authors
|
||||
* may be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include "Util/logger.h"
|
||||
#include "Rtcp/RtcpFCI.h"
|
||||
#include "../webrtc/WebRtcTransport.h"
|
||||
using namespace std;
|
||||
using namespace toolkit;
|
||||
using namespace mediakit;
|
||||
|
||||
extern void testFCI();
|
||||
|
||||
int main() {
|
||||
Logger::Instance().add(std::make_shared<ConsoleChannel>());
|
||||
|
||||
srand((unsigned) time(NULL));
|
||||
|
||||
NackContext ctx;
|
||||
for (int i = 1; i < 1000; ++i) {
|
||||
if (i % (1 + (rand() % 30)) == 0) {
|
||||
DebugL << "drop:" << i;
|
||||
} else {
|
||||
ctx.received(i);
|
||||
|
||||
}
|
||||
}
|
||||
sleep(1);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user