Add managed channel administration and moderation
This commit is contained in:
@@ -86,6 +86,7 @@ static bool connect_guest(vc_client*& client, const char* name, const char* labe
|
||||
if (!client) return false;
|
||||
ev.client = client;
|
||||
ev.label = label;
|
||||
if (vc_set_external_playback(client, 1) != VC_OK) return false;
|
||||
if (vc_connect(client, "127.0.0.1", port) != VC_OK) return false;
|
||||
if (vc_authenticate_guest(client, name) != VC_OK) return false;
|
||||
if (!wait_for(ev, [](EventStore& s) { return s.auth_ok; }, 8000)) return false;
|
||||
@@ -163,6 +164,7 @@ static int64_t run_case(uint16_t port, vc_client* admin, EventStore& evAdmin,
|
||||
CHECK(connect_guest(clientA, "SrA", "sr-a", port, evA));
|
||||
CHECK(connect_guest(clientB, "SrB", "sr-b", port, evB));
|
||||
int64_t energy = -1;
|
||||
SinkData sink; // Outlives both clients and their final audio callbacks.
|
||||
if (!clientA || !clientB) goto cleanup;
|
||||
|
||||
{
|
||||
@@ -174,11 +176,11 @@ static int64_t run_case(uint16_t port, vc_client* admin, EventStore& evAdmin,
|
||||
CHECK(vc_move_user(admin, b_uid, channel_id) == VC_OK);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
|
||||
SinkData sink;
|
||||
CHECK(vc_set_pcm_sink(clientB, pcm_sink, &sink) == VC_OK);
|
||||
|
||||
vc_stream_desc desc{};
|
||||
desc.kind = VC_STREAM_MIC;
|
||||
desc.external_feed = 1; // Measure only the injected tone, never the host microphone.
|
||||
uint32_t a_sid = 0;
|
||||
CHECK(vc_stream_start(clientA, &desc, &a_sid) == VC_OK);
|
||||
|
||||
@@ -201,7 +203,7 @@ static int64_t run_case(uint16_t port, vc_client* admin, EventStore& evAdmin,
|
||||
CHECK(sink_wait(sink, 5000));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1500));
|
||||
|
||||
energy = sink.total_energy;
|
||||
{ std::lock_guard lk(sink.mu); energy = sink.total_energy; }
|
||||
std::printf("test_channel_samplerate[%s]: sr=%u calls=%d energy=%lld\n",
|
||||
tag, expect_sr, sink.call_count.load(), static_cast<long long>(energy));
|
||||
CHECK(sink.call_count.load() > 0);
|
||||
|
||||
Reference in New Issue
Block a user