Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b8579f9 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

CCodec: pre-S bytebuffer mode encoders to use YV12 format

CCodec used to convert YUV formats into YV12 pre-S, and in older
vendor partition the codecs may be operating under this assumption.

Bug: 216688552
Test: atest android.media.codec.cts.VideoCodecTest
Change-Id: I16994514708ad5fb280e745afb73a282b57f3bb5
parent d5e3531f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1074,6 +1074,17 @@ void CCodec::configure(const sp<AMessage> &msg) {
                }
            } else {
                if ((config->mDomain & Config::IS_ENCODER) || !surface) {
                    if (vendorSdkVersion < __ANDROID_API_S__ &&
                            (format == COLOR_FormatYUV420Flexible ||
                             format == COLOR_FormatYUV420Planar ||
                             format == COLOR_FormatYUV420PackedPlanar ||
                             format == COLOR_FormatYUV420SemiPlanar ||
                             format == COLOR_FormatYUV420PackedSemiPlanar)) {
                        // pre-S framework used to map these color formats into YV12.
                        // Codecs from older vendor partition may be relying on
                        // this assumption.
                        format = HAL_PIXEL_FORMAT_YV12;
                    }
                    switch (format) {
                        case COLOR_FormatYUV420Flexible:
                            format = COLOR_FormatYUV420Planar;