diff --git a/src/main/java/io/antmedia/AppSettings.java b/src/main/java/io/antmedia/AppSettings.java index e30d6e5ff..f491969be 100644 --- a/src/main/java/io/antmedia/AppSettings.java +++ b/src/main/java/io/antmedia/AppSettings.java @@ -2275,6 +2275,13 @@ public boolean isWriteStatsToDatastore() { @Value("${srtReceiveLatencyInMs:150}") private int srtReceiveLatencyInMs = 150; + /* + * The size of encoding queue to keep the frames waiting for encoding in Stream Adaptor + * default: 150 (5 seconds frame for 30 fps stream) + */ + @Value("${encodingQueueSize:150}") + private int encodingQueueSize = 150; + //Make sure you have a default constructor because it's populated by MongoDB public AppSettings() { try { @@ -3971,4 +3978,11 @@ public void setWebhookStreamStatusUpdatePeriodMs(long webhookStreamStatusUpdateP } + public int getEncodingQueueSize() { + return encodingQueueSize; + } + + public void setEncodingQueueSize(int encodingQueueSize) { + this.encodingQueueSize = encodingQueueSize; + } } diff --git a/src/test/java/io/antmedia/test/AppSettingsUnitTest.java b/src/test/java/io/antmedia/test/AppSettingsUnitTest.java index ebbf6ccf4..20dae44cc 100644 --- a/src/test/java/io/antmedia/test/AppSettingsUnitTest.java +++ b/src/test/java/io/antmedia/test/AppSettingsUnitTest.java @@ -642,6 +642,9 @@ public void testUnsetAppSettings(AppSettings appSettings) { assertEquals(-1, appSettings.getWebhookStreamStatusUpdatePeriodMs()); + assertEquals(150, appSettings.getEncodingQueueSize()); + appSettings.setEncodingQueueSize(200); + assertEquals(200, appSettings.getEncodingQueueSize()); //if we add a new field, we just need to check its default value in this test @@ -649,7 +652,7 @@ public void testUnsetAppSettings(AppSettings appSettings) { //by also checking its default value. assertEquals("New field is added to settings. PAY ATTENTION: Please CHECK ITS DEFAULT VALUE and fix the number of fields.", - 189, numberOfFields); + 190, numberOfFields); }