henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 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. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | package org.webrtc; |
| 12 | |
| 13 | /** |
| 14 | * Representation of a single ICE Candidate, mirroring |
| 15 | * {@code IceCandidateInterface} in the C++ API. |
| 16 | */ |
| 17 | public class IceCandidate { |
| 18 | public final String sdpMid; |
| 19 | public final int sdpMLineIndex; |
| 20 | public final String sdp; |
zhihuang | 8e32cd2 | 2017-02-17 12:45:00 -0800 | [diff] [blame] | 21 | public final String serverUrl; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 22 | |
deadbeef | b856794 | 2017-02-13 14:31:38 -0800 | [diff] [blame] | 23 | public IceCandidate(String sdpMid, int sdpMLineIndex, String sdp) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 24 | this.sdpMid = sdpMid; |
| 25 | this.sdpMLineIndex = sdpMLineIndex; |
| 26 | this.sdp = sdp; |
zhihuang | 8e32cd2 | 2017-02-17 12:45:00 -0800 | [diff] [blame] | 27 | this.serverUrl = ""; |
| 28 | } |
| 29 | |
| 30 | // Only be called internally from JNI. |
| 31 | private IceCandidate(String sdpMid, int sdpMLineIndex, String sdp, String serverUrl) { |
| 32 | this.sdpMid = sdpMid; |
| 33 | this.sdpMLineIndex = sdpMLineIndex; |
| 34 | this.sdp = sdp; |
| 35 | this.serverUrl = serverUrl; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Sami Kalliomäki | bde473e | 2017-10-30 13:34:41 +0100 | [diff] [blame^] | 38 | @Override |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 39 | public String toString() { |
zhihuang | 8e32cd2 | 2017-02-17 12:45:00 -0800 | [diff] [blame] | 40 | return sdpMid + ":" + sdpMLineIndex + ":" + sdp + ":" + serverUrl; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 41 | } |
| 42 | } |