From 0f29ad9ebd24537106e46ed51df3655e533967d2 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 27 Apr 2021 19:16:56 +0900 Subject: [PATCH] add the definitions of export/import surface add tbm_surface_buffer_data and define two surface_internal api below - tbm_surface_internal_export - tbm_surface_internal_import Change-Id: Ib098d8799e8f61aa20c1ee71af4ffa6b0a27b182 --- include/tbm_surface_internal.h | 15 +++++++++++++++ include/tbm_type_common.h | 14 +++++++++++++- src/tbm_surface_internal.c | 15 +++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/include/tbm_surface_internal.h b/include/tbm_surface_internal.h index ef30de5..bd1813e 100644 --- a/include/tbm_surface_internal.h +++ b/include/tbm_surface_internal.h @@ -566,6 +566,21 @@ int tbm_surface_internal_add_destroy_handler(tbm_surface_h surface, tbm_surface_ */ void tbm_surface_internal_remove_destroy_handler(tbm_surface_h surface, tbm_surface_internal_destroy_handler func, void *user_data); +/** + * @brief Export a tbm_surface_buffer_data of surface + * @param[in] surface : a tbm surface + * @param[out] error : an error type + */ +tbm_surface_buffer_data *tbm_surface_internal_export(tbm_surface_h surface, tbm_error_e *error); + +/** + * @brief Import a surface object + * @param[in] surface_info : an information fo surface + * @param[in] buffer_data : a buffer data of surface + * @param[out] error : an error type + */ +tbm_surface_h tbm_surface_internal_import(tbm_surface_info_s *surface_info, tbm_surface_buffer_data *buffer_data, tbm_error_e *error); + #ifdef __cplusplus } #endif diff --git a/include/tbm_type_common.h b/include/tbm_type_common.h index 068d19b..8571c0d 100644 --- a/include/tbm_type_common.h +++ b/include/tbm_type_common.h @@ -75,7 +75,6 @@ typedef int32_t tbm_fd; */ typedef void tbm_native_display; - /* TBM_DEVICE_TYPE */ /** @@ -193,6 +192,19 @@ enum TBM_BO_FLAGS { }; /** + * @brief Definition for the TBM surface buffer data struct. + * @since_tizen 6.5 + */ +typedef struct _tbm_surface_buffer_data { + int *fds; /**< an array of dmabuf fds */ + unsigned int num_fds; /**< the number of dmabuf fds */ + int *meta_data; /**< an array of meta data */ + unsigned int num_meta_data; /**< the number of meta data */ + void *reserved1; /**< reserved data1 */ + void *reserved2; /**< reserved data2 */ +} tbm_surface_buffer_data; + +/** * @brief Called when the user data is deleted in buffer object. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] user_data User_data to be passed to callback function diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index 17aa777..8586502 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -2708,4 +2708,19 @@ tbm_surface_internal_remove_destroy_handler(tbm_surface_h surface, tbm_surface_i _tbm_surface_mutex_unlock(); } + +tbm_surface_buffer_data * +tbm_surface_internal_export(tbm_surface_h surface, tbm_error_e *error) +{ + // TODO: implement + return NULL; +} + +tbm_surface_h +tbm_surface_internal_import(tbm_surface_info_s *surface_info, tbm_surface_buffer_data *buffer_data, tbm_error_e *error) +{ + // TODO: implement + return NULL; +} + /*LCOV_EXCL_STOP*/ -- 2.7.4