create stub JingleRTPConnection

This commit is contained in:
Daniel Gultsch 2020-04-02 11:30:16 +02:00
parent 963ddd11c2
commit f9650b95d8
5 changed files with 56 additions and 0 deletions

View File

@ -25,6 +25,8 @@ import eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription;
public abstract class AbstractGenerator { public abstract class AbstractGenerator {
private final String[] FEATURES = { private final String[] FEATURES = {
Namespace.JINGLE, Namespace.JINGLE,
//Jingle File Transfer
FileTransferDescription.Version.FT_3.getNamespace(), FileTransferDescription.Version.FT_3.getNamespace(),
FileTransferDescription.Version.FT_4.getNamespace(), FileTransferDescription.Version.FT_4.getNamespace(),
FileTransferDescription.Version.FT_5.getNamespace(), FileTransferDescription.Version.FT_5.getNamespace(),
@ -32,6 +34,13 @@ public abstract class AbstractGenerator {
Namespace.JINGLE_TRANSPORTS_IBB, Namespace.JINGLE_TRANSPORTS_IBB,
Namespace.JINGLE_ENCRYPTED_TRANSPORT, Namespace.JINGLE_ENCRYPTED_TRANSPORT,
Namespace.JINGLE_ENCRYPTED_TRANSPORT_OMEMO, Namespace.JINGLE_ENCRYPTED_TRANSPORT_OMEMO,
//VoIP
Namespace.JINGLE_TRANSPORT_ICE_UDP,
Namespace.JINGLE_FEATURE_AUDIO,
Namespace.JINGLE_FEATURE_VIDEO,
Namespace.JINGLE_APP_RTP,
"http://jabber.org/protocol/muc", "http://jabber.org/protocol/muc",
"jabber:x:conference", "jabber:x:conference",
Namespace.OOB, Namespace.OOB,

View File

@ -30,6 +30,9 @@ public final class Namespace {
public static final String JINGLE_TRANSPORTS_S5B = "urn:xmpp:jingle:transports:s5b:1"; public static final String JINGLE_TRANSPORTS_S5B = "urn:xmpp:jingle:transports:s5b:1";
public static final String JINGLE_TRANSPORTS_IBB = "urn:xmpp:jingle:transports:ibb:1"; public static final String JINGLE_TRANSPORTS_IBB = "urn:xmpp:jingle:transports:ibb:1";
public static final String JINGLE_TRANSPORT_ICE_UDP = "urn:xmpp:jingle:transports:ice-udp:1"; public static final String JINGLE_TRANSPORT_ICE_UDP = "urn:xmpp:jingle:transports:ice-udp:1";
public static final String JINGLE_APP_RTP = "urn:xmpp:jingle:apps:rtp:1";
public static final String JINGLE_FEATURE_AUDIO = "urn:xmpp:jingle:apps:rtp:audio";
public static final String JINGLE_FEATURE_VIDEO = "urn:xmpp:jingle:apps:rtp:video";
public static final String IBB = "http://jabber.org/protocol/ibb"; public static final String IBB = "http://jabber.org/protocol/ibb";
public static final String PING = "urn:xmpp:ping"; public static final String PING = "urn:xmpp:ping";
public static final String PUSH = "urn:xmpp:push:0"; public static final String PUSH = "urn:xmpp:push:0";

View File

@ -41,6 +41,8 @@ public class JingleConnectionManager extends AbstractConnectionManager {
final AbstractJingleConnection connection; final AbstractJingleConnection connection;
if (FileTransferDescription.NAMESPACES.contains(descriptionNamespace)) { if (FileTransferDescription.NAMESPACES.contains(descriptionNamespace)) {
connection = new JingleFileTransferConnection(this, id); connection = new JingleFileTransferConnection(this, id);
} else if (Namespace.JINGLE_APP_RTP.equals(descriptionNamespace)) {
connection = new JingleRtpConnection(this, id);
} else { } else {
//TODO return feature-not-implemented //TODO return feature-not-implemented
return; return;

View File

@ -0,0 +1,19 @@
package eu.siacs.conversations.xmpp.jingle;
import android.util.Log;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket;
public class JingleRtpConnection extends AbstractJingleConnection {
public JingleRtpConnection(JingleConnectionManager jingleConnectionManager, Id id) {
super(jingleConnectionManager, id);
}
@Override
void deliverPacket(final JinglePacket jinglePacket) {
Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": packet delivered to JingleRtpConnection");
}
}

View File

@ -0,0 +1,23 @@
package eu.siacs.conversations.xmpp.jingle.stanzas;
import com.google.common.base.Preconditions;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xml.Namespace;
public class RtpDescription extends GenericDescription {
private RtpDescription(String name, String namespace) {
super(name, namespace);
}
public static RtpDescription upgrade(final Element element) {
Preconditions.checkArgument("description".equals(element.getName()), "Name of provided element is not description");
Preconditions.checkArgument(Namespace.JINGLE_APP_RTP.equals(element.getNamespace()), "Element does not match the jingle rtp namespace");
final RtpDescription description = new RtpDescription("description", Namespace.JINGLE_APP_RTP);
description.setAttributes(element.getAttributes());
description.setChildren(element.getChildren());
return description;
}
}