Commit 32a68a5d authored by Dele Olajide's avatar Dele Olajide Committed by dele

Jitsi Videobridge plugin - removed config.js and enable configuration from...

Jitsi Videobridge plugin - removed config.js and enable configuration from openfire admin web console.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@14007 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3aec383e
......@@ -883,7 +883,7 @@ function handleOffer (from, offer)
//console.log("bridgeSDP.raw", bridgeSDP.raw);
window.RTC.rayo.pc[videobridge] = new window.RTC.peerconnection(null, {'optional': [{'DtlsSrtpKeyAgreement': 'true'}, {googIPv6: config.useIPv6}]});
window.RTC.rayo.pc[videobridge] = new window.RTC.peerconnection(config.iceServers, {'optional': [{'DtlsSrtpKeyAgreement': 'true'}, {googIPv6: config.useIPv6}]});
window.RTC.rayo.pc[videobridge].onicecandidate = function(event)
......
plugin.title=Jitsi Videobridge
plugin.title.description=Jitsi Videobridge Settings
config.page.title=Jitsi Videobridge Settings Page
config.page.configuration.media.title=Configuration
config.page.configuration.media.title=Media Configuration
config.page.configuration.security.title=Security
config.page.configuration.recording.title=Recordings
config.page.configuration.telephone.title=SIP Registration
......@@ -22,3 +22,14 @@ config.page.configuration.outboundproxy=Outbound Proxy
config.page.configuration.save.title=Save Settings
config.page.configuration.submit=Save
config.page.configuration.restart.warning=Changes to any of these parameters requires a restart of Openfire.
config.page.configuration.ofmeet.title=OfMeet Configuration
config.page.configuration.ofmeet.useipv6.enabled=Enable IPv6
config.page.configuration.ofmeet.useipv6.enabled_desc=Enable webrtc to use IPv6
config.page.configuration.ofmeet.useipv6.disabled=Disable IPv6
config.page.configuration.ofmeet.useipv6.disabled_desc=Do not use IPv6 for webrtc
config.page.configuration.ofmeet.usenicks.enabled=Enable Nicknames
config.page.configuration.ofmeet.usenicks.enabled_desc=Prompt user to enter a nickname
config.page.configuration.ofmeet.usenicks.disabled=Disable Nicknames
config.page.configuration.ofmeet.usenicks.disabled_desc=Do not prompt user to provide a nickname
config.page.configuration.ofmeet.iceservers=ICE Servers
config.page.configuration.ofmeet.resolution=Video Resolution
\ No newline at end of file
......@@ -88,10 +88,13 @@ public class MatroskaFileWriter
public void writeSegmentHeader()
{
MatroskaSegment segmentElem = (MatroskaSegment)doc.createElement(MatroskaDocType.Segment_Id);
//MatroskaSegment segmentElem = (MatroskaSegment)doc.createElement(MatroskaDocType.Segment_Id);
//segmentElem.setSize(-1);
segmentElem.setUnknownSize(true);
segmentElem.writeHeaderData(ioDW);
//segmentElem.setUnknownSize(false);
//segmentElem.writeHeaderData(ioDW);
MasterElement ebmlHeaderElem = (MasterElement)doc.createElement(MatroskaDocType.Segment_Id);
ebmlHeaderElem.writeElement(ioDW);
}
public void writeSegmentInfo()
......
package org.ifsoft.rtp;
public class ArrayExtensions
{
public ArrayExtensions()
{
}
public static Integer getLength(Object array[])
{
return Integer.valueOf(array.length);
}
public static Integer getLength(byte array[])
{
return Integer.valueOf(array.length);
}
}
package org.ifsoft.rtp;
import java.nio.ByteBuffer;
public class BitAssistant
{
public BitAssistant()
{
}
public static Boolean isLittleEndian()
{
return Boolean.valueOf(false);
}
public static Boolean sequencesAreEqual(byte array1[], byte array2[])
{
if(array1 == null && array2 == null)
return Boolean.valueOf(true);
if(array1 == null || array2 == null)
return Boolean.valueOf(false);
if(array1.length != array2.length)
return Boolean.valueOf(false);
for(int i = 0; i < array1.length; i++)
if(array1[i] != array2[i])
return Boolean.valueOf(false);
return Boolean.valueOf(true);
}
public static boolean sequencesAreEqual(byte array1[], int offset1, byte array2[], int offset2, int length)
{
if(array1 == null && array2 == null)
return true;
if(array1 == null || array2 == null)
return false;
if(array1.length < offset1 + length || array2.length < offset2 + length)
return false;
for(int i = 0; i < length; i++)
if(array1[offset1 + i] != array2[offset2 + i])
return false;
return true;
}
public static boolean sequencesAreEqualConstantTime(byte array1[], byte array2[])
{
if(array1 == null && array2 == null)
return true;
if(array1 == null || array2 == null)
return false;
if(array1.length != array2.length)
return false;
boolean areEqual = true;
for(int i = 0; i < array1.length; i++)
if(array1[i] != array2[i])
areEqual = false;
return areEqual;
}
public static boolean sequencesAreEqualConstantTime(byte array1[], int offset1, byte array2[], int offset2, int length)
{
if(array1 == null && array2 == null)
return true;
if(array1 == null || array2 == null)
return false;
if(array1.length < offset1 + length || array2.length < offset2 + length)
return false;
boolean areEqual = true;
for(int i = 0; i < length; i++)
if(array1[offset1 + i] != array2[offset2 + i])
areEqual = false;
return areEqual;
}
public static byte[] subArray(byte array[], Integer offset)
{
return subArray(array, offset, Integer.valueOf(array.length - offset.intValue()));
}
public static byte[] subArray(byte array[], Integer offset, Integer count)
{
byte subarray[] = new byte[count.intValue()];
for(int i = 0; i < count.intValue(); i++)
subarray[i] = array[offset.intValue() + i];
return subarray;
}
public static void reverse(byte array[])
{
for(int i = 0; i < array.length / 2; i++)
{
byte t = array[array.length - i - 1];
array[array.length - i - 1] = array[i];
array[i] = t;
}
}
public static void copy(byte source[], int sourceIndex, byte destination[], int destinationIndex, int length)
{
for(int i = 0; i < length; i++)
destination[destinationIndex + i] = source[sourceIndex + i];
}
public static String getHexString(byte array[])
{
return getHexString(array, 0, array.length);
}
public static String getHexString(byte array[], int offset, int length)
{
StringBuilder sb = new StringBuilder();
for(int i = offset; i < offset + length; i++)
{
String hex = Integer.toHexString(0xff & array[i]);
if(hex.length() == 1)
sb.append('0');
sb.append(hex);
}
return sb.toString();
}
public static byte[] getHexBytes(String s)
{
int len = s.length();
byte bytes[] = new byte[len / 2];
for(int i = 0; i < len; i += 2)
bytes[i / 2] = (byte)((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16));
return bytes;
}
public static byte[] getBooleanBytes(Boolean value)
{
byte bytes[] = new byte[1];
if(value.booleanValue())
bytes[0] = 1;
else
bytes[0] = 0;
return bytes;
}
public static byte[] getDoubleBytes(Double value)
{
byte bytes[] = new byte[8];
ByteBuffer.wrap(bytes).putDouble(value.doubleValue());
return bytes;
}
public static byte[] getFloatBytes(Float value)
{
byte bytes[] = new byte[4];
ByteBuffer.wrap(bytes).putFloat(value.floatValue());
return bytes;
}
public static byte[] getIntegerBytes(Integer value)
{
byte bytes[] = new byte[4];
ByteBuffer.wrap(bytes).putInt(value.intValue());
return bytes;
}
public static byte[] getIntegerBytesFromLong(Long value)
{
byte bytes[] = getLongBytes(value);
if(isLittleEndian().booleanValue())
return subArray(bytes, Integer.valueOf(0), Integer.valueOf(4));
else
return subArray(bytes, Integer.valueOf(4), Integer.valueOf(4));
}
public static byte[] getLongBytes(Long value)
{
byte bytes[] = new byte[8];
ByteBuffer.wrap(bytes).putLong(value.longValue());
return bytes;
}
public static byte[] getShortBytes(Short value)
{
byte bytes[] = new byte[2];
ByteBuffer.wrap(bytes).putShort(value.shortValue());
return bytes;
}
public static byte[] getShortBytesFromInteger(Integer value)
{
byte bytes[] = getIntegerBytes(value);
if(isLittleEndian().booleanValue())
return subArray(bytes, Integer.valueOf(0), Integer.valueOf(2));
else
return subArray(bytes, Integer.valueOf(2), Integer.valueOf(2));
}
public static Boolean toBoolean(byte value[], Integer startIndex)
{
if(value[startIndex.intValue()] == 0)
return Boolean.valueOf(false);
else
return Boolean.valueOf(true);
}
public static Double toDouble(byte value[], Integer startIndex)
{
return Double.valueOf(ByteBuffer.wrap(value).getDouble(startIndex.intValue()));
}
public static Float toFloat(byte value[], Integer startIndex)
{
return Float.valueOf(ByteBuffer.wrap(value).getFloat(startIndex.intValue()));
}
public static Integer toInteger(byte value[], Integer startIndex)
{
return Integer.valueOf(ByteBuffer.wrap(value).getInt(startIndex.intValue()));
}
public static Integer toIntegerFromShort(byte value[], Integer startIndex)
{
byte bytes[] = new byte[4];
if(isLittleEndian().booleanValue())
{
bytes[0] = value[startIndex.intValue()];
bytes[1] = value[startIndex.intValue() + 1];
bytes[2] = 0;
bytes[3] = 0;
} else
{
bytes[0] = 0;
bytes[1] = 0;
bytes[2] = value[startIndex.intValue()];
bytes[3] = value[startIndex.intValue() + 1];
}
return toInteger(bytes, Integer.valueOf(0));
}
public static Long toLong(byte value[], Integer startIndex)
{
return Long.valueOf(ByteBuffer.wrap(value).getLong(startIndex.intValue()));
}
public static Long toLongFromInteger(byte value[], Integer startIndex)
{
byte bytes[] = new byte[8];
if(isLittleEndian().booleanValue())
{
bytes[0] = value[startIndex.intValue()];
bytes[1] = value[startIndex.intValue() + 1];
bytes[2] = value[startIndex.intValue() + 2];
bytes[3] = value[startIndex.intValue() + 3];
bytes[4] = 0;
bytes[5] = 0;
bytes[6] = 0;
bytes[7] = 0;
} else
{
bytes[0] = 0;
bytes[1] = 0;
bytes[2] = 0;
bytes[3] = 0;
bytes[4] = value[startIndex.intValue()];
bytes[5] = value[startIndex.intValue() + 1];
bytes[6] = value[startIndex.intValue() + 2];
bytes[7] = value[startIndex.intValue() + 3];
}
return toLong(bytes, Integer.valueOf(0));
}
public static Short toShort(byte value[], Integer startIndex)
{
return Short.valueOf(ByteBuffer.wrap(value).getShort(startIndex.intValue()));
}
public static byte[] getBooleanBytesNetwork(Boolean value)
{
byte bytes[] = getBooleanBytes(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getDoubleBytesNetwork(Double value)
{
byte bytes[] = getDoubleBytes(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getFloatBytesNetwork(Float value)
{
byte bytes[] = getFloatBytes(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getIntegerBytesNetwork(Integer value)
{
byte bytes[] = getIntegerBytes(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getIntegerBytesFromLongNetwork(Long value)
{
byte bytes[] = getIntegerBytesFromLong(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getLongBytesNetwork(Long value)
{
byte bytes[] = getLongBytes(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getShortBytesNetwork(Short value)
{
byte bytes[] = getShortBytes(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static byte[] getShortBytesFromIntegerNetwork(Integer value)
{
byte bytes[] = getShortBytesFromInteger(value);
if(isLittleEndian().booleanValue())
reverse(bytes);
return bytes;
}
public static Boolean toBooleanNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[1];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toBoolean(bytes, Integer.valueOf(0));
}
public static Double toDoubleNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[8];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toDouble(bytes, Integer.valueOf(0));
}
public static Float toFloatNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[4];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toFloat(bytes, Integer.valueOf(0));
}
public static Integer toIntegerNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[4];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toInteger(bytes, Integer.valueOf(0));
}
public static Integer toIntegerFromShortNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[2];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toIntegerFromShort(bytes, Integer.valueOf(0));
}
public static Long toLongNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[8];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toLong(bytes, Integer.valueOf(0));
}
public static Long toLongFromIntegerNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[4];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toLongFromInteger(bytes, Integer.valueOf(0));
}
public static Short toShortNetwork(byte value[], Integer startIndex)
{
byte bytes[] = new byte[2];
for(int i = 0; i < bytes.length; i++)
bytes[i] = value[startIndex.intValue() + i];
if(isLittleEndian().booleanValue())
reverse(bytes);
return toShort(bytes, Integer.valueOf(0));
}
}
package org.ifsoft.rtp;
import java.util.ArrayList;
import java.util.Iterator;
public class ByteCollection
{
private ArrayList arrayList;
public void add(byte b)
{
arrayList.add(Byte.valueOf(b));
}
public void add(int b)
{
arrayList.add(Byte.valueOf((byte)b));
}
public void addRange(byte buffer[])
{
byte arr$[] = buffer;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
byte b = arr$[i$];
add(b);
}
}
public void addRange(ByteCollection collection)
{
byte b;
for(Iterator i$ = collection.getList().iterator(); i$.hasNext(); add(b))
b = ((Byte)i$.next()).byteValue();
}
public ByteCollection()
{
arrayList = new ArrayList();
}
public ByteCollection(byte buffer[])
{
arrayList = new ArrayList();
addRange(buffer);
}
public byte get(Integer index)
{
return ((Byte)arrayList.get(index.intValue())).byteValue();
}
public Integer getCount()
{
return Integer.valueOf(arrayList.size());
}
ArrayList getList()
{
return arrayList;
}
public byte[] getRange(Integer index, Integer count)
{
byte range[] = new byte[count.intValue()];
for(int i = 0; i < count.intValue(); i++)
range[i] = ((Byte)arrayList.get(index.intValue() + i)).byteValue();
return range;
}
public void insertRange(Integer index, byte buffer[])
{
for(int i = 0; i < buffer.length; i++)
arrayList.add(index.intValue() + i, Byte.valueOf(buffer[i]));
}
public void insertRange(Integer index, ByteCollection collection)
{
for(int i = 0; i < collection.getCount().intValue(); i++)
arrayList.add(index.intValue() + i, Byte.valueOf(collection.get(Integer.valueOf(i))));
}
public void removeRange(Integer index, Integer count)
{
removeRange(arrayList, index.intValue(), count.intValue());
}
public byte[] toArray()
{
byte array[] = new byte[arrayList.size()];
for(int i = 0; i < array.length; i++)
array[i] = ((Byte)arrayList.get(i)).byteValue();
return array;
}
public void removeRange(ArrayList array, int index, int count)
{
for(int i = 0; i < count; i++)
array.remove(index);
}
}
package org.ifsoft.rtp;
import java.util.ArrayList;
public class Vp8Accumulator
{
private ArrayList packets;
public void add(Vp8Packet packet)
{
if(packet.getStartOfPartition().booleanValue() || packets.size() > 0)
packets.add(packet);
}
public Vp8Packet[] getPackets()
{
return (Vp8Packet[])packets.toArray(new Vp8Packet[0]);
}
public void reset()
{
packets = new ArrayList();
}
public Vp8Accumulator()
{
packets = new ArrayList();
}
}
package org.ifsoft.rtp;
import java.util.ArrayList;
public class Vp8Packet
{
private Boolean _extendedControlBitsPresent;
private byte _keyIndex;
private Boolean _keyIndexPresent;
private Boolean _layerSync;
public static Integer _maxPacketSize = Integer.valueOf(1050);
private Boolean _nonReferenceFrame;
private byte _partitionId;
private byte _payload[];
private Short _pictureID;
private Boolean _pictureIDPresent;
private Boolean _startOfPartition;
private byte _temporalLayerIndex;
private Boolean _temporalLayerIndexPresent;
private byte _temporalLevelZeroIndex;
private Boolean _temporalLevelZeroIndexPresent;
public Vp8Packet()
{
_extendedControlBitsPresent = Boolean.valueOf(false);
_keyIndexPresent = Boolean.valueOf(false);
_layerSync = Boolean.valueOf(false);
_nonReferenceFrame = Boolean.valueOf(false);
_pictureID = Short.valueOf((short)0);
_pictureIDPresent = Boolean.valueOf(false);
_startOfPartition = Boolean.valueOf(false);
_temporalLayerIndexPresent = Boolean.valueOf(false);
_temporalLevelZeroIndexPresent = Boolean.valueOf(false);
}
public static byte[] depacketize(Vp8Packet packets[])
{
Integer num = Integer.valueOf(0);
Vp8Packet arr[] = packets;
int len = arr.length;
for(int i = 0; i < len; i++)
{
Vp8Packet packet = arr[i];
num = Integer.valueOf(num.intValue() + ArrayExtensions.getLength(packet.getPayload()).intValue());
}
Integer destinationIndex = Integer.valueOf(0);
byte destination[] = new byte[num.intValue()];
arr = packets;
len = arr.length;
for(int i = 0; i < len; i++)
{
Vp8Packet packet = arr[i];
BitAssistant.copy(packet.getPayload(), 0, destination, destinationIndex.intValue(), ArrayExtensions.getLength(packet.getPayload()).intValue());
destinationIndex = Integer.valueOf(destinationIndex.intValue() + ArrayExtensions.getLength(packet.getPayload()).intValue());
}
return destination;
}
public static byte[] getBytes(Vp8Packet packet)
{
ByteCollection bytes = new ByteCollection();
bytes.add((new Integer((packet.getExtendedControlBitsPresent().booleanValue() ? 0x80 : 0) | (packet.getNonReferenceFrame().booleanValue() ? 0x20 : 0) | (packet.getStartOfPartition().booleanValue() ? 0x10 : 0) | packet.getPartitionId() & 0xf)).byteValue());
if(packet.getExtendedControlBitsPresent().booleanValue())
{
bytes.add((new Integer((packet.getPictureIDPresent().booleanValue() ? 0x80 : 0) | (packet.getTemporalLevelZeroIndexPresent().booleanValue() ? 0x40 : 0) | (packet.getTemporalLayerIndexPresent().booleanValue() ? 0x20 : 0) | (packet.getKeyIndexPresent().booleanValue() ? 0x10 : 0))).byteValue());
if(packet.getPictureIDPresent().booleanValue())
{
byte shortBytesNetwork[] = BitAssistant.getShortBytesNetwork(packet.getPictureID());
bytes.add((new Integer(0x80 | shortBytesNetwork[0] & 0x7f)).byteValue());
bytes.add(shortBytesNetwork[1]);
}
if(packet.getTemporalLevelZeroIndexPresent().booleanValue())
bytes.add(packet.getTemporalLevelZeroIndex());
if(packet.getTemporalLayerIndexPresent().booleanValue() || packet.getKeyIndexPresent().booleanValue())
bytes.add((byte)(packet.getTemporalLayerIndex() << 6 & 0xc0 | (packet.getLayerSync().booleanValue() ? 0x20 : 0) | packet.getKeyIndex() & 0x1f));
}
bytes.addRange(packet.getPayload());
return bytes.toArray();
}
public byte[] getBytes()
{
return getBytes(this);
}
public Boolean getExtendedControlBitsPresent()
{
return _extendedControlBitsPresent;
}
public byte getKeyIndex()
{
return _keyIndex;
}
public Boolean getKeyIndexPresent()
{
return _keyIndexPresent;
}
public Boolean getLayerSync()
{
return _layerSync;
}
public Boolean getNonReferenceFrame()
{
return _nonReferenceFrame;
}
public byte getPartitionId()
{
return _partitionId;
}
public byte[] getPayload()
{
return _payload;
}
public Short getPictureID()
{
return _pictureID;
}
public Boolean getPictureIDPresent()
{
return _pictureIDPresent;
}
public Boolean getStartOfPartition()
{
return _startOfPartition;
}
public byte getTemporalLayerIndex()
{
return _temporalLayerIndex;
}
public Boolean getTemporalLayerIndexPresent()
{
return _temporalLayerIndexPresent;
}
public byte getTemporalLevelZeroIndex()
{
return _temporalLevelZeroIndex;
}
public Boolean getTemporalLevelZeroIndexPresent()
{
return _temporalLevelZeroIndexPresent;
}
public static Vp8Packet[] packetize(byte encodedData[])
{
Integer offset = Integer.valueOf(0);
ArrayList list = new ArrayList();
Integer num2 = Integer.valueOf(1049);
Integer num3 = new Integer((new Double(Math.ceil(new Double((new Double((new Integer(ArrayExtensions.getLength(encodedData).intValue())).doubleValue())).doubleValue() / (new Double((new Integer(num2.intValue())).doubleValue())).doubleValue())))).intValue());
if(num3.intValue() == 0)
num3 = Integer.valueOf(1);
Integer num4 = Integer.valueOf(ArrayExtensions.getLength(encodedData).intValue() / num3.intValue());
Integer num5 = Integer.valueOf(ArrayExtensions.getLength(encodedData).intValue() - num3.intValue() * num4.intValue());
for(Integer i = Integer.valueOf(0); i.intValue() < num3.intValue();)
{
Integer count = num4;
if(i.intValue() < num5.intValue())
{
Integer integer = count;
Integer integer1 = count = Integer.valueOf(count.intValue() + 1);
Integer _tmp = integer;
}
Vp8Packet item = new Vp8Packet();
item.setStartOfPartition(Boolean.valueOf(i.intValue() == 0));
item.setPayload(BitAssistant.subArray(encodedData, offset, count));
list.add(item);
offset = Integer.valueOf(offset.intValue() + count.intValue());
count = i;
i = Integer.valueOf(i.intValue() + 1);
Integer _tmp1 = count;
}
return (Vp8Packet[])list.toArray(new Vp8Packet[0]);
}
public static Vp8Packet parseBytes(byte packetBytes[])
{
Integer index = Integer.valueOf(0);
Vp8Packet packet = new Vp8Packet();
byte num2 = packetBytes[index.intValue()];
packet.setExtendedControlBitsPresent(Boolean.valueOf((num2 & 0x80) == 128));
packet.setNonReferenceFrame(Boolean.valueOf((num2 & 0x20) == 32));
packet.setStartOfPartition(Boolean.valueOf((num2 & 0x10) == 16));
packet.setPartitionId((byte)(num2 & 0xf));
Integer integer = index;
Integer integer1 = index = Integer.valueOf(index.intValue() + 1);
Integer _tmp = integer;
if(packet.getExtendedControlBitsPresent().booleanValue())
{
byte num3 = packetBytes[index.intValue()];
packet.setPictureIDPresent(Boolean.valueOf((num3 & 0x80) == 128));
packet.setTemporalLevelZeroIndexPresent(Boolean.valueOf((num3 & 0x40) == 64));
packet.setTemporalLayerIndexPresent(Boolean.valueOf((num3 & 0x20) == 32));
packet.setKeyIndexPresent(Boolean.valueOf((num3 & 0x10) == 16));
Integer integer2 = index;
Integer integer5 = index = Integer.valueOf(index.intValue() + 1);
Integer _tmp1 = integer2;
if(packet.getPictureIDPresent().booleanValue())
if((packetBytes[index.intValue()] & 0x80) == 128)
{
byte buffer[] = BitAssistant.subArray(packetBytes, index, Integer.valueOf(2));
buffer[0] = (byte)(buffer[0] & 0x7f);
packet.setPictureID(BitAssistant.toShortNetwork(buffer, Integer.valueOf(0)));
index = Integer.valueOf(index.intValue() + 2);
} else
{
byte buffer2[] = new byte[2];
buffer2[1] = packetBytes[index.intValue()];
packet.setPictureID(BitAssistant.toShortNetwork(buffer2, Integer.valueOf(0)));
Integer integer6 = index;
Integer integer9 = index = Integer.valueOf(index.intValue() + 1);
Integer _tmp2 = integer6;
}
if(packet.getTemporalLevelZeroIndexPresent().booleanValue())
{
packet.setTemporalLevelZeroIndex(packetBytes[index.intValue()]);
Integer integer3 = index;
Integer integer7 = index = Integer.valueOf(index.intValue() + 1);
Integer _tmp3 = integer3;
}
if(packet.getTemporalLayerIndexPresent().booleanValue() || packet.getKeyIndexPresent().booleanValue())
{
packet.setTemporalLayerIndex((byte)(packetBytes[index.intValue()] >> 6 & 3));
packet.setLayerSync(Boolean.valueOf((packetBytes[index.intValue()] & 0x20) == 32));
packet.setKeyIndex((byte)(packetBytes[index.intValue()] & 0x1f));
Integer integer4 = index;
Integer integer8 = index = Integer.valueOf(index.intValue() + 1);
Integer _tmp4 = integer4;
}
}
packet.setPayload(BitAssistant.subArray(packetBytes, index));
return packet;
}
private void setExtendedControlBitsPresent(Boolean value)
{
_extendedControlBitsPresent = value;
}
private void setKeyIndex(byte value)
{
_keyIndex = value;
}
private void setKeyIndexPresent(Boolean value)
{
_keyIndexPresent = value;
}
private void setLayerSync(Boolean value)
{
_layerSync = value;
}
private void setNonReferenceFrame(Boolean value)
{
_nonReferenceFrame = value;
}
private void setPartitionId(byte value)
{
_partitionId = value;
}
private void setPayload(byte value[])
{
_payload = value;
}
private void setPictureID(Short value)
{
_pictureID = value;
}
private void setPictureIDPresent(Boolean value)
{
_pictureIDPresent = value;
}
private void setStartOfPartition(Boolean value)
{
_startOfPartition = value;
}
private void setTemporalLayerIndex(byte value)
{
_temporalLayerIndex = value;
}
private void setTemporalLayerIndexPresent(Boolean value)
{
_temporalLayerIndexPresent = value;
}
private void setTemporalLevelZeroIndex(byte value)
{
_temporalLevelZeroIndex = value;
}
private void setTemporalLevelZeroIndexPresent(Boolean value)
{
_temporalLevelZeroIndexPresent = value;
}
public static Integer getSequenceNumberDelta(Integer sequenceNumber, Integer lastSequenceNumber)
{
Integer num = Integer.valueOf(sequenceNumber.intValue() - lastSequenceNumber.intValue());
if(num.intValue() < -32768)
return Integer.valueOf(num.intValue() + 65535);
if(num.intValue() > 32768)
num = Integer.valueOf(num.intValue() - 65535);
return num;
}
}
......@@ -43,16 +43,22 @@ public class Config extends HttpServlet
ServletOutputStream out = response.getOutputStream();
String iceServers = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.iceservers", "");
String resolution = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.resolution", "720");
String useNicks = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.usenicks", "false");
String useIPv6 = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.useipv6", "false");
out.println("var config = {");
out.println(" hosts: {");
out.println(" domain: '" + domain + "',");
out.println(" muc: 'conference." + domain + "',");
out.println(" bridge: 'jitsi-videobridge." + domain + "',");
out.println(" },");
out.println(" useIPv6: false,");
out.println(" useNicks: false,");
if (!iceServers.trim().equals("")) out.println(" iceServers: " + iceServers + ",");
out.println(" useIPv6: " + useIPv6 + ",");
out.println(" useNicks: " + useNicks + ",");
out.println(" useWebsockets: " + (websockets ? "true" : "false") + ",");
out.println(" resolution: '720',");
out.println(" resolution: '" + resolution + "',");
out.println(" bosh: window.location.protocol + '//' + window.location.host + '/http-bind/'");
out.println("}; ");
......
......@@ -73,6 +73,7 @@ import org.ifsoft.*;
import org.ifsoft.sip.*;
import net.sf.fmj.media.rtp.*;
import org.ifsoft.rtp.*;
/**
* Implements <tt>org.jivesoftware.openfire.container.Plugin</tt> to integrate
......@@ -1011,13 +1012,15 @@ public class PluginImpl implements Plugin, PropertyEventListener
*
*
*/
private JID user;
private byte partial[];
private int lastseqnum = -1;
private Vp8Accumulator _accumulator = new Vp8Accumulator();
private Integer _lastSequenceNumber = Integer.valueOf(-1);
private boolean _sequenceNumberingViolated = false;
private Participant me = this;
private int snapshot = 0;
private boolean isKeyframe = false;
private JID user;
/**
*
*
......@@ -1053,7 +1056,7 @@ public class PluginImpl implements Plugin, PropertyEventListener
*/
public void recordData(RawPacket packet)
{
if (snapshot < 1) Log.info("transferData " + packet.getPayloadLength() + " " + packet.getHeaderLength() + " " + packet.getExtensionLength());
//if (snapshot < 1) Log.info("transferData " + packet.getPayloadLength() + " " + packet.getHeaderLength() + " " + packet.getExtensionLength());
try {
......@@ -1061,96 +1064,40 @@ public class PluginImpl implements Plugin, PropertyEventListener
{
byte[] rtp = packet.getPayload();
if (rtp.length < 2) return; //bad packet
int vp8Length = packet.getPayloadLength();
int payloadOffset = 0;
if (partial == null) {
partial = new byte[0];
}
if (snapshot < 1) Log.info("expecting X R N S PartID");
byte x = rtp[payloadOffset]; //X R N S PartID
payloadOffset++;
vp8Length--;
if ((x & 0x80) != 0) // extened bits
{
if (snapshot < 1) Log.info("found I L T RSV-A");
byte ilt = rtp[payloadOffset]; //I L T RSV-A
payloadOffset++;
vp8Length--;
if ((ilt & 0x80) != 0) { //picture ID
byte m = rtp[payloadOffset]; //picture ID
if (snapshot < 1) Log.info("found picture ID 1");
payloadOffset++;
vp8Length--;
if(!_sequenceNumberingViolated && _lastSequenceNumber.intValue() > -1 && Vp8Packet.getSequenceNumberDelta(packet.getSequenceNumber(), _lastSequenceNumber).intValue() > 1)
_sequenceNumberingViolated = true;
if ((m & 0x80) != 0)
{
if (snapshot < 1) Log.info("found picture ID 2");
payloadOffset++;
vp8Length--;
}
}
_lastSequenceNumber = packet.getSequenceNumber();
Vp8Packet packet2 = Vp8Packet.parseBytes(rtp);
if ((ilt & 0x40) != 0) { //TL0PICIDX
if (snapshot < 1) Log.info("found TL0PICIDX");
payloadOffset++;
vp8Length--;
}
if(packet2 == null) return;
if ((ilt & 0x20) != 0 || (ilt & 0x10) != 0) { //TID RSV-B
if (snapshot < 1) Log.info("found TID RSV-B or keyframe index");
payloadOffset++;
vp8Length--;
}
}
_accumulator.add(packet2);
byte encodedFrame[] = null;
if ((x & 0x10) != 0 && (x & 0x0f) == 0 && vp8Length >= 3) // start of partition
if (packet.isPacketMarked())
{
if (snapshot < 1) Log.info("found start of partition " + x);
partial = new byte[0];
isKeyframe = (rtp[payloadOffset] & 0x1) == 0;
}
int partialLength = partial.length;
partial = Arrays.copyOf(partial, partial.length + vp8Length);
System.arraycopy(rtp, payloadOffset, partial, partialLength, vp8Length);
encodedFrame = Vp8Packet.depacketize(_accumulator.getPackets());
boolean isKeyframe = encodedFrame != null && encodedFrame.length > 0 && (encodedFrame[0] & 1) == 0;
int thisseqnum = packet.getSequenceNumber();
if(_sequenceNumberingViolated && isKeyframe)
_sequenceNumberingViolated = false;
if (lastseqnum != -1 && thisseqnum != lastseqnum + 1) {
if (snapshot < 1) Log.info("VP8:Received packet out of order, discarding frame.");
partial = null;
lastseqnum = -1;
return;
}
lastseqnum = thisseqnum;
_accumulator.reset();
if (packet.isPacketMarked())
{
if (recorder != null && partial != null)
if (recorder != null && encodedFrame != null && _sequenceNumberingViolated == false)
{
byte[] full = Arrays.copyOf(partial, partial.length);
if (snapshot < 1) Log.info("recordData " + " " + packet.getPayloadType() + " " + full + " " + packet.getSequenceNumber() + " " + isKeyframe);
byte[] full = Arrays.copyOf(encodedFrame, encodedFrame.length);
recorder.write(full, 0, full.length, isKeyframe, packet.getTimestamp());
if (isKeyframe && snapshot < 1)
{
Log.info("recordData " + " " + packet.getPayloadType() + " " + full + " " + packet.getSequenceNumber() + " " + packet.getTimestamp());
recorder.writeWebPImage(full, 0, full.length, packet.getTimestamp());
snapshot++;
}
}
partial = null;
lastseqnum = -1;
}
} else {
Log.error("record video cannot parse packet data " + packet);
......@@ -1168,7 +1115,7 @@ public class PluginImpl implements Plugin, PropertyEventListener
this.nickname = nickname;
this.user = user;
this.focusName = focusName;
this.sequenceNumberingViolated = Boolean.valueOf(false);
this.sequenceNumberingViolated = false;
this.lastSequenceNumber = Integer.valueOf(-1);
}
/**
......
......@@ -122,7 +122,7 @@ public class Recorder extends Thread
MatroskaFileTrack track = new MatroskaFileTrack();
track.TrackNo = (short)1;
track.TrackUID = new java.util.Random().nextLong();
track.TrackUID = (long)1;
track.TrackType = MatroskaDocType.track_video;
track.Name = "VP8";
track.CodecName = "VP8";
......
......@@ -83,6 +83,19 @@
String outboundproxy = request.getParameter("outboundproxy");
JiveGlobals.setProperty("voicebridge.default.proxy.outboundproxy", outboundproxy);
String iceServers = request.getParameter("iceservers");
JiveGlobals.setProperty("org.jitsi.videobridge.ofmeet.iceservers", iceServers);
String useIPv6 = request.getParameter("useipv6");
JiveGlobals.setProperty("org.jitsi.videobridge.ofmeet.useipv6", useIPv6);
String useNicks = request.getParameter("usenicks");
JiveGlobals.setProperty("org.jitsi.videobridge.ofmeet.usenicks", useNicks);
String resolution = request.getParameter("resolution");
JiveGlobals.setProperty("org.jitsi.videobridge.ofmeet.resolution", resolution);
}
%>
......@@ -102,6 +115,58 @@
<div class="jive-table">
<form action="jitsi-videobridge.jsp" method="post">
<p>
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="50%">
<thead>
<tr>
<th colspan="2"><fmt:message key="config.page.configuration.ofmeet.title"/></th>
</tr>
</thead>
<tbody>
<tr>
<td nowrap colspan="2">
<input type="radio" value="false" name="useipv6" <%= ("false".equals(JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.useipv6", "false")) ? "checked" : "") %>>
<b><fmt:message key="config.page.configuration.ofmeet.useipv6.disabled" /></b> - <fmt:message key="config.page.configuration.ofmeet.useipv6.disabled_desc" />
</td>
</tr>
<tr>
<td nowrap colspan="2">
<input type="radio" value="true" name="useipv6" <%= ("true".equals(JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.useipv6", "false")) ? "checked" : "") %>>
<b><fmt:message key="config.page.configuration.ofmeet.useipv6.enabled" /></b> - <fmt:message key="config.page.configuration.ofmeet.useipv6.enabled_desc" />
</td>
</tr>
<tr>
<td nowrap colspan="2">
<input type="radio" value="false" name="usenicks" <%= ("false".equals(JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.usenicks", "false")) ? "checked" : "") %>>
<b><fmt:message key="config.page.configuration.ofmeet.usenicks.disabled" /></b> - <fmt:message key="config.page.configuration.ofmeet.usenicks.disabled_desc" />
</td>
</tr>
<tr>
<td nowrap colspan="2">
<input type="radio" value="true" name="usenicks" <%= ("true".equals(JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.usenicks", "false")) ? "checked" : "") %>>
<b><fmt:message key="config.page.configuration.ofmeet.usenicks.enabled" /></b> - <fmt:message key="config.page.configuration.ofmeet.usenicks.enabled_desc" />
</td>
</tr>
<tr>
<td align="left" width="150">
<fmt:message key="config.page.configuration.ofmeet.iceservers"/>
</td>
<td><input type="text" size="50" maxlength="100" name="iceservers"
value="<%= JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.iceservers", "") %>">
</td>
</tr>
<tr>
<td align="left" width="150">
<fmt:message key="config.page.configuration.ofmeet.resolution"/>
</td>
<td><input type="text" size="10" maxlength="100" name="resolution"
value="<%= JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.resolution", "720") %>">
</td>
</tr>
</tbody>
</table>
</p>
<p>
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="50%">
<thead>
<tr>
......@@ -127,7 +192,8 @@
</tr>
</tbody>
</table>
<p/>
</p>
<p>
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="50%">
<thead>
<tr>
......@@ -153,7 +219,8 @@
</tr>
</tbody>
</table>
<p/>
</p>
<p>
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="50%">
<thead>
<tr>
......@@ -175,7 +242,8 @@
</tr>
</tbody>
</table>
<p/>
</p>
<p>
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="50%">
<thead>
<tr>
......@@ -220,7 +288,8 @@
</td>
</tr>
</table>
<p/>
</p>
<p>
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="50%">
<thead>
<tr>
......@@ -233,6 +302,7 @@
</tr>
</tbody>
</table>
</p>
</form>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment