2015-01-02 23:43:28 +00:00
|
|
|
package org.thoughtcrime.securesms.mms;
|
|
|
|
|
2015-06-04 21:19:10 +00:00
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.util.Util;
|
|
|
|
|
2015-01-02 23:43:28 +00:00
|
|
|
public class PushMediaConstraints extends MediaConstraints {
|
2015-06-04 21:19:10 +00:00
|
|
|
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
|
2016-12-14 18:21:14 +00:00
|
|
|
private static final int MAX_IMAGE_DIMEN = 4096;
|
2015-06-04 21:19:10 +00:00
|
|
|
private static final int KB = 1024;
|
|
|
|
private static final int MB = 1024 * KB;
|
2015-01-02 23:43:28 +00:00
|
|
|
|
|
|
|
@Override
|
2015-06-04 21:19:10 +00:00
|
|
|
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
|
2015-06-04 21:19:10 +00:00
|
|
|
public int getImageMaxHeight(Context context) {
|
|
|
|
return getImageMaxWidth(context);
|
2015-01-02 23:43:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getImageMaxSize() {
|
2016-12-14 18:21:14 +00:00
|
|
|
return 6 * MB;
|
2015-01-02 23:43:28 +00:00
|
|
|
}
|
|
|
|
|
2015-07-15 20:42:59 +00:00
|
|
|
@Override
|
|
|
|
public int getGifMaxSize() {
|
2017-03-30 23:12:55 +00:00
|
|
|
return 25 * MB;
|
2015-07-15 20:42:59 +00:00
|
|
|
}
|
|
|
|
|
2015-01-02 23:43:28 +00:00
|
|
|
@Override
|
|
|
|
public int getVideoMaxSize() {
|
2015-09-05 00:33:22 +00:00
|
|
|
return 100 * MB;
|
2015-01-02 23:43:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getAudioMaxSize() {
|
2015-09-05 00:33:22 +00:00
|
|
|
return 100 * MB;
|
2015-01-02 23:43:28 +00:00
|
|
|
}
|
2017-04-24 22:52:48 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDocumentMaxSize() {
|
|
|
|
return 100 * MB;
|
|
|
|
}
|
2015-01-02 23:43:28 +00:00
|
|
|
}
|