Preserve desktop camera cadence under timestamp jitter
This commit is contained in:
1 parent
209f2ceb7c
commit
f3eed42c3f
3 files changed
+28
-5
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include <clocale>
|
||||
#include "../src/call_video_encoder.h"
|
||||
#include "../src/call_video_decoder.h"
|
||||
#include "../src/call_video_cadence.h"
|
||||
#include "../../../src/call/call_video_bitstream.h"
|
||||
extern "C" {
|
||||
#include "debug_config.h"
|
||||
@@ -41,6 +42,15 @@ class CallVideoEncoderTest : public QObject {
|
||||
return {17, 640, 360, 30, 0, (uint8_t)codec, (uint8_t)(codec == 1 ? 31 : 93), 4000000, (uint8_t)(codec == 1 ? 2 : 1)};
|
||||
}
|
||||
private slots:
|
||||
void captureCadence() {
|
||||
CallVideoCadence jittered, fast;
|
||||
for (int i = 0; i < 300; i++) QVERIFY(jittered.accept(1000000 + i * 33333 + (i % 2 ? -1500 : 1500)));
|
||||
int accepted = 0;
|
||||
for (int i = 0; i < 600; i++) if (fast.accept(1000000 + i * 1000000LL / 60)) accepted++;
|
||||
QCOMPARE(accepted, 300);
|
||||
QVERIFY(jittered.accept(30000000)); // Долгая пауза не создаёт догоняющий burst.
|
||||
QVERIFY(!jittered.accept(30001000));
|
||||
}
|
||||
void initTestCase() {
|
||||
debug_config_init(); debug_set_level(DEBUG_LEVEL_WARN); debug_set_category_level(DEBUG_CATEGORY_CALL, DEBUG_LEVEL_DEBUG);
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
|
||||
Reference in new issue
Block a user