From: Kwanghoon Son Date: Wed, 5 Jun 2024 06:16:22 +0000 (+0900) Subject: Add I420, MJPEG format X-Git-Tag: accepted/tizen/9.0/unified/20241030.235122^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified;p=platform%2Fcore%2Fmultimedia%2Fvision-source-v4l2.git Add I420, MJPEG format Change-Id: I586c672b5b37a62e0fc148a893bf51efd9220b87 Signed-off-by: Kwanghoon Son --- diff --git a/packaging/vision-source-v4l2.spec b/packaging/vision-source-v4l2.spec index 702e777..e165de3 100644 --- a/packaging/vision-source-v4l2.spec +++ b/packaging/vision-source-v4l2.spec @@ -3,7 +3,7 @@ Name: vision-source-v4l2 Summary: vision source-v4l2 -Version: 1.0.1 +Version: 1.1.0 Release: 0 Group: Multimedia/Framework License: Apache-2.0 diff --git a/src/vision_source_v4l2.cpp b/src/vision_source_v4l2.cpp index 9d7e075..d4c8151 100644 --- a/src/vision_source_v4l2.cpp +++ b/src/vision_source_v4l2.cpp @@ -147,6 +147,12 @@ static int __vision_source_get_format(uint32_t fourcc, int *pixel_format) case V4L2_PIX_FMT_NV21: *pixel_format = MEDIA_FORMAT_NV21; break; + case V4L2_PIX_FMT_YUV420: + *pixel_format = MEDIA_FORMAT_I420; + break; + case V4L2_PIX_FMT_MJPEG: + *pixel_format = MEDIA_FORMAT_MJPEG; + break; default: LOGW("unknown fourcc " FOURCC_FORMAT, FOURCC_CONVERT(fourcc)); return VISION_SOURCE_ERROR_NOT_SUPPORTED_FORMAT; @@ -172,6 +178,12 @@ static int __vision_source_get_fourcc_plane_num(media_format_mimetype_e pixel_fo case MEDIA_FORMAT_NV21: *fourcc = V4L2_PIX_FMT_NV21; break; + case MEDIA_FORMAT_I420: + *fourcc = V4L2_PIX_FMT_YUV420; + break; + case MEDIA_FORMAT_MJPEG: + *fourcc = V4L2_PIX_FMT_MJPEG; + break; default: LOGE("unknown format %d", pixel_format); return VISION_SOURCE_ERROR_INTERNAL;