MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / audioThread

Function audioThread

src/stream.cpp:1923–1942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1921 }
1922
1923 void audioThread(session_t *session) {
1924 auto fg = util::fail_guard([&]() {
1925 session::stop(*session);
1926 });
1927
1928 while_starting_do_nothing(session->state);
1929
1930 auto ref = broadcast.ref();
1931 auto error = recv_ping(session, ref, socket_e::audio, session->audio.ping_payload, session->audio.peer, config::stream.ping_timeout);
1932 if (error < 0) {
1933 return;
1934 }
1935
1936 // Enable local prioritization and QoS tagging on audio traffic if requested by the client
1937 auto address = session->audio.peer.address();
1938 session->audio.qos = platf::enable_socket_qos(ref->audio_sock.native_handle(), address, session->audio.peer.port(), platf::qos_data_type_e::audio, session->config.audioQosType != 0);
1939
1940 BOOST_LOG(debug) << "Start capturing Audio"sv;
1941 audio::capture(session->mail, session->config.audio, session);
1942 }
1943
1944 namespace session {
1945 std::atomic_uint running_sessions;

Callers

nothing calls this directly

Calls 7

fail_guardFunction · 0.85
stopFunction · 0.85
recv_pingFunction · 0.85
refMethod · 0.80
captureFunction · 0.70
enable_socket_qosFunction · 0.50

Tested by

no test coverage detected