#define CAMERA_DEVICE_MAX ((CAMERA_DEVICE_CAMERA9 + 1) * 2)
+/**
+ * @internal
+ * @brief The structure type of the camera device list.
+ * @since_tizen 6.0
+ */
typedef struct _camera_device_list_s {
unsigned int count;
camera_device_s device[CAMERA_DEVICE_MAX];
} camera_device_list_s;
+/**
+ * @internal
+ * @brief The structure type of the meta timestamp.
+ * @since_tizen 7.0
+ * @remarks This is available for specific device only.
+ */
+typedef struct _camera_meta_timestamp_s {
+ unsigned long long ts_soe;
+ unsigned long long ts_eoe;
+ unsigned long long ts_sof;
+ unsigned long long ts_eof;
+ unsigned long long ts_hal;
+ unsigned long long ts_qmf;
+ unsigned long long ts_gst;
+ unsigned long long td_exp;
+ unsigned long long ts_aux;
+ unsigned long long td_aux;
+} camera_meta_timestamp_s;
+
/**
* @internal
* @internal
* @brief Gets the timestamp of preview frame in nano second.
* @since_tizen 7.0
- * @remarks The function should be called in camera_preview_cb(),\n
+ * @remarks The function should be called in camera_preview_cb() or camera_media_packet_preview_cb(),\n
* otherwise, it will return #CAMERA_ERROR_INVALID_OPERATION.
- * @param[in] camera The handle to the camera
+ * @param[in] camera The handle to the camera
* @param[out] timestamp The timestamp of preview frame (in nsec)
* @return @c 0 on success, otherwise a negative error value
* @retval #CAMERA_ERROR_NONE Successful
int camera_attr_get_preview_frame_timestamp(camera_h camera, unsigned long *timestamp);
/**
+ * @internal
+ * @brief Gets the meta timestamp of preview frame in nano second.
+ * @since_tizen 7.0
+ * @remarks The function should be called in camera_preview_cb() or camera_media_packet_preview_cb(),\n
+ * otherwise, it will return #CAMERA_ERROR_INVALID_OPERATION.
+ * @param[in] camera The handle to the camera
+ * @param[out] meta_timestamp The meta timestamp of preview frame (in nsec)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int camera_attr_get_preview_frame_meta_timestamp(camera_h camera, camera_meta_timestamp_s *meta_timestamp);
+
+
+/**
* @}
*/
#ifdef __cplusplus
Name: capi-media-camera
Summary: A Camera API
-Version: 0.4.97
+Version: 0.4.98
Release: 0
Group: Multimedia/API
License: Apache-2.0
/* get stream info */
stream = (MMCamcorderVideoStreamDataType *)buf_pos;
+ CAM_LOG_VERBOSE("meta ts: [%llu] [%llu] [%llu] [%llu] [%llu] [%llu] [%llu] [%llu] [%llu] [%llu]",
+ stream->ts_soe, stream->ts_eoe,
+ stream->ts_sof, stream->ts_eof,
+ stream->ts_hal, stream->ts_qmf,
+ stream->ts_gst, stream->td_exp,
+ stream->ts_aux, stream->td_aux);
+
if (num_buffer_fd == 0 && CAMERA_IS_FD_VALID(tfd[1])) {
/* import tbm data_bo and get virtual address */
if (!__camera_import_tbm_fd(cb_info->bufmgr, tfd[1], &data_bo, &data_bo_handle)) {
return CAMERA_ERROR_NONE;
}
+
+
+int camera_attr_get_preview_frame_meta_timestamp(camera_h camera, camera_meta_timestamp_s *meta_timestamp)
+{
+ camera_cli_s *pc = (camera_cli_s *)camera;
+ MMCamcorderVideoStreamDataType *stream = NULL;
+
+ if (!pc || !pc->cb_info || !meta_timestamp) {
+ CAM_LOG_ERROR("NULL pointer %p %p", pc, meta_timestamp);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ stream = pc->cb_info->stream_data;
+ if (!stream) {
+ CAM_LOG_ERROR("no stream data, maybe it's not in preview callback");
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+
+ meta_timestamp->ts_soe = stream->ts_soe;
+ meta_timestamp->ts_eoe = stream->ts_eoe;
+ meta_timestamp->ts_sof = stream->ts_sof;
+ meta_timestamp->ts_eof = stream->ts_eof;
+ meta_timestamp->ts_hal = stream->ts_hal;
+ meta_timestamp->ts_qmf = stream->ts_qmf;
+ meta_timestamp->ts_gst = stream->ts_gst;
+ meta_timestamp->td_exp = stream->td_exp;
+ meta_timestamp->ts_aux = stream->ts_aux;
+ meta_timestamp->td_aux = stream->td_aux;
+
+ return CAMERA_ERROR_NONE;
+}
//LCOV_EXCL_STOP
camera_h cam_handle = (camera_h)user_data;
camera_rotation_e rotation = CAMERA_ROTATION_NONE;
unsigned long timestamp = 0;
+ camera_meta_timestamp_s meta_timestamp = {0, };
if (!cam_handle || !frame) {
g_print("\n[PREVIEW_CB] NULL param! %p %p\n", cam_handle, frame);
g_print("[PREVIEW_CB] get preview frame rotation failed[0x%x]\n", ret);
ret = camera_attr_get_preview_frame_timestamp(cam_handle, ×tamp);
- if (ret != CAMERA_ERROR_NONE)
+ if (ret == CAMERA_ERROR_NONE)
+ g_print("[PREVIEW_CB] preview[rotation:%d,timestamp:%lu] callback\n", rotation, timestamp);
+ else
g_print("[PREVIEW_CB] get preview frame timestamp failed[0x%x]\n", ret);
- g_print("[PREVIEW_CB] preview[rotation:%d,timestamp:%lu] callback\n",
- rotation, timestamp);
+ ret = camera_attr_get_preview_frame_meta_timestamp(cam_handle, &meta_timestamp);
+ if (ret == CAMERA_ERROR_NONE) {
+ g_print("[PREVIEW_CB] meta %llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu\n",
+ meta_timestamp.ts_soe, meta_timestamp.ts_eoe,
+ meta_timestamp.ts_sof, meta_timestamp.ts_eof,
+ meta_timestamp.ts_hal, meta_timestamp.ts_qmf,
+ meta_timestamp.ts_gst, meta_timestamp.td_exp,
+ meta_timestamp.ts_aux, meta_timestamp.td_aux);
+ } else {
+ g_print("[PREVIEW_CB] get preview frame meta timestamp failed[0x%x]\n", ret);
+ }
_camera_print_preview_info(frame);