camera_internal: Fix invalid type for timestamp 95/304495/1 accepted/tizen/unified/20240123.165901 accepted/tizen/unified/toolchain/20240311.065101 accepted/tizen/unified/x/20240205.063807
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 18 Jan 2024 05:13:02 +0000 (14:13 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Thu, 18 Jan 2024 05:44:53 +0000 (14:44 +0900)
[Version] 0.4.120
[Issue Type] Bug fix

Change-Id: I36f61cbf9fc3898291c27fef0c8db79add9c630a
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
include/camera_internal.h
packaging/capi-media-camera.spec
src/camera_internal.c
test/camera_test.c

index c8b4367..06533ef 100644 (file)
@@ -248,7 +248,7 @@ int camera_request_codec_config(camera_h camera);
  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
  */
-int camera_attr_get_preview_frame_timestamp(camera_h camera, unsigned long *timestamp);
+int camera_attr_get_preview_frame_timestamp(camera_h camera, unsigned long long *timestamp);
 
 /**
  * @internal
index 147ca36..59b59ee 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.119
+Version:    0.4.120
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 06c117b..a52db67 100644 (file)
@@ -292,7 +292,7 @@ int camera_request_codec_config(camera_h camera)
 }
 
 
-int camera_attr_get_preview_frame_timestamp(camera_h camera, unsigned long *timestamp)
+int camera_attr_get_preview_frame_timestamp(camera_h camera, unsigned long long *timestamp)
 {
        camera_cli_s *pc = (camera_cli_s *)camera;
 
@@ -308,7 +308,7 @@ int camera_attr_get_preview_frame_timestamp(camera_h camera, unsigned long *time
 
        *timestamp = pc->cb_info->stream_data->timestamp_nsec;
 
-       CAM_LOG_DEBUG("frame timestamp[%lu]", *timestamp);
+       CAM_LOG_DEBUG("frame timestamp[%llu]", *timestamp);
 
        return CAMERA_ERROR_NONE;
 }
index 43146df..0108f26 100644 (file)
@@ -472,7 +472,7 @@ static void _camera_preview_cb(camera_preview_data_s *frame, void *user_data)
        int ret = CAMERA_ERROR_NONE;
        camera_h cam_handle = (camera_h)user_data;
        camera_rotation_e rotation = CAMERA_ROTATION_NONE;
-       unsigned long timestamp = 0;
+       unsigned long long timestamp = 0;
        camera_frame_meta_s frame_meta = {0, };
        camera_status_auto_exposure_e status_ae = CAMERA_STATUS_AUTO_EXPOSURE_NONE;
        camera_status_auto_white_balance_e status_awb = CAMERA_STATUS_AUTO_WHITE_BALANCE_NONE;
@@ -487,11 +487,11 @@ static void _camera_preview_cb(camera_preview_data_s *frame, void *user_data)
                LOGW("get preview frame rotation failed[0x%x]", ret);
 
        ret = camera_attr_get_preview_frame_timestamp(cam_handle, &timestamp);
-       if (ret != CAMERA_ERROR_NONE)
+       if (ret == CAMERA_ERROR_NONE)
+               LOGI("rotation[%d], timestamp[%llu]", rotation, timestamp);
+       else
                LOGW("get preview frame timestamp failed[0x%x]", ret);
 
-       LOGI("rotation[%d], timestamp[%lu]", rotation, timestamp);
-
        ret = camera_attr_get_preview_frame_meta(cam_handle, &frame_meta);
        if (ret == CAMERA_ERROR_NONE) {
                LOGD("meta %llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu%llu,%llu",
@@ -499,7 +499,7 @@ static void _camera_preview_cb(camera_preview_data_s *frame, void *user_data)
                        frame_meta.ts_hal, frame_meta.ts_qmf, frame_meta.ts_gst, frame_meta.td_exp,
                        frame_meta.ts_aux, frame_meta.td_aux, frame_meta.seqnum, frame_meta.flags);
        } else {
-               LOGW("get preview frame meta timestamp failed[0x%x]", ret);
+               LOGW("get preview frame meta failed[0x%x]", ret);
        }
 
        ret = camera_attr_get_preview_frame_status_auto_exposure(cam_handle, &status_ae);