Complete capture API migration and cancel prelaunch stop requests
This commit is contained in:
1 parent
939f33773b
commit
8faaa34e24
4 files changed
+8
-8
No files matched your search
@@ -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<StreamVideoMode> modes; // Режимы камеры из объявленных возможностей; screen-режимы строятся отдельно.
|
||||
QPointer<QScreen> 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 {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 <QtTest>
|
||||
@@ -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<CallVideoEngine*>(); 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"
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user