Skip to content

Commit aa38353

Browse files
committed
use codecPreferenceOrder and mobileCodecPreferenceOrder
1 parent 53864ef commit aa38353

File tree

4 files changed

+33
-56
lines changed

4 files changed

+33
-56
lines changed

src/java/org/jivesoftware/openfire/plugin/ofmeet/ConfigServlet.java

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
119119
boolean enableStereo = JiveGlobals.getBooleanProperty( "ofmeet.stereo.enabled", false );
120120
boolean enableAudioLevels = JiveGlobals.getBooleanProperty( "ofmeet.audioLevels.enabled", false );
121121
boolean enableFeedback = JiveGlobals.getBooleanProperty( "ofmeet.feedback.enabled", true );
122-
boolean forceVp9 = JiveGlobals.getBooleanProperty( "ofmeet.jicofo.force.vp9", false);
123-
boolean forceAv1 = JiveGlobals.getBooleanProperty( "ofmeet.jicofo.force.av1", true);
124122

125123
int video_width_ideal = JiveGlobals.getIntProperty( "org.jitsi.videobridge.ofmeet.constraints.video.width.ideal", ofMeetConfig.getVideoConstraintsIdealHeight() * 16/9);
126124
int video_width_max = JiveGlobals.getIntProperty( "org.jitsi.videobridge.ofmeet.constraints.video.width.max", ofMeetConfig.getVideoConstraintsMaxHeight() * 16/9);
@@ -143,6 +141,10 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
143141
boolean useNewBandwidthAllocationStrategy = JiveGlobals.getBooleanProperty( "ofmeet.use.new.bandwidth.allocation.strategy", true);
144142

145143
boolean wsBridgeChannel = JiveGlobals.getBooleanProperty( "ofmeet.bridge.ws.channel", org.jitsi.util.OSUtils.IS_WINDOWS);
144+
145+
JSONArray codecPreferenceOrder = new JSONArray(JiveGlobals.getProperty( "ofmeet.codec.preference.order", "[ \"AV1\", \"VP9\", \"VP8\", \"H264\" ]"));
146+
JSONArray mobileCodecPreferenceOrder = new JSONArray(JiveGlobals.getProperty( "ofmeet.codec.preference.order", "[ \"VP8\", \"H264\", \"VP9\", \"AV1\" ]"));
147+
146148

