Adapt call transport tests and desktop setup to profile negotiation
This commit is contained in:
1 parent
3063270a67
commit
68e5905d9e
2 files changed
+8
-7
No files matched your search
@@ -133,10 +133,11 @@ void CallVideoEngine::transmit() {
|
||||
call_video_caps caps{};
|
||||
// Каждый объявленный codec проверяется реальным encoder + независимым decoder при open.
|
||||
for (unsigned codec = 1; codec <= 2 && m->running; ++codec) {
|
||||
call_video_format probe{1, 1280, 720, 30, 0, (uint8_t)codec, (uint8_t)(codec == 1 ? 31 : 93), 4000000, 1000000};
|
||||
call_video_format probe{1, 1280, 720, 30, 0, (uint8_t)codec, (uint8_t)(codec == 1 ? 31 : 93), 4000000,
|
||||
(uint8_t)(codec == 1 ? CALL_VIDEO_CONSTRAINED_BASELINE : CALL_VIDEO_MAIN)};
|
||||
CallVideoEncoder encoder;
|
||||
if (encoder.open(probe, 1000000)) {
|
||||
call_video_limit limit{1280, 720, 30, 1280 * 720 * 30, 4000000, 1000000, probe.level};
|
||||
call_video_limit limit{1280, 720, 30, 1280 * 720 * 30, 4000000, probe.profile, probe.level};
|
||||
caps.encode[codec - 1] = caps.decode[codec - 1] = limit;
|
||||
} else DEBUG_WARN(DEBUG_CATEGORY_CALL, "call codec probe unavailable codec=%u: %s", codec, qPrintable(encoder.error()));
|
||||
}
|
||||
@@ -163,7 +164,7 @@ void CallVideoEngine::transmit() {
|
||||
if (!enabled || !state.have_peer || pts <= lastPts || (lastPts >= 0 && pts - lastPts < 33333)) { idle(); continue; }
|
||||
if (revision != appliedRevision) {
|
||||
if (lastKey >= 0 && pts - lastKey < 1000000) { idle(); continue; }
|
||||
call_video_format next{format.generation + 1, (uint16_t)width, (uint16_t)height, 30, 0, (uint8_t)codec, 0, 4000000, 1000000};
|
||||
call_video_format next{format.generation + 1, (uint16_t)width, (uint16_t)height, 30, 0, (uint8_t)codec, 0, 4000000, 0};
|
||||
if (call_video_choose(&caps, &state.peer, &next) <= 0 || !encoder.open(next, 1000000)) {
|
||||
m->report(tr("Selected video mode is unavailable to the peer"));
|
||||
std::lock_guard<std::mutex> guard(m->lock); if (m->revision == revision) m->enabled = false;
|
||||
|
||||
Reference in new issue
Block a user