2013-07-10 00:45:36 +00:00
|
|
|
/*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Copyright 2013 The WebRTC project authors. All Rights Reserved.
|
2013-07-10 00:45:36 +00:00
|
|
|
*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2013-07-10 00:45:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package org.webrtc;
|
|
|
|
|
|
2017-01-16 04:57:32 -08:00
|
|
|
import java.util.Locale;
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
/**
|
|
|
|
|
* Description of an RFC 4566 Session.
|
|
|
|
|
* SDPs are passed as serialized Strings in Java-land and are materialized
|
|
|
|
|
* to SessionDescriptionInterface as appropriate in the JNI layer.
|
|
|
|
|
*/
|
|
|
|
|
public class SessionDescription {
|
|
|
|
|
/** Java-land enum version of SessionDescriptionInterface's type() string. */
|
|
|
|
|
public static enum Type {
|
|
|
|
|
OFFER,
|
|
|
|
|
PRANSWER,
|
|
|
|
|
ANSWER;
|
|
|
|
|
|
|
|
|
|
public String canonicalForm() {
|
2017-01-16 04:57:32 -08:00
|
|
|
return name().toLowerCase(Locale.US);
|
2013-07-10 00:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Type fromCanonicalForm(String canonical) {
|
2017-01-16 04:57:32 -08:00
|
|
|
return Type.valueOf(Type.class, canonical.toUpperCase(Locale.US));
|
2013-07-10 00:45:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public final Type type;
|
|
|
|
|
public final String description;
|
|
|
|
|
|
|
|
|
|
public SessionDescription(Type type, String description) {
|
|
|
|
|
this.type = type;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
}
|