|
|
|
|
@ -45,7 +45,7 @@ class StreamViewTest : public QObject {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void publish(const QByteArray& video, const QByteArray& audio = {}) { |
|
|
|
|
stream_media_block media{}; media.format = {160, 90, 90, STREAM_MEDIA_H264, static_cast<uint8_t>(audio.isEmpty() ? 0 : STREAM_MEDIA_OPUS)}; |
|
|
|
|
stream_media_block media{}; media.format = {160, 90, 90, STREAM_MEDIA_H264, STREAM_MEDIA_OPUS}; |
|
|
|
|
media.first_frame_offset = 0; media.video_count = 1; |
|
|
|
|
media.video[0] = {++frameId, frameId * 100000, static_cast<uint32_t>(video.size()), 0, |
|
|
|
|
static_cast<uint32_t>(video.size()), STREAM_MEDIA_KEY, reinterpret_cast<const uint8_t*>(video.constData())}; |
|
|
|
|
@ -153,6 +153,17 @@ private slots:
|
|
|
|
|
QCOMPARE(stream_get_info(publisher, &info), STREAM_OK); QCOMPARE(info.owners, 1u); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void channelClosureNotifiesViewer() { |
|
|
|
|
QVERIFY(gui_stream_attach(inst)); QVERIFY(gui_stream_watch(group)); |
|
|
|
|
stream_info info{}; QCOMPARE(stream_get_info(publisher, &info), STREAM_OK); |
|
|
|
|
QVERIFY(gui_stream_open(105, group, inst->node_id, info.descriptor.source_epoch)); |
|
|
|
|
StreamRecord event; QVERIFY(receive(105, event)); QCOMPARE(event.kind, StreamRecordKind::Opened); |
|
|
|
|
QByteArray channel = QByteArray::number(group); chat_core_delete_channel(inst, channel.constData()); |
|
|
|
|
QVERIFY(receive(105, event)); QCOMPARE(event.kind, StreamRecordKind::Closed); QCOMPARE(event.reason, STREAM_CLOSE_GROUP); |
|
|
|
|
QTRY_COMPARE(snapshots.last().mid(9), QByteArray("[]")); |
|
|
|
|
QVERIFY(!stream_handle_active(publisher)); QCOMPARE(stream_handle_reason(publisher), STREAM_CLOSE_GROUP); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void cleanupTestCase() { |
|
|
|
|
poll.stop(); gui_stream_detach(inst); stream_close(publisher); uasync_mark_stopped(ua); |
|
|
|
|
utun_instance_destroy(inst); uasync_destroy(ua, 0); |
|
|
|
|
|