blob: b8e6685a8784a6214537e7e38d8ad41b77615013 [file] [log] [blame]
Alex Drake43faee02019-08-12 16:27:34 -07001/*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11package org.webrtc;
12
13/**
14 * Representation of a change in selected ICE candidate pair.
15 * {@code CandidatePairChangeEvent} in the C++ API.
16 */
17public final class CandidatePairChangeEvent {
18 public final IceCandidate local;
19 public final IceCandidate remote;
20 public final int lastDataReceivedMs;
21 public final String reason;
22
Jonas Oreland93a9d192020-08-20 12:25:04 +020023 /**
24 * An estimate from the ICE stack on how long it was disconnected before
25 * changing to the new candidate pair in this event.
26 * The first time an candidate pair is signaled the value will be 0.
27 */
28 public final int estimatedDisconnectedTimeMs;
29
Alex Drake43faee02019-08-12 16:27:34 -070030 @CalledByNative
Jonas Oreland93a9d192020-08-20 12:25:04 +020031 CandidatePairChangeEvent(IceCandidate local, IceCandidate remote, int lastDataReceivedMs,
32 String reason, int estimatedDisconnectedTimeMs) {
Alex Drake43faee02019-08-12 16:27:34 -070033 this.local = local;
34 this.remote = remote;
35 this.lastDataReceivedMs = lastDataReceivedMs;
36 this.reason = reason;
Jonas Oreland93a9d192020-08-20 12:25:04 +020037 this.estimatedDisconnectedTimeMs = estimatedDisconnectedTimeMs;
Alex Drake43faee02019-08-12 16:27:34 -070038 }
39}