session-android/src/org/thoughtcrime/securesms/mms/PushMediaConstraints.java
Moxie Marlinspike 51d6144591 Significant MMS changes
1) Remove all our PDU code and switch to the PDU code from the
   klinker library

2) Switch to using the system Lollipop MMS library by default,
   and falling back to our own custom library if that fails.

3) Format SMIL differently, using code from klinker instead of
   what we've pieced together.

4) Pull per-carrier MMS media constraints from the XML config
   files in the klinker library, instead of hardcoding it at 280kb.

Hopefully this is an improvement, but given that MMS is involved,
it will probably make things worse instead.
2017-05-08 18:14:55 -07:00

48 lines
1.1 KiB
Java

package org.thoughtcrime.securesms.mms;
import android.content.Context;
import org.thoughtcrime.securesms.util.Util;
public class PushMediaConstraints extends MediaConstraints {
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
private static final int MAX_IMAGE_DIMEN = 4096;
private static final int KB = 1024;
private static final int MB = 1024 * KB;
@Override
public int getImageMaxWidth(Context context) {
return Util.isLowMemory(context) ? MAX_IMAGE_DIMEN_LOWMEM : MAX_IMAGE_DIMEN;
}
@Override
public int getImageMaxHeight(Context context) {
return getImageMaxWidth(context);
}
@Override
public int getImageMaxSize(Context context) {
return 6 * MB;
}
@Override
public int getGifMaxSize(Context context) {
return 25 * MB;
}
@Override
public int getVideoMaxSize(Context context) {
return 100 * MB;
}
@Override
public int getAudioMaxSize(Context context) {
return 100 * MB;
}
@Override
public int getDocumentMaxSize(Context context) {
return 100 * MB;
}
}