|
|
|
@ -21,6 +21,7 @@
|
|
|
|
import org.jitsi.service.neomedia.*;
|
|
|
|
import org.jitsi.service.neomedia.*;
|
|
|
|
import org.jitsi.service.neomedia.device.*;
|
|
|
|
import org.jitsi.service.neomedia.device.*;
|
|
|
|
import org.jitsi.service.neomedia.format.*;
|
|
|
|
import org.jitsi.service.neomedia.format.*;
|
|
|
|
|
|
|
|
import org.jitsi.service.neomedia.rtp.*;
|
|
|
|
|
|
|
|
|
|
|
|
import ch.imvs.sdes4j.srtp.*;
|
|
|
|
import ch.imvs.sdes4j.srtp.*;
|
|
|
|
|
|
|
|
|
|
|
|
@ -244,21 +245,46 @@ private Vector<MediaDescription> createMediaDescriptions()
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// If we have a video preset, let's send info about the
|
|
|
|
switch (mediaType)
|
|
|
|
// desired frame rate.
|
|
|
|
|
|
|
|
if (mediaType.equals(MediaType.VIDEO)
|
|
|
|
|
|
|
|
&& (receiveQualityPreset != null))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// doing only int frame rate for now
|
|
|
|
case AUDIO:
|
|
|
|
int frameRate
|
|
|
|
/*
|
|
|
|
= (int) receiveQualityPreset.getFameRate();
|
|
|
|
* Let the remote peer know that we support RTCP XR
|
|
|
|
|
|
|
|
* in general and VoIP Metrics Report Block in
|
|
|
|
|
|
|
|
* particular.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
String rtcpxr
|
|
|
|
|
|
|
|
= md.getAttribute(
|
|
|
|
|
|
|
|
RTCPExtendedReport.SDP_ATTRIBUTE);
|
|
|
|
|
|
|
|
|
|
|
|
if (frameRate > 0)
|
|
|
|
if (rtcpxr == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
md.setAttribute(
|
|
|
|
md.setAttribute(
|
|
|
|
"framerate",
|
|
|
|
RTCPExtendedReport.SDP_ATTRIBUTE,
|
|
|
|
String.valueOf(frameRate));
|
|
|
|
RTCPExtendedReport
|
|
|
|
|
|
|
|
.VoIPMetricsReportBlock
|
|
|
|
|
|
|
|
.SDP_PARAMETER);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case VIDEO:
|
|
|
|
|
|
|
|
// If we have a video preset, let's send info about
|
|
|
|
|
|
|
|
// the desired frame rate.
|
|
|
|
|
|
|
|
if (receiveQualityPreset != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// doing only int frame rate for now
|
|
|
|
|
|
|
|
int frameRate
|
|
|
|
|
|
|
|
= (int) receiveQualityPreset.getFameRate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (frameRate > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
md.setAttribute(
|
|
|
|
|
|
|
|
"framerate",
|
|
|
|
|
|
|
|
String.valueOf(frameRate));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(SdpException e)
|
|
|
|
catch(SdpException e)
|
|
|
|
@ -708,6 +734,44 @@ else if(mediaType.equals(MediaType.VIDEO)
|
|
|
|
md,
|
|
|
|
md,
|
|
|
|
mediaDescription);
|
|
|
|
mediaDescription);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RTCP XR
|
|
|
|
|
|
|
|
String rtcpxr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* We support the receiving of RTCP XR so we will answer the
|
|
|
|
|
|
|
|
* offer of the remote peer.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
rtcpxr
|
|
|
|
|
|
|
|
= mediaDescription.getAttribute(
|
|
|
|
|
|
|
|
RTCPExtendedReport.SDP_ATTRIBUTE);
|
|
|
|
|
|
|
|
if (rtcpxr != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* However, we support the receiving and sending of VoIP
|
|
|
|
|
|
|
|
* Metrics Report Block only.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (rtcpxr.contains(
|
|
|
|
|
|
|
|
RTCPExtendedReport.VoIPMetricsReportBlock
|
|
|
|
|
|
|
|
.SDP_PARAMETER))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rtcpxr
|
|
|
|
|
|
|
|
= RTCPExtendedReport.VoIPMetricsReportBlock
|
|
|
|
|
|
|
|
.SDP_PARAMETER;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rtcpxr = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
md.setAttribute(RTCPExtendedReport.SDP_ATTRIBUTE, rtcpxr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (SdpException se)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rtcpxr = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// create the corresponding stream...
|
|
|
|
// create the corresponding stream...
|
|
|
|
MediaFormat fmt
|
|
|
|
MediaFormat fmt
|
|
|
|
= findMediaFormat(
|
|
|
|
= findMediaFormat(
|
|
|
|
@ -733,8 +797,19 @@ else if(mediaType.equals(MediaType.VIDEO)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
initStream(connector, dev, fmt, target, direction, rtpExtensions,
|
|
|
|
MediaStream stream
|
|
|
|
masterStream);
|
|
|
|
= initStream(
|
|
|
|
|
|
|
|
connector,
|
|
|
|
|
|
|
|
dev,
|
|
|
|
|
|
|
|
fmt,
|
|
|
|
|
|
|
|
target,
|
|
|
|
|
|
|
|
direction,
|
|
|
|
|
|
|
|
rtpExtensions,
|
|
|
|
|
|
|
|
masterStream);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RTCP XR
|
|
|
|
|
|
|
|
if (stream != null)
|
|
|
|
|
|
|
|
stream.setProperty(RTCPExtendedReport.SDP_ATTRIBUTE, rtcpxr);
|
|
|
|
|
|
|
|
|
|
|
|
// create the answer description
|
|
|
|
// create the answer description
|
|
|
|
answerDescriptions.add(md);
|
|
|
|
answerDescriptions.add(md);
|
|
|
|
@ -1471,14 +1546,33 @@ private void doNonSynchronisedProcessAnswer(SessionDescription answer)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// create the corresponding stream...
|
|
|
|
// create the corresponding stream...
|
|
|
|
initStream(
|
|
|
|
MediaStream stream
|
|
|
|
connector,
|
|
|
|
= initStream(
|
|
|
|
dev,
|
|
|
|
connector,
|
|
|
|
supportedFormats.get(0),
|
|
|
|
dev,
|
|
|
|
target,
|
|
|
|
supportedFormats.get(0),
|
|
|
|
direction,
|
|
|
|
target,
|
|
|
|
rtpExtensions,
|
|
|
|
direction,
|
|
|
|
masterStream);
|
|
|
|
rtpExtensions,
|
|
|
|
|
|
|
|
masterStream);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RTCP XR
|
|
|
|
|
|
|
|
if (stream != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
String rtcpxr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rtcpxr
|
|
|
|
|
|
|
|
= mediaDescription.getAttribute(
|
|
|
|
|
|
|
|
RTCPExtendedReport.SDP_ATTRIBUTE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (SdpException se)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rtcpxr = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
stream.setProperty(RTCPExtendedReport.SDP_ATTRIBUTE, rtcpxr);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|