diff options
author | damencho <damencho@jitsi.org> | 2017-01-18 14:06:16 -0600 |
---|---|---|
committer | damencho <damencho@jitsi.org> | 2017-01-18 14:06:16 -0600 |
commit | 3f28fcef07c39ab735917199b1883b4166566546 (patch) | |
tree | 61118bb99b4ae25491561fa899c157b9eebb206c /src | |
parent | 79a3a28b3421f06960871db0c4fb6927b9c39575 (diff) | |
download | jitsi-3f28fcef07c39ab735917199b1883b4166566546.zip jitsi-3f28fcef07c39ab735917199b1883b4166566546.tar.gz jitsi-3f28fcef07c39ab735917199b1883b4166566546.tar.bz2 |
Adds a property to enable rtpTranslator for conferences.
Account property that enables rtpTranslator instead of mixing in conferences.
Diffstat (limited to 'src')
4 files changed, 70 insertions, 5 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/Call.java b/src/net/java/sip/communicator/service/protocol/Call.java index d342373..a952cfd 100644 --- a/src/net/java/sip/communicator/service/protocol/Call.java +++ b/src/net/java/sip/communicator/service/protocol/Call.java @@ -111,6 +111,13 @@ public abstract class Call private boolean isAutoAnswer = false; /** + * The indicator which determines whether any telephony conference + * represented by this instance is mixing or relaying. + * By default what can be mixed is mixed (audio) and rest is relayed. + */ + protected final boolean useTranslator; + + /** * Creates a new Call instance. * * @param sourceProvider the proto provider that created us. @@ -133,6 +140,11 @@ public abstract class Call = accountID.getAccountPropertyBoolean( ProtocolProviderFactory.DEFAULT_SIPZRTP_ATTRIBUTE, true); + + useTranslator + = accountID.getAccountPropertyBoolean( + ProtocolProviderFactory.USE_TRANSLATOR_IN_CONFERENCE, + false); } /** diff --git a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java index 2efdc29..561a092 100644 --- a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java +++ b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java @@ -376,6 +376,15 @@ public abstract class ProtocolProviderFactory = "USE_JITSI_VIDEO_BRIDGE"; /** + * The name of the boolean account property which indicates whether Jitsi + * will use translator for media, instead of mixing, for conference + * calls. + * By default if supported mixing is used (audio mixed, video relayed). + */ + public static final String USE_TRANSLATOR_IN_CONFERENCE + = "USE_TRANSLATOR_IN_CONFERENCE"; + + /** * The property name prefix for all stun server properties. We generally use * this prefix in conjunction with an index which is how we store multiple * servers. diff --git a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java index f9b6c2f..2bf802b 100644 --- a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java +++ b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java @@ -906,7 +906,7 @@ public abstract class MediaAwareCall< @Override protected CallConference createConference() { - return new MediaAwareCallConference(); + return new MediaAwareCallConference(false, this.useTranslator); } /** diff --git a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallConference.java b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallConference.java index da34f2c..81e917c 100644 --- a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallConference.java +++ b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallConference.java @@ -93,6 +93,21 @@ public class MediaAwareCallConference private RTPTranslator videoRTPTranslator; /** + * The <tt>RTPTranslator</tt> which forwards autio RTP and RTCP traffic + * between the <tt>CallPeer</tt>s of the <tt>Call</tt>s participating in + * this telephony conference when the local peer is acting as a conference + * focus. + */ + private RTPTranslator audioRTPTranslator; + + /** + * The indicator which determines whether the telephony conference + * represented by this instance is mixing or relaying. + * By default what can be mixed is mixed (audio) and rest is relayed. + */ + private boolean translator = false; + + /** * Initializes a new <tt>MediaAwareCallConference</tt> instance. */ public MediaAwareCallConference() @@ -111,8 +126,25 @@ public class MediaAwareCallConference */ public MediaAwareCallConference(boolean jitsiVideobridge) { + this(jitsiVideobridge, false); + } + + /** + * Initializes a new <tt>MediaAwareCallConference</tt> instance which is to + * optionally utilize the Jitsi Videobridge server-side telephony + * conferencing technology. + * + * @param jitsiVideobridge <tt>true</tt> if the telephony conference + * represented by the new instance is to utilize the Jitsi Videobridge + * server-side telephony conferencing technology; otherwise, <tt>false</tt> + */ + public MediaAwareCallConference(boolean jitsiVideobridge, + boolean translator) + { super(jitsiVideobridge); + this.translator = translator; + int mediaTypeCount = MediaType.values().length; devices = new MediaDevice[mediaTypeCount]; @@ -269,6 +301,7 @@ public class MediaAwareCallConference * necessary. */ if ((!OSUtils.IS_ANDROID || isConferenceFocus()) + && !this.translator /* * We can use the AudioMixer only if the device is * able to capture (because the AudioMixer will push @@ -325,8 +358,6 @@ public class MediaAwareCallConference */ public RTPTranslator getRTPTranslator(MediaType mediaType) { - RTPTranslator rtpTranslator = null; - /* * XXX A mixer is created for audio even when the local peer is not a * conference focus in order to enable additional functionality. @@ -348,9 +379,22 @@ public class MediaAwareCallConference .getMediaService() .createRTPTranslator(); } - rtpTranslator = videoRTPTranslator; + return videoRTPTranslator; } - return rtpTranslator; + + if (this.translator) + { + if(audioRTPTranslator == null) + { + audioRTPTranslator + = ProtocolMediaActivator + .getMediaService() + .createRTPTranslator(); + } + return audioRTPTranslator; + } + + return null; } /** |