Rename some video constants for readability.
This commit is contained in:
parent
c57994eb1b
commit
ee488ea0b8
3 changed files with 7 additions and 4 deletions
|
@ -95,7 +95,7 @@ public class PushMediaConstraints extends MediaConstraints {
|
||||||
|
|
||||||
if (sentMediaQuality == SentMediaQuality.HIGH) {
|
if (sentMediaQuality == SentMediaQuality.HIGH) {
|
||||||
if (DeviceCapabilities.canEncodeHevc() && (RemoteConfig.useHevcEncoder() || SignalStore.internal().getHevcEncoding())) {
|
if (DeviceCapabilities.canEncodeHevc() && (RemoteConfig.useHevcEncoder() || SignalStore.internal().getHevcEncoding())) {
|
||||||
return MediaConfig.LEVEL_4;
|
return MediaConfig.LEVEL_3_H265;
|
||||||
} else {
|
} else {
|
||||||
return MediaConfig.LEVEL_3;
|
return MediaConfig.LEVEL_3;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,8 @@ public class PushMediaConstraints extends MediaConstraints {
|
||||||
LEVEL_1(false, 1, MB, new int[] { 1600, 1024, 768, 512 }, 70, TranscodingPreset.LEVEL_1),
|
LEVEL_1(false, 1, MB, new int[] { 1600, 1024, 768, 512 }, 70, TranscodingPreset.LEVEL_1),
|
||||||
LEVEL_2(false, 2, (int) (1.5 * MB), new int[] { 2048, 1600, 1024, 768, 512 }, 75, TranscodingPreset.LEVEL_2),
|
LEVEL_2(false, 2, (int) (1.5 * MB), new int[] { 2048, 1600, 1024, 768, 512 }, 75, TranscodingPreset.LEVEL_2),
|
||||||
LEVEL_3(false, 3, (int) (3 * MB), new int[] { 4096, 3072, 2048, 1600, 1024, 768, 512 }, 75, TranscodingPreset.LEVEL_3),
|
LEVEL_3(false, 3, (int) (3 * MB), new int[] { 4096, 3072, 2048, 1600, 1024, 768, 512 }, 75, TranscodingPreset.LEVEL_3),
|
||||||
LEVEL_4(false, 4, 3 * MB, new int[] { 4096, 3072, 2048, 1600, 1024, 768, 512 }, 75, TranscodingPreset.LEVEL_4);
|
/** Experimental H265 level */
|
||||||
|
LEVEL_3_H265(false, 4, 3 * MB, new int[] { 4096, 3072, 2048, 1600, 1024, 768, 512 }, 75, TranscodingPreset.LEVEL_3_H265);
|
||||||
|
|
||||||
private final boolean isLowMemory;
|
private final boolean isLowMemory;
|
||||||
private final int level;
|
private final int level;
|
||||||
|
|
|
@ -42,7 +42,9 @@ enum class TranscodingPreset(@VideoCodec val videoCodec: String, val videoShortE
|
||||||
LEVEL_1(MediaConverter.VIDEO_CODEC_H264, VideoConstants.VIDEO_SHORT_EDGE_SD, VideoConstants.VIDEO_BITRATE_L1, VideoConstants.AUDIO_BITRATE),
|
LEVEL_1(MediaConverter.VIDEO_CODEC_H264, VideoConstants.VIDEO_SHORT_EDGE_SD, VideoConstants.VIDEO_BITRATE_L1, VideoConstants.AUDIO_BITRATE),
|
||||||
LEVEL_2(MediaConverter.VIDEO_CODEC_H264, VideoConstants.VIDEO_SHORT_EDGE_HD, VideoConstants.VIDEO_BITRATE_L2, VideoConstants.AUDIO_BITRATE),
|
LEVEL_2(MediaConverter.VIDEO_CODEC_H264, VideoConstants.VIDEO_SHORT_EDGE_HD, VideoConstants.VIDEO_BITRATE_L2, VideoConstants.AUDIO_BITRATE),
|
||||||
LEVEL_3(MediaConverter.VIDEO_CODEC_H264, VideoConstants.VIDEO_SHORT_EDGE_HD, VideoConstants.VIDEO_BITRATE_L3, VideoConstants.AUDIO_BITRATE),
|
LEVEL_3(MediaConverter.VIDEO_CODEC_H264, VideoConstants.VIDEO_SHORT_EDGE_HD, VideoConstants.VIDEO_BITRATE_L3, VideoConstants.AUDIO_BITRATE),
|
||||||
LEVEL_4(MediaConverter.VIDEO_CODEC_H265, VideoConstants.VIDEO_SHORT_EDGE_HD, VideoConstants.VIDEO_BITRATE_L3, VideoConstants.AUDIO_BITRATE);
|
|
||||||
|
/** Experimetnal H265 level */
|
||||||
|
LEVEL_3_H265(MediaConverter.VIDEO_CODEC_H265, VideoConstants.VIDEO_SHORT_EDGE_HD, VideoConstants.VIDEO_BITRATE_L3, VideoConstants.AUDIO_BITRATE);
|
||||||
|
|
||||||
fun calculateMaxVideoUploadDurationInSeconds(upperFileSizeLimit: Long): Int {
|
fun calculateMaxVideoUploadDurationInSeconds(upperFileSizeLimit: Long): Int {
|
||||||
val upperFileSizeLimitWithMargin = (upperFileSizeLimit / 1.1).toLong()
|
val upperFileSizeLimitWithMargin = (upperFileSizeLimit / 1.1).toLong()
|
||||||
|
|
|
@ -9,7 +9,7 @@ import android.media.MediaFormat
|
||||||
object VideoConstants {
|
object VideoConstants {
|
||||||
const val AUDIO_BITRATE = 128_000
|
const val AUDIO_BITRATE = 128_000
|
||||||
const val VIDEO_BITRATE_L1 = 1_250_000
|
const val VIDEO_BITRATE_L1 = 1_250_000
|
||||||
const val VIDEO_BITRATE_L2 = VIDEO_BITRATE_L1
|
const val VIDEO_BITRATE_L2 = 1_250_000
|
||||||
const val VIDEO_BITRATE_L3 = 2_500_000
|
const val VIDEO_BITRATE_L3 = 2_500_000
|
||||||
const val VIDEO_SHORT_EDGE_SD = 480
|
const val VIDEO_SHORT_EDGE_SD = 480
|
||||||
const val VIDEO_SHORT_EDGE_HD = 720
|
const val VIDEO_SHORT_EDGE_HD = 720
|
||||||
|
|
Loading…
Add table
Reference in a new issue