147149
if ( xirsysUrl != null )
148150
{
@@ -166,10 +168,8 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
166168

167169
final Map<String, Object> p2p = new HashMap<>();
168170
p2p.put( "enabled", ofMeetConfig.getP2pEnabled() );
169-
p2p.put( "enableUnifiedOnChrome", true);
170-
p2p.put( "preferredCodec", forceAv1 ? "AV1" : (forceVp9 ? "VP9" : "H264") );
171-
p2p.put( "preferH264", ofMeetConfig.getP2pPreferH264() );
172-
p2p.put( "disableH264", ofMeetConfig.getP2pDisableH264() );
171+
p2p.put( "codecPreferenceOrder", codecPreferenceOrder);
172+
p2p.put( "mobileCodecPreferenceOrder", mobileCodecPreferenceOrder);
173173
p2p.put( "useStunTurn", ofMeetConfig.getP2pUseStunTurn() );
174174
config.put( "enableP2P", true );
175175
config.put( "p2p", p2p );
@@ -244,39 +244,32 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
244244
config.put( "useNewBandwidthAllocationStrategy", useNewBandwidthAllocationStrategy );
245245

246246
final JSONObject videoQuality = new JSONObject();
247-
videoQuality.put( "preferredCodec", forceAv1 ? "AV1" : (forceVp9 ? "VP9" : "H264") );
248-
final JSONObject maxBitratesVideo = new JSONObject();
247+
videoQuality.put( "enableAdaptiveMode", true);
248+
videoQuality.put( "codecPreferenceOrder", codecPreferenceOrder);
249+
videoQuality.put( "mobileCodecPreferenceOrder", mobileCodecPreferenceOrder);
249250

250251
final JSONObject vp9 = new JSONObject();
251-
vp9.put( "low", lowMaxBitratesVideo );
252-
vp9.put( "standard", standardMaxBitratesVideo );
253-
vp9.put( "high", highMaxBitratesVideo );
254-
maxBitratesVideo.put( "VP9", vp9 );
255-
252+
vp9.put( "scalabilityModeEnabled", true );
253+
vp9.put( "useSimulcast", false );
254+
videoQuality.put( "vp9", vp9 );
255+
256256
final JSONObject h264 = new JSONObject();
257-
h264.put( "low", lowMaxBitratesVideo );
258-
h264.put( "standard", standardMaxBitratesVideo );
259-
h264.put( "high", highMaxBitratesVideo );
260-
maxBitratesVideo.put( "H264", h264 );
257+
videoQuality.put( "h264", h264 );
261258

262259
final JSONObject av1 = new JSONObject();
263-
av1.put( "low", lowMaxBitratesVideo );
264-
av1.put( "standard", standardMaxBitratesVideo );
265-
av1.put( "high", highMaxBitratesVideo );
266-
maxBitratesVideo.put( "AV1", av1 );
260+
av1.put( "useSimulcast", false );
261+
videoQuality.put( "av1", av1 );
267262

268-
videoQuality.put( "maxBitratesVideo", maxBitratesVideo );
269-
270-
final JSONObject minHeightForQualityLvl = new JSONObject();
271-
minHeightForQualityLvl.put( minHeightForQualityLvlLow, "low" );
272-
minHeightForQualityLvl.put( minHeightForQualityLvlStd, "standard" );
273-
minHeightForQualityLvl.put( minHeightForQualityLvlHigh, "high" );
274-
videoQuality.put( "minHeightForQualityLvl", minHeightForQualityLvl );
275263
config.put( "videoQuality", videoQuality );
264+
265+
final JSONObject audioQuality = new JSONObject();
266+
audioQuality.put( "enableOpusDtx", false );
267+
audioQuality.put( "stereo", enableStereo);
268+
269+
config.put( "audioQuality", audioQuality);
276270

277271
config.put( "recordingType", "colibri" );
278272
config.put( "disableAudioLevels", ! enableAudioLevels );
279-
config.put( "stereo", false );
280273
config.put( "requireDisplayName", true );
281274
config.put( "startAudioOnly", ofMeetConfig.getStartAudioOnly() );
282275

@@ -312,7 +305,9 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
312305

313306
videoConstraints.put( "width", width );
314307
constraints.put( "video", videoConstraints );
308+
315309
config.put( "constraints", constraints );
310+
316311
config.put( "enableLayerSuspension", enableLayerSuspension );
317312
config.put( "enableUnifiedOnChrome", true);
318313
config.put( "enableForcedReload", true);
@@ -330,7 +325,7 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
330325
testing.put( "capScreenshareBitrate", capScreenshareBitrate ? 1 : 0 );
331326
config.put( "testing", testing );
332327

333-
config.put( "maxFullResolutionParticipants", -1);
328+
config.put( "maxFullResolutionParticipants", 1);
334329
config.put( "useRoomAsSharedDocumentName", false );
335330
config.put( "logStats", logStats );
336331
config.put( "ofmeetWinSSOEnabled", ofmeetWinSSOEnabled );
@@ -376,7 +371,6 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
376371
config.put( "disableAGC", true );
377372
config.put( "disableHPF", true );
378373
config.put( "enableLipSync", false );
379-
config.put( "stereo", true );
380374
config.put( "opusMaxAverageBitrate", 510000 );
381375
}
382376

src/java/org/jivesoftware/openfire/plugin/ofmeet/JitsiJicofoWrapper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ public synchronized void initialize( File pluginDirectory) throws Exception
113113
props.setProperty( "org.jitsi.jicofo.SERVICE_REDISCOVERY_INTERVAL", "60000" );
114114
props.setProperty( "org.jitsi.jicofo.DISABLE_AUTO_OWNER", Boolean.toString( !JiveGlobals.getBooleanProperty( "ofmeet.conference.auto-moderator", true ) ) );
115115

116-
props.setProperty( "org.jitsi.jicofo.ENABLE_H264", Boolean.toString( !JiveGlobals.getBooleanProperty( "ofmeet.jicofo.force.vp9", true ) ) );
117-
props.setProperty( "org.jitsi.jicofo.ENABLE_VP8", Boolean.toString( !JiveGlobals.getBooleanProperty( "ofmeet.jicofo.force.vp9", true ) ) );
118-
props.setProperty( "org.jitsi.jicofo.ENABLE_VP9", Boolean.toString( JiveGlobals.getBooleanProperty( "ofmeet.jicofo.force.vp9", true ) ) );
119-
116+
props.setProperty( "org.jitsi.jicofo.ENABLE_H264", "true");
117+
props.setProperty( "org.jitsi.jicofo.ENABLE_VP8", "true");
118+
props.setProperty( "org.jitsi.jicofo.ENABLE_VP9", "true");
119+
props.setProperty( "org.jitsi.jicofo.ENABLE_AV1", "true");
120+
120121
Log.debug("sip-communicator.properties");
121122

