session-android/src/org/thoughtcrime/securesms/mms/PushMediaConstraints.java

43 lines
1007 B
Java
Raw Normal View History

2015-01-02 23:43:28 +00:00
package org.thoughtcrime.securesms.mms;
import android.content.Context;
import org.thoughtcrime.securesms.util.Util;
2015-01-02 23:43:28 +00:00
public class PushMediaConstraints extends MediaConstraints {
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
private static final int MAX_IMAGE_DIMEN = 1280;
private static final int KB = 1024;
private static final int MB = 1024 * KB;
2015-01-02 23:43:28 +00:00
@Override
public int getImageMaxWidth(Context context) {
return Util.isLowMemory(context) ? MAX_IMAGE_DIMEN_LOWMEM : MAX_IMAGE_DIMEN;
2015-01-02 23:43:28 +00:00
}
@Override
public int getImageMaxHeight(Context context) {
return getImageMaxWidth(context);
2015-01-02 23:43:28 +00:00
}
@Override
public int getImageMaxSize() {
return 420 * KB;
2015-01-02 23:43:28 +00:00
}
@Override
public int getGifMaxSize() {
return 1 * MB;
}
2015-01-02 23:43:28 +00:00
@Override
public int getVideoMaxSize() {
return MmsMediaConstraints.MAX_MESSAGE_SIZE;
}
@Override
public int getAudioMaxSize() {
return MmsMediaConstraints.MAX_MESSAGE_SIZE;
}
}