|
|
|
@ -130,15 +130,15 @@ void CallVideoEngine::setVideo(bool enabled, const QByteArray& cameraId, int wid |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CallVideoEngine::transmit() { |
|
|
|
void CallVideoEngine::transmit() { |
|
|
|
call_video_caps caps{}; |
|
|
|
call_video_caps caps = CallVideoDecoder::capabilities(); |
|
|
|
// Каждый объявленный codec проверяется реальным encoder + независимым decoder при open.
|
|
|
|
// Не связываем приём с наличием собственного encoder.
|
|
|
|
for (unsigned codec = 1; codec <= 2 && m->running; ++codec) { |
|
|
|
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, |
|
|
|
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)}; |
|
|
|
(uint8_t)(codec == 1 ? CALL_VIDEO_CONSTRAINED_BASELINE : CALL_VIDEO_MAIN)}; |
|
|
|
CallVideoEncoder encoder; |
|
|
|
CallVideoEncoder encoder; |
|
|
|
if (encoder.open(probe, 1000000)) { |
|
|
|
if (encoder.open(probe, 1000000)) { |
|
|
|
call_video_limit limit{1280, 720, 30, 1280 * 720 * 30, 4000000, probe.profile, 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; |
|
|
|
caps.encode[codec - 1] = limit; |
|
|
|
} else DEBUG_WARN(DEBUG_CATEGORY_CALL, "call codec probe unavailable codec=%u: %s", codec, qPrintable(encoder.error())); |
|
|
|
} else DEBUG_WARN(DEBUG_CATEGORY_CALL, "call codec probe unavailable codec=%u: %s", codec, qPrintable(encoder.error())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!m->running) return; |
|
|
|
if (!m->running) return; |
|
|
|
|