Skip to content

Commit

Permalink
mediacodec: Always use YUV420Flexible for 8-bit
Browse files Browse the repository at this point in the history
There is no reason to request P010 for 8-bit images.

PiperOrigin-RevId: 698091037
  • Loading branch information
vigneshvg authored and copybara-github committed Nov 19, 2024
1 parent d474f1e commit d04ffe9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/codecs/android_mediacodec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,12 @@ impl Decoder for MediaCodec {
AMediaFormat_setInt32(
format,
AMEDIAFORMAT_KEY_COLOR_FORMAT,
config.android_mediacodec_output_color_format as i32,
if config.depth == 8 {
// Always use Yuv420Flexible for 8-bit images.
AndroidMediaCodecOutputColorFormat::Yuv420Flexible
} else {
config.android_mediacodec_output_color_format
} as i32,
);
// low-latency is documented but isn't exposed as a constant in the NDK:
// https://developer.android.com/reference/android/media/MediaFormat#KEY_LOW_LATENCY
Expand Down

0 comments on commit d04ffe9

Please sign in to comment.