diff --git a/tools/chatgui/src/call_camera_capture.h b/tools/chatgui/src/call_camera_capture.h index d2a2f994..2cac7adf 100644 --- a/tools/chatgui/src/call_camera_capture.h +++ b/tools/chatgui/src/call_camera_capture.h @@ -6,9 +6,9 @@ // Только аппаратные режимы камеры, пригодные для звонка; опрос выполняется в процессе захвата. struct CallCameraDevice { - QString name; - QByteArray id; - QList modes; + QString name; // Отображаемое имя устройства. + QByteArray id; // Непрозрачный идентификатор Qt backend. + QList modes; // Аппаратные размеры до Full HD с частотой 30/29.97 fps. }; using CallCameraDevices = QList; constexpr qint64 CallCameraMaxFrameAgeUs = 250000; diff --git a/tools/chatgui/src/call_video_decoder.cpp b/tools/chatgui/src/call_video_decoder.cpp index 179a0fdb..283defcc 100644 --- a/tools/chatgui/src/call_video_decoder.cpp +++ b/tools/chatgui/src/call_video_decoder.cpp @@ -242,10 +242,10 @@ call_video_caps CallVideoDecoder::capabilities(const std::atomic* running) while (!guard.try_lock()) { if (cancelled()) return {}; QThread::usleep(1000); } if (initialized) return caps; call_video_caps probed{}; - for (unsigned codec = 1; codec <= 2; ++codec) { - unsigned profiles = 0, maximumTier = 0; - for (unsigned profile = 1; profile <= (codec == 1 ? 2u : 1u); ++profile) { - for (unsigned tier = 0; tier < 2; ++tier) { + for (unsigned codec = 1; codec <= 2; ++codec) { + unsigned profiles = 0, maximumTier = 0; + for (unsigned profile = 1; profile <= (codec == 1 ? 2u : 1u); ++profile) { + for (unsigned tier = 0; tier < 2; ++tier) { const unsigned width = tier ? 1920 : 1280, height = tier ? 1080 : 720; for (Backend backend : {Backend::HardwareOnly, Backend::SoftwareOnly}) { if (cancelled()) return {}; @@ -282,7 +282,7 @@ call_video_caps CallVideoDecoder::capabilities(const std::atomic* running) } valid = valid && received == 8 && outputBeforeEos; DEBUG_INFO(DEBUG_CATEGORY_CALL, "video decoder probe codec=%u profile=%u size=%ux%u backend=%d valid=%d inputs=%u outputs=%u pipeline=%u", - codec, profile, w, h, int(backend), valid, sent, received, decoder.pipelineFrames()); + codec, profile, w, h, int(backend), valid, sent, received, decoder.pipelineFrames()); bothOrientations = valid; backendPipeline = std::max(backendPipeline, decoder.pipelineFrames()); } @@ -298,15 +298,15 @@ call_video_caps CallVideoDecoder::capabilities(const std::atomic* running) break; } } - } - } - if (profiles) { - const uint16_t width = maximumTier ? 1920 : 1280, height = maximumTier ? 1080 : 720; - call_video_limit limit{width, height, 30, uint32_t(width) * height * 30, 4000000, (uint8_t)profiles, - (uint8_t)(codec == 1 ? (maximumTier ? 40 : 31) : (maximumTier ? 120 : 93))}; - if (!call_video_limit_orientations(&limit, codec)) probed.decode[codec - 1] = limit; } } + if (profiles) { + const uint16_t width = maximumTier ? 1920 : 1280, height = maximumTier ? 1080 : 720; + call_video_limit limit{width, height, 30, uint32_t(width) * height * 30, 4000000, (uint8_t)profiles, + (uint8_t)(codec == 1 ? (maximumTier ? 40 : 31) : (maximumTier ? 120 : 93))}; + if (!call_video_limit_orientations(&limit, codec)) probed.decode[codec - 1] = limit; + } + } caps = probed; initialized = true; return caps; }