COLOR_FormatYUV420Flexible transfer to RGB

I want to use GLSL to transfer YUV420 to RGB. But there have some problems when I start it. Android MediaCodecInfo.CodecCapabilities one constant is COLOR_FormatYUV420Flexible. This format corresponds to YUV_420_888, and can represent the COLOR_FormatYUV411Planar, COLOR_FormatYUV411PackedPlanar, COLOR_FormatYUV420Planar, COLOR_FormatYUV420PackedPlanar, COLOR_FormatYUV420SemiPlanar and COLOR_FormatYUV420PackedSemiPlanar formats. So different formats have different methods in YUV420 to RGB which writing in fragment shader.
I want to know the different methods in different formats YUV420 to RGB. Who can help me?

Once you determine that, then the GLSL shader logic you need to convert to RGB should be pretty clear, since you'll know exactly how the memory is laid out. The GLSL source code might even be contained in one of the links I posted above.

By the way, if you don't get the answer you're looking for here, you might try posting on an Android and/or OpenGL ES forum. You're more likely to catch the eyes of devs familiar with MediaCodec there.