You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
1.2 KiB

/* Desktop live viewer: attach/detach в uasync до destroy ядра; остальные вызовы потокобезопасны.
* Один viewer, команды содержат IDs; RX ограничен 4MB/256 записей, borrowed данные копируются.
* Watch до attach запоминает выбранную группу. Каталог идёт через CHAT_EVT_STREAM_SOURCES,
* медиаданные — через отдельную очередь pull. */
#pragma once
#include <QByteArray>
#include <cstdint>
#include "../../../src/stream/stream_media.h"
struct UTUN_INSTANCE;
enum class StreamRecordKind { Video, Audio, Gap, Opened, End, Closed };
struct StreamRecord {
uint64_t id = 0, pts = 0;
StreamRecordKind kind = StreamRecordKind::Gap;
stream_media_format format{};
int flags = 0, reason = 0;
QByteArray data;
};
bool gui_stream_attach(UTUN_INSTANCE* inst);
void gui_stream_detach(UTUN_INSTANCE* inst);
bool gui_stream_watch(uint64_t group);
bool gui_stream_open(uint64_t id, uint64_t group, uint64_t source, uint64_t epoch);
void gui_stream_stop(uint64_t id);
bool gui_stream_pull(uint64_t id, StreamRecord& record);
bool gui_stream_ready();