From: Jeongmo Yang Date: Thu, 25 Aug 2022 08:05:33 +0000 (+0900) Subject: camera_test: Add menu for extra preview test X-Git-Tag: accepted/tizen/unified/20220829.215641^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ae824ad008bcf4118b1e37c66258c816154074d;p=platform%2Fcore%2Fapi%2Fcamera.git camera_test: Add menu for extra preview test [Version] 0.4.87 [Issue Type] Update Change-Id: Id2db982f9a3eee42aa13c2c3e89af521cac3f36f Signed-off-by: Jeongmo Yang --- diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 505ec6a..fff5121 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.86 +Version: 0.4.87 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/test/camera_test.c b/test/camera_test.c index a188c7a..8ca3544 100644 --- a/test/camera_test.c +++ b/test/camera_test.c @@ -1757,6 +1757,41 @@ cam_handle_t *init_handle() } +static void __enable_extra_preview_and_callback(camera_h camera) +{ + int err = 0; + int stream_id = 0; + int width = 0; + int height = 0; + int fps = 0; + int pixel_format = 0; + + g_print("\n\t- Format list"); + g_print("\n\t0:NV12, 1:NV12T, 2:NV16, 3:NV21, 4:YUYV, 5:UYVY, 6:422P, 7:I420, 8:YV12, 9:RGB565, 10:RGB888"); + g_print("\n\t11:RGBA, 12:ARGB, 13:ENCODED(JPEG), 14:INTERLEAVED_JPEG_UYVY, 15:H264, 16:INVZ, 17:MJPEG, 18:VP8, 19:VP9"); + g_print("\n\tSet extra preview format[stream_id width height fps format] : "); + + err = scanf("%d %d %d %d %d", &stream_id, &width, &height, &fps, &pixel_format); + flush_stdin(); + + err = camera_set_extra_preview_stream_format(camera, stream_id, pixel_format, width, height, fps); + if (err != CAMERA_ERROR_NONE) { + g_print("\n\tcamera_set_extra_preview_stream_format failed[0x%x]\n", err); + return; + } + + err = camera_set_extra_preview_cb(camera, _camera_extra_preview_cb, camera); + if (err != CAMERA_ERROR_NONE) { + g_print("\n\tcamera_set_extra_preview_cb failed[0x%x]\n", err); + return; + } + + g_print("\n\tDump extra preview data to file - NO[0], YES[Others] : "); + err = scanf("%d", &g_camera_extra_preview_cb_dump); + flush_stdin(); +} + + /** * This function is to change camcorder mode. * @@ -1770,6 +1805,7 @@ static gboolean mode_change(gchar buf) { int err = 0; int camera_type = 0; + int enable_extra_preview = 0; switch (buf) { case '1': @@ -1801,7 +1837,6 @@ static gboolean mode_change(gchar buf) } hcamcorder->type = camera_device; - break; } break; @@ -1845,6 +1880,15 @@ static gboolean mode_change(gchar buf) /*camera_set_display_flip(hcamcorder->camera, CAMERA_FLIP_VERTICAL);*/ /*camera_set_preview_cb(hcamcorder->camera, _preview_cb, hcamcorder->camera);*/ + if (camera_is_supported_extra_preview(hcamcorder->camera)) { + g_print("\n\tEnable extra preview callback - NO[0], YES[Others] : "); + err = scanf("%d", (int *)&enable_extra_preview); + flush_stdin(); + + if (enable_extra_preview) + __enable_extra_preview_and_callback(hcamcorder->camera); + } + camera_start_preview(hcamcorder->camera); gettimeofday(¤t_time, NULL);