From 33f0f1561bb3e0bc23a49e5c84513d41849d2160 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 4 Mar 2017 22:00:46 +0100 Subject: make video resolution configurable --- .../pixart/messenger/services/XmppConnectionService.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index b2b3e5d68..1a662356e 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.createAndroid720pStrategy(Config.VIDEO_BITRATE), listener); + MediaFormatStrategyPresets.createAndroidStandardStrategy(Config.VIDEO_BITRATE, getCompressVideosPreference()), listener); } @Override @@ -882,6 +882,19 @@ public class XmppConnectionService extends Service { return getPreferences().getString("picture_compression", "auto"); } + private int getCompressVideosPreference() { + switch (getPreferences().getString("video_compression", "high")) { + case "low": + return 144; + case "mid": + return 360; + case "high": + return 720; + default: + return 720; + } + } + private Presence.Status getTargetPresence() { if (xaOnSilentMode() && isPhoneSilenced()) { return Presence.Status.XA; -- cgit v1.2.3