diff --git a/tools/chatgui/src/stream_publish_engine.h b/tools/chatgui/src/stream_publish_engine.h index bcb015bfb..f5f3eb20c 100644 --- a/tools/chatgui/src/stream_publish_engine.h +++ b/tools/chatgui/src/stream_publish_engine.h @@ -26,12 +26,11 @@ struct StreamVideoSource { Kind kind = Camera; // Backend захвата. QString name; // Отображаемое имя; не часть идентичности источника. QByteArray id; // Camera device-id, дескриптор screen либо "portal" для системного выбора Wayland. - QVariant window; // Зарезервировано пустым; окна выбираются по id из snapshot worker. QSize size; // Физический размер screen; может быть неизвестен до первого кадра portal. QList modes; // Режимы камеры из объявленных возможностей; screen-режимы строятся отдельно. QPointer screen; // Живой монитор; удаление устройства не должно переключать захват на его одноимённого соседа. bool sameSource(const StreamVideoSource& other) const { // Сравнивает backend/handles, без имени, разрешения и списка режимов. - return kind == other.kind && id == other.id && window == other.window && screen == other.screen; + return kind == other.kind && id == other.id && screen == other.screen; } }; struct StreamPublishConfig { diff --git a/tools/chatgui/src/video_capture.cpp b/tools/chatgui/src/video_capture.cpp index 8ac3cc6bf..a050a4896 100644 --- a/tools/chatgui/src/video_capture.cpp +++ b/tools/chatgui/src/video_capture.cpp @@ -163,7 +163,8 @@ struct VideoCapture::Session : QObject { if (socket) sendConfiguration(); } void stop() { - if (stopping || process.state() == QProcess::NotRunning) return; + if (stopping) return; + if (process.state() == QProcess::NotRunning) { enabled = false; ++generation; return; } stopping = true; enabled = false; ++generation; stopStarted = call_video_playout_now_us(); stopAt = stopStarted + 1500000; DEBUG_INFO(DEBUG_CATEGORY_VIDEO, "capture stop requested pid=%lld generation=%llu last_stage=%s deadline_ms=1500", diff --git a/tools/chatgui/tests/test_call_commands.cpp b/tools/chatgui/tests/test_call_commands.cpp index 808580a32..d8f37070a 100644 --- a/tools/chatgui/tests/test_call_commands.cpp +++ b/tools/chatgui/tests/test_call_commands.cpp @@ -3,7 +3,7 @@ #include "../src/callwindow.h" #include "../src/call_audio_graphs.h" #include "call/call_history_store.h" -#include "../src/call_camera_capture.h" +#include "../src/video_capture.h" #include "../src/call_video_engine.h" #include "../transport/gui_bridge.h" #include @@ -192,10 +192,10 @@ private slots: void videoSettingsMenus() { CallWindow window; window.setCallId(77); window.setPeerName(QStringLiteral("Video call")); window.setState(CallWindow::Active); auto* engine = window.findChild(); QVERIFY(engine); - CallCameraDevice first{QStringLiteral("Main camera"), QByteArray("main"), {}}; + VideoCaptureDevice first{QStringLiteral("Main camera"), QByteArray("main"), {}}; stream_video_add_camera_modes(first.modes, QSize(1920, 1080), 29.97, 29.97); stream_video_add_camera_modes(first.modes, QSize(1280, 720), 15, 60); - CallCameraDevice second{QStringLiteral("Secondary camera"), QByteArray("secondary"), {}}; + VideoCaptureDevice second{QStringLiteral("Secondary camera"), QByteArray("secondary"), {}}; stream_video_add_camera_modes(second.modes, QSize(640, 480), 7, 7); emit engine->camerasChanged({first, second}); QSignalBlocker blocked(engine); // Аппаратные события не меняют тестовые режимы; камера/звонок не открываются. @@ -477,7 +477,7 @@ private slots: }; int main(int argc, char** argv) { - if (argc >= 2 && !strcmp(argv[1], "--call-camera-worker")) return call_camera_worker_main(argc, argv); + if (argc >= 2 && !strcmp(argv[1], "--video-capture-worker")) return video_capture_worker_main(argc, argv); QApplication application(argc, argv); CallCommandsTest test; return QTest::qExec(&test, argc, argv); } #include "test_call_commands.moc" diff --git a/tools/chatgui/tests/test_stream_publish.cpp b/tools/chatgui/tests/test_stream_publish.cpp index 3f480000a..c7f670ebd 100644 --- a/tools/chatgui/tests/test_stream_publish.cpp +++ b/tools/chatgui/tests/test_stream_publish.cpp @@ -152,7 +152,7 @@ static void captureFfmpegDiagnostic(int, const char*, const char* message) { static QStringList captureDiagnostics; static void captureLifecycleLog(int, const char*, const char* message) { - if (QThread::currentThread() == qApp->thread() && QByteArray(message).startsWith("capture ")) + if (QThread::currentThread() == qApp->thread() && QByteArray(message).contains("capture ")) captureDiagnostics.append(QString::fromUtf8(message)); }