v4l2object: prefer NV12 over I420

Considering NV12 an 'odd' format is a historical artifact. This format
is now quite common, and usually preferable to I420 due to more memory
friendly access patterns.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/857>
This commit is contained in:
Lucas Stach 2018-12-10 14:10:05 +01:00 committed by Nicolas Dufresne
parent 1796f3f5e4
commit 1b1ad32b90

View file

@ -1057,8 +1057,6 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
rank = GREY_BASE_RANK; rank = GREY_BASE_RANK;
break; break;
case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */
case V4L2_PIX_FMT_NV12M: /* Same as NV12 */
case V4L2_PIX_FMT_NV12MT: /* NV12 64x32 tile */ case V4L2_PIX_FMT_NV12MT: /* NV12 64x32 tile */
case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */ case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */
case V4L2_PIX_FMT_NV21M: /* Same as NV21 */ case V4L2_PIX_FMT_NV21M: /* Same as NV21 */
@ -1082,6 +1080,10 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_YUV420M: case V4L2_PIX_FMT_YUV420M:
rank = YUV_BASE_RANK + 7; rank = YUV_BASE_RANK + 7;
break; break;
case V4L2_PIX_FMT_NV12: /* Y/CbCr 4:2:0, 12 bits per pixel */
case V4L2_PIX_FMT_NV12M: /* Same as NV12 */
rank = YUV_BASE_RANK + 8;
break;
case V4L2_PIX_FMT_YUYV: /* YUY2, 16 bits per pixel */ case V4L2_PIX_FMT_YUYV: /* YUY2, 16 bits per pixel */
rank = YUV_BASE_RANK + 10; rank = YUV_BASE_RANK + 10;
break; break;