Mark ICE component as ready even without the event

This commit is contained in:
Marvin W 2021-03-23 15:09:52 +01:00
parent b01f6f9ef7
commit 97ab7de7ab
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A

View file

@ -172,7 +172,12 @@ public class Dino.Plugins.Ice.TransportParameters : JingleIceUdp.IceUdpTransport
private void on_component_state_changed(uint stream_id, uint component_id, uint state) { private void on_component_state_changed(uint stream_id, uint component_id, uint state) {
if (stream_id != this.stream_id) return; if (stream_id != this.stream_id) return;
debug("stream %u component %u state changed to %s", stream_id, component_id, agent.get_component_state(stream_id, component_id).to_string()); debug("stream %u component %u state changed to %s", stream_id, component_id, agent.get_component_state(stream_id, component_id).to_string());
if (is_component_ready(agent, stream_id, component_id) && connections.has_key((uint8) component_id) && !connections[(uint8)component_id].ready) { may_consider_ready(stream_id, component_id);
}
private void may_consider_ready(uint stream_id, uint component_id) {
if (stream_id != this.stream_id) return;
if (connections.has_key((uint8) component_id) && is_component_ready(agent, stream_id, component_id) && connections.has_key((uint8) component_id) && !connections[(uint8)component_id].ready) {
connections[(uint8)component_id].ready = true; connections[(uint8)component_id].ready = true;
} }
} }
@ -189,7 +194,11 @@ public class Dino.Plugins.Ice.TransportParameters : JingleIceUdp.IceUdpTransport
private void on_recv(Nice.Agent agent, uint stream_id, uint component_id, uint8[] data) { private void on_recv(Nice.Agent agent, uint stream_id, uint component_id, uint8[] data) {
if (stream_id != this.stream_id) return; if (stream_id != this.stream_id) return;
if (is_component_ready(agent, stream_id, component_id) && connections.has_key((uint8) component_id)) { may_consider_ready(stream_id, component_id);
if (connections.has_key((uint8) component_id)) {
if (!connections[(uint8) component_id].ready) {
debug("on_recv stream %u component %u when state %s", stream_id, component_id, agent.get_component_state(stream_id, component_id).to_string());
}
connections[(uint8) component_id].datagram_received(new Bytes(data)); connections[(uint8) component_id].datagram_received(new Bytes(data));
} else { } else {
debug("on_recv stream %u component %u length %u", stream_id, component_id, data.length); debug("on_recv stream %u component %u length %u", stream_id, component_id, data.length);