Events: Add SsrcKnown event

Knowing your own SSRC is useful for handling RTCP packets, which may detail information about *ourselves* rather than another host. In theory, at least: this confirms that Discord just sends ReceiverReports containing your own packet stats.

This would have been better to fit into Driver(Re)Connect, but that would be a breaking change: when this change is made, `SsrcKnown` shall be deprecated.
This commit is contained in:
Kyle Simpson
2021-02-10 14:33:34 +00:00
parent a40fac3109
commit f3f52427ea
3 changed files with 30 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ use super::{
};
use crate::{
constants::*,
events::CoreContext,
model::{
payload::{Identify, Resume, SelectProtocol},
Event as GatewayEvent,
@@ -195,6 +196,10 @@ impl Connection {
.mixer
.send(MixerMessage::SetConn(mix_conn, ready.ssrc))?;
let _ = interconnect
.events
.send(EventMessage::FireCoreEvent(CoreContext::SsrcKnown(ssrc)));
spawn(ws_task::runner(
interconnect.clone(),
ws_msg_rx,