add the definitions of export/import surface 40/257540/1 submit/tizen/20210608.000609
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 27 Apr 2021 10:16:56 +0000 (19:16 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 27 Apr 2021 10:16:56 +0000 (19:16 +0900)
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
include/tbm_type_common.h
src/tbm_surface_internal.c

index ef30de5..bd1813e 100644 (file)
@@ -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
index 068d19b..8571c0d 100644 (file)
@@ -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
index 17aa777..8586502 100644 (file)
@@ -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*/