Skip to content

Commit 0c849bc

Browse files
author
alexrobin
committed
Fixed H264 codec input format so it works for both Nexus5 and Nexus9 but
will it work on other devices?
1 parent e5e30ed commit 0c849bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sensorhub-driver-android/src/main/java/org/sensorhub/impl/sensor/android/AndroidCameraOutputH264.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ protected void initCodec() throws SensorException
188188
MediaFormat mediaFormat = MediaFormat.createVideoFormat(MediaFormat.MIMETYPE_VIDEO_AVC, imgWidth, imgHeight);
189189
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 2000000);
190190
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate);
191-
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Flexible);
191+
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar);
192192
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 5);
193193
mCodec.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
194194
log.debug("MediaCodec initialized");

0 commit comments

Comments
 (0)