tbm_surface_queue: pending delete queue_node until released queue
[platform/core/uifw/libtbm.git] / src / tbm_surface_internal.h
index fbda74a..12dd3b1 100644 (file)
@@ -178,7 +178,7 @@ void tbm_surface_internal_unref(tbm_surface_h surface);
  * @brief Gets the number of buffer objects associated with the tbm_surface.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] surface : the tbm_surface_h
- * @return the number of buffer objects associated with the tbm_surface_h, otherwise -1.
+ * @return the number of buffer objects associated with the tbm_surface_h, otherwise 0.
  * @par Example
    @code
    #include <tbm_surface.h>
@@ -231,7 +231,7 @@ tbm_bo tbm_surface_internal_get_bo(tbm_surface_h surface, int bo_idx);
  * @brief Gets the size of the surface.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] surface : the tbm_surface_h
- * @return the size of tbm_surface, otherwise -1.
+ * @return the size of tbm_surface, otherwise 0.
  * @par Example
    @code
    #include <tbm_surface.h>
@@ -246,7 +246,7 @@ tbm_bo tbm_surface_internal_get_bo(tbm_surface_h surface, int bo_idx);
    tbm_surface_destroy (surface);
    @endcode
  */
-int tbm_surface_internal_get_size(tbm_surface_h surface);
+unsigned int tbm_surface_internal_get_size(tbm_surface_h surface);
 
 /**
  * @brief Gets size, offset and pitch data of plane by the plane_index.
@@ -322,7 +322,7 @@ int tbm_surface_internal_get_bpp(tbm_format format);
  * @since_tizen 2.4
  * @param[in] surface : the tbm_surface_h
  * @param[in] plane_idx : the bo index in the tbm_surface
- * @return bo index of plane, otherwise -1.
+ * @return bo index of plane, otherwise 0.
  * @par Example
    @code
    #include <tbm_surface.h>
@@ -350,6 +350,16 @@ void tbm_surface_internal_set_debug_pid(tbm_surface_h surface,
                                        unsigned int pid);
 
 /**
+ * @brief Set the string value to the tbm_surface for debugging.
+ * @since_tizen 3.0
+ * @param[in] surface : the tbm_surface_h
+ * @param[in] key : the key for debugging
+ * @param[in] value : the value for debugging
+ */
+int tbm_surface_internal_set_debug_data(tbm_surface_h surface,
+                                       char *key, char *value);
+
+/**
  * @brief Adds a user_data to the tbm surface.
  * @since_tizen 3.0
  * @param[in] surface : the tbm surface.
@@ -409,6 +419,23 @@ int tbm_surface_internal_delete_user_data(tbm_surface_h surface,
 void tbm_surface_internal_dump_start(char *path, int w, int h, int count);
 
 /**
+ * @brief Start the dump with scale debugging.
+ * @details
+ * Dump with scale supports only if a buffer has below formats.
+ * - TBM_FORMAT_ARGB8888
+ * - TBM_FORMAT_XRGB8888
+ * @since_tizen 4.0
+ * @param[in] path : the given dump path
+ * @param[in] w : the width of dump image
+ * @param[in] h : the height of dump image
+ * @param[in] count : the dump count number
+ * @param[in] scale : the scale factor
+ * @see #tdm_helper_dump_stop()
+ */
+void tbm_surface_internal_dump_with_scale_start(char *path, int w, int h,
+                                         int count, double scale);
+
+/**
  * @brief End the dump debugging.
  * @since_tizen 3.0
  * @see #tdm_helper_dump_start()
@@ -430,9 +457,21 @@ void tbm_surface_internal_dump_end(void);
  * The filename extension should be "png" for TBM_FORMAT_ARGB8888 and TBM_FORMAT_XRGB8888
  * or "yuv" for YUV formats.
  * @param[in] surface : a tbm surface
- * @param[in] type : a string used by a file name.
+ * @param[in] name : a string used by a file name
  */
-void tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type);
+void tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *name);
+
+/**
+ * @brief Dump a shared memory buffer
+ * @details
+ * This function supports shared memory buffer dump.
+ * @param[in] ptr : a pointer of dump buffer
+ * @param[in] w : a width of dump buffer
+ * @param[in] h : a height of dump buffer
+ * @param[in] stride : a stride of dump buffer
+ * @param[in] name : a string used by a file name
+ */
+void tbm_surface_internal_dump_shm_buffer(void *ptr, int w, int h, int stride, const char *name);
 
 /**
  * @brief check valid tbm surface.
@@ -442,6 +481,46 @@ void tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type);
  */
 int tbm_surface_internal_is_valid(tbm_surface_h surface);
 
+/**
+ * @brief Capture a buffer
+ * @details
+ * This function supports only if a buffer has below formats.
+ * - TBM_FORMAT_ARGB8888
+ * - TBM_FORMAT_XRGB8888
+ * - TBM_FORMAT_YVU420
+ * - TBM_FORMAT_YUV420
+ * - TBM_FORMAT_NV12
+ * - TBM_FORMAT_NV21
+ * - TBM_FORMAT_YUYV
+ * - TBM_FORMAT_UYVY
+ * The type should be "png" for TBM_FORMAT_ARGB8888 and TBM_FORMAT_XRGB8888
+ * or "yuv" for YUV formats.
+ * @param[in] surface : a tbm surface
+ * @param[in] path : the given dump path
+ * @param[in] name : a string used by a file name
+ * @param[in] type : a string used by a file type ex)png, yuv
+ * @return 1 if success, otherwise 0.
+ */
+int tbm_surface_internal_capture_buffer(tbm_surface_h surface, const char *path,
+                                      const char *name, const char *type);
+
+/**
+ * @brief Capture a shared memory buffer
+ * @details
+ * This function supports shared memory buffer dump.
+ * The type should be "png".
+ * @param[in] ptr : a pointer of dump buffer
+ * @param[in] w : a width of dump buffer
+ * @param[in] h : a height of dump buffer
+ * @param[in] stride : a stride of dump buffer
+ * @param[in] path : the given dump path
+ * @param[in] name : a string used by a file name
+ * @param[in] type : a string used by a file type ex)png, yuv
+ * @return 1 if success, otherwise 0.
+ */
+int tbm_surface_internal_capture_shm_buffer(void *ptr, int w, int h, int stride,
+                                      const char *path, const char *name, const char *type);
+
 #ifdef __cplusplus
 }
 #endif