summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2020-01-10 17:47:06 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2020-01-16 17:50:13 +0900
commit6a05d1fc1b4d83579203e53901ac63d259f4160d (patch)
tree6027bb444dfadb8f2b85a19dcc0d735e1b7e38ab /test
parent776e9acb332b616ea5dea5a3f5abb2a477999ec5 (diff)
downloadcamera-6a05d1fc1b4d83579203e53901ac63d259f4160d.tar.gz
camera-6a05d1fc1b4d83579203e53901ac63d259f4160d.tar.bz2
camera-6a05d1fc1b4d83579203e53901ac63d259f4160d.zip
[ACR-1487] Add new preview format and update camera_preview_data_ssubmit/tizen/20200204.110420submit/tizen/20200204.080130accepted/tizen/unified/20200205.125315
- new preview format : CAMERA_PIXEL_FORMAT_MJPEG for motion JPEG preview is added - update camera_preview_data_s : is_delta_frame in camera_preview_data_s is added [Version] 0.4.29 [Profile] Common [Issue Type] ACR Change-Id: If449b78fdaa5092565ab848677fd4d175760d602 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Diffstat (limited to 'test')
-rw-r--r--test/camera_test.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/camera_test.c b/test/camera_test.c
index 33e731d..f92cdfa 100644
--- a/test/camera_test.c
+++ b/test/camera_test.c
@@ -88,6 +88,7 @@ GTimeVal result_time;
| LOCAL #defines: |
-----------------------------------------------------------------------*/
#define DEFAULT_FILE_PATH "/home/owner/media"
+#define PREVIEW_CB_DUMP_FILE_NAME "preview.data"
#define MAX_FILE_NAME_LENGTH 256
#define MAX_FILE_PATH_LENGTH (MAX_FILE_NAME_LENGTH - 20)
@@ -461,9 +462,14 @@ static void _camera_interrupt_started_cb(camera_policy_e policy, camera_state_e
void _camera_preview_cb(camera_preview_data_s *frame, void *user_data)
{
#if 1
- FILE *fp = fopen(DEFAULT_FILE_PATH"/test.raw", "a");
+ char preview_dump[MAX_FILE_NAME_LENGTH] = {'\0',};
+ FILE *fp = NULL;
+
+ snprintf(preview_dump, MAX_FILE_NAME_LENGTH, "%s/%s", DEFAULT_FILE_PATH, PREVIEW_CB_DUMP_FILE_NAME);
+
+ fp = fopen(preview_dump, "a");
if (fp == NULL) {
- g_print("\n==== file[%s] open failed ====\n", DEFAULT_FILE_PATH"/test.raw");
+ g_print("\n==== file[%s] open failed ====\n", preview_dump);
return;
}
@@ -472,6 +478,8 @@ void _camera_preview_cb(camera_preview_data_s *frame, void *user_data)
fwrite(frame->data.rgb_plane.data, 1, frame->data.rgb_plane.size, fp);
} else if (frame->format == CAMERA_PIXEL_FORMAT_INVZ) {
fwrite(frame->data.depth_plane.data, 1, frame->data.depth_plane.size, fp);
+ } else if (frame->format == CAMERA_PIXEL_FORMAT_MJPEG) {
+ fwrite(frame->data.encoded_plane.data, 1, frame->data.encoded_plane.size, fp);
} else {
switch (frame->num_of_planes) {
case 1:
@@ -491,7 +499,7 @@ void _camera_preview_cb(camera_preview_data_s *frame, void *user_data)
}
}
- g_print("==== file[%s] write done ====\n", DEFAULT_FILE_PATH"/test.raw");
+ g_print("==== file[%s] write done ====\n", preview_dump);
fclose(fp);
fp = NULL;