openvidu-server: change getStats strategy

pull/431/head
pabloFuente 2020-04-06 17:33:50 +02:00
parent ce90918274
commit daec96f465
3 changed files with 5 additions and 11 deletions

View File

@ -402,9 +402,7 @@ public class KurentoParticipant extends Participant {
}
publisher.unregisterErrorListeners();
if (publisher.kmsWebrtcStatsThread != null) {
publisher.kmsWebrtcStatsThread.cancel(true);
}
publisher.cancelStatsLoop.set(true);
for (MediaElement el : publisher.getMediaElements()) {
releaseElement(getParticipantPublicId(), el);
@ -427,9 +425,7 @@ public class KurentoParticipant extends Participant {
if (subscriber != null) {
subscriber.unregisterErrorListeners();
if (subscriber.kmsWebrtcStatsThread != null) {
subscriber.kmsWebrtcStatsThread.cancel(true);
}
subscriber.cancelStatsLoop.set(true);
releaseElement(senderName, subscriber.getEndpoint());

View File

@ -972,9 +972,7 @@ public class KurentoSessionManager extends SessionManager {
final PassThrough passThru = publisher.disconnectFromPassThrough();
// 2) Destroy the broken PublisherEndpoint and nothing else
if (publisher.kmsWebrtcStatsThread != null) {
publisher.kmsWebrtcStatsThread.cancel(true);
}
publisher.cancelStatsLoop.set(true);
kParticipant.releaseElement(participant.getParticipantPublicId(), publisher.getEndpoint());
// 3) Create a new PublisherEndpoint connecting it to the previous PassThrough

View File

@ -22,7 +22,7 @@ import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.kurento.client.BaseRtpEndpoint;
@ -94,9 +94,9 @@ public abstract class MediaEndpoint {
public String selectedRemoteIceCandidate;
public Queue<KmsEvent> kmsEvents = new ConcurrentLinkedQueue<>();
public Future<?> kmsWebrtcStatsThread;
public Runnable kmsWebrtcStatsRunnable;
public AtomicInteger statsNotFoundErrors = new AtomicInteger(0);
public AtomicBoolean cancelStatsLoop = new AtomicBoolean(false);
/**
* Constructor to set the owner, the endpoint's name and the media pipeline.