diff options
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java | 5 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java index 707bd6ed4..40e8bd242 100644 --- a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java +++ b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java @@ -6,7 +6,6 @@ import android.os.ParcelFileDescriptor; import android.util.Log; import net.ypresto.androidtranscoder.MediaTranscoder; -import net.ypresto.androidtranscoder.format.MediaFormatStrategy; import net.ypresto.androidtranscoder.format.MediaFormatStrategyPresets; import java.io.FileDescriptor; @@ -79,12 +78,10 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod message.setRelativeFilePath(fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4) + "_komp.mp4"); final DownloadableFile file = mXmppConnectionService.getFileBackend().getFile(message); final int runtime = mXmppConnectionService.getFileBackend().getMediaRuntime(uri); - MediaFormatStrategy formatStrategy = runtime >= 8000 ? MediaFormatStrategyPresets.createExportPreset960x540Strategy() : MediaFormatStrategyPresets.createAndroid720pStrategy(); - Log.d(Config.LOGTAG, "runtime " + runtime); file.getParentFile().mkdirs(); ParcelFileDescriptor parcelFileDescriptor = mXmppConnectionService.getContentResolver().openFileDescriptor(uri, "r"); FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor(); - MediaTranscoder.getInstance().transcodeVideo(fileDescriptor, file.getAbsolutePath(), formatStrategy, this); + MediaTranscoder.getInstance().transcodeVideo(fileDescriptor, file.getAbsolutePath(), MediaFormatStrategyPresets.createAndroidStandardStrategy(mXmppConnectionService.getCompressVideoBitratePreference(), mXmppConnectionService.getCompressVideoResolutionPreference()), this); } @Override diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index dda022caf..0d367b3d7 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -835,7 +835,7 @@ public class XmppConnectionService extends Service { } } - private int getCompressVideoResolutionPreference() { + public int getCompressVideoResolutionPreference() { switch (getPreferences().getString("video_compression", getResources().getString(R.string.video_compression))) { case "low": return 144; @@ -848,7 +848,7 @@ public class XmppConnectionService extends Service { } } - private int getCompressVideoBitratePreference() { + public int getCompressVideoBitratePreference() { switch (getPreferences().getString("video_compression", getResources().getString(R.string.video_compression))) { case "low": return 100000; |