122123
for (Object key: props.keySet()) {

src/java/org/jivesoftware/openfire/plugin/ofmeet/JitsiJvbWrapper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ private void writeProperties( File props_file, String local_ip, String public_ip
281281
props.setProperty( "org.jitsi.videobridge.octo.BIND_PORT", JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.octo.port", "4096"));
282282
props.setProperty( "org.jitsi.videobridge.REGION", "region" + JiveGlobals.getXMLProperty("ofmeet.octo_id", "1"));
283283

284-
props.setProperty( "org.jitsi.videobridge.TRUST_BWE", Boolean.toString( !JiveGlobals.getBooleanProperty( "ofmeet.jicofo.force.vp9", true)));
285-
286284
Log.debug("sip-communicator.properties");
287285

288286
for (Object key: props.keySet()) {

src/web/ofmeet-settings.jsp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@
4848
final boolean conferenceadmin = ParamUtils.getBooleanParameter( request, "conferenceadmin" );
4949
final boolean securityenabled = ParamUtils.getBooleanParameter( request, "securityenabled" );
5050
final boolean webauthn_enabled = ParamUtils.getBooleanParameter( request, "webauthn_enabled" );
51-
final boolean disableRtx = !ParamUtils.getBooleanParameter( request, "enableRtx" );
52-
final boolean forceVp9 = ParamUtils.getBooleanParameter( request, "forceVp9" );
53-
final boolean forceAv1 = ParamUtils.getBooleanParameter( request, "forceAv1" );
51+
final boolean disableRtx = !ParamUtils.getBooleanParameter( request, "enableRtx" );
5452
final String authusername = request.getParameter( "authusername" );
5553
final String sippassword = request.getParameter( "sippassword" );
5654
final String server = request.getParameter( "server" );
@@ -227,9 +225,7 @@
227225
JiveGlobals.setProperty( "org.jitsi.videobridge.ofmeet.jvb.jvm.customOptions", jvmJvb );
228226
JiveGlobals.setProperty( "org.jitsi.videobridge.ofmeet.focus.jvm.customOptions", jvmJicofo );
229227
JiveGlobals.setProperty( "org.jitsi.videobridge.ofmeet.jigasi.jvm.customOptions", jvmJigasi );
230-
231-
JiveGlobals.setProperty( "ofmeet.jicofo.force.vp9", Boolean.toString( forceVp9 ) );
232-
JiveGlobals.setProperty( "ofmeet.jicofo.force.av1", Boolean.toString( forceAv1 ) );
228+
233229
JiveGlobals.setProperty( "ofmeet.desktop.sharing.framerate.min", desktopSharingFrameRateMin);
234230
JiveGlobals.setProperty( "ofmeet.desktop.sharing.framerate.max", desktopSharingFrameRateMax);
235231
JiveGlobals.setProperty( "ofmeet.max.full.resolution.participants", maxFullResolutionParticipants );
@@ -431,19 +427,7 @@
431427
<input type="checkbox" name="websockets" ${admin:getBooleanProperty( "org.jitsi.videobridge.ofmeet.websockets", false) ? "checked" : ""}>
432428
<fmt:message key="config.page.configuration.ofmeet.websockets.enabled" />
433429
</td>
434-
</tr>
435-
<tr>
436-
<td nowrap colspan="2">
437-
<input type="checkbox" name="forceVp9" ${admin:getBooleanProperty( "ofmeet.jicofo.force.vp9", true) ? "checked" : ""}>
438-
<fmt:message key="config.page.configuration.ofmeet.jicofo.force.vp9" />
439-
</td>
440-
</tr>
441-
<tr>
442-
<td nowrap colspan="2">
443-
<input type="checkbox" name="forceAv1" ${admin:getBooleanProperty( "ofmeet.jicofo.force.av1", true) ? "checked" : ""}>
444-
<fmt:message key="config.page.configuration.ofmeet.jicofo.force.av1" />
445-
</td>
446-
</tr>
430+
</tr>
447431
<tr>
448432
<td nowrap colspan="2">
449433
<input type="checkbox" name="enableRtx" ${ofmeetConfig.disableRtx ? "" : "checked"}>

0 commit comments

Comments
 (0)