From e20e7893a546b700e5a4ca00d523cf078bb28747 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 5 Mar 2017 10:47:56 +0100 Subject: change bitrate with video quality settings too --- .../messenger/services/XmppConnectionService.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 1a662356e..c4570d6c0 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -555,7 +555,7 @@ public class XmppConnectionService extends Service { } }; MediaTranscoder.getInstance().transcodeVideo(fileDescriptor, file.getAbsolutePath(), - MediaFormatStrategyPresets.createAndroidStandardStrategy(Config.VIDEO_BITRATE, getCompressVideosPreference()), listener); + MediaFormatStrategyPresets.createAndroidStandardStrategy(getCompressVideoBitratePreference(), getCompressVideoResolutionPreference()), listener); } @Override @@ -882,7 +882,7 @@ public class XmppConnectionService extends Service { return getPreferences().getString("picture_compression", "auto"); } - private int getCompressVideosPreference() { + private int getCompressVideoResolutionPreference() { switch (getPreferences().getString("video_compression", "high")) { case "low": return 144; @@ -895,6 +895,19 @@ public class XmppConnectionService extends Service { } } + private int getCompressVideoBitratePreference() { + switch (getPreferences().getString("video_compression", "high")) { + case "low": + return 100000; + case "mid": + return 500000; + case "high": + return 2000000; + default: + return 2000000; + } + } + private Presence.Status getTargetPresence() { if (xaOnSilentMode() && isPhoneSilenced()) { return Presence.Status.XA; -- cgit v1.2.3