desc:推送小改

main
xiaowusky 1 year ago
parent 29518fffb0
commit d4cc57e0dd

@ -225,7 +225,7 @@ class HomeActivity : NoOptionsActivity() {
if (!AppData.hasSensorData()) { if (!AppData.hasSensorData()) {
// 有传感器数据回调 // 有传感器数据回调
AppData.setSensorData(true) AppData.setSensorData(true)
// closeLoadingDialog() closeLoadingDialog()
changeViewStatus() changeViewStatus()
} }
watchSensor(DELAY_TIME_CHECK_SENSOR) watchSensor(DELAY_TIME_CHECK_SENSOR)

@ -173,12 +173,12 @@ public class MediaCodecManager {
int videoH = rotation == 90 || rotation == 270 ? dstWidth : dstHeight; int videoH = rotation == 90 || rotation == 270 ? dstWidth : dstHeight;
mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE,//注意这里旋转后有一个大坑就是要交换mHeight和mWidth的位置。否则录制出来的视频时花屏的。 mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE,//注意这里旋转后有一个大坑就是要交换mHeight和mWidth的位置。否则录制出来的视频时花屏的。
videoW, videoH); videoW, videoH);
int frameRate = 24; // 15fps int frameRate = 17; // 15fps
int compressRatio = 256; int compressRatio = 256;
int bitRate = dstWidth * dstHeight * 3 * 8 * frameRate / compressRatio; int bitRate = dstWidth * dstHeight * 3 * 8 * frameRate / compressRatio;
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, bitRate); mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, bitRate);
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, (int) (frameRate * 0.3)); mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mColorFormat); mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mColorFormat);
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 3); mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 3);
LogUtils.w("prepare format: " + mediaFormat); LogUtils.w("prepare format: " + mediaFormat);

Loading…
Cancel
Save