Added function and enum for Checking buffer sharing capability
[platform/core/uifw/libtbm.git] / src / tbm_bufmgr.h
index f0f6ae9..9df6f45 100644 (file)
@@ -177,6 +177,16 @@ typedef enum
     TBM_BO_ERROR_DUP_FD_FAILED = TBM_ERROR_BASE|0x0116,       /**< failed to duplicate fd */
 } tbm_error_e;
 
+/**
+ * @brief Enumeration of tbm buffer manager capability.
+ * @since_tizen 2.4
+ */
+enum TBM_BUFMGR_CAPABILITY
+{
+    TBM_BUFMGR_CAPABILITY_NONE = 0,                 /**< Not Support capability*/
+    TBM_BUFMGR_CAPABILITY_SHARE_KEY = (1<<0),       /**< Support sharing buffer by tbm key */
+    TBM_BUFMGR_CAPABILITY_SHARE_FD = (1<<1),        /**< Support sharing buffer by tbm fd */
+};
 
 #ifdef __cplusplus
 extern "C" {
@@ -512,6 +522,7 @@ tbm_key  tbm_bo_export     (tbm_bo bo);
  * @brief Exports the buffer object by fd.
  * @details The tbm_bo can be exported to the anther process with the unique fd associated with the the tbm_bo.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks You must release the fd using close().
  * @param[in] bo : the buffer object
  * @return fd associated with the buffer object
  * @retval #tbm_fd
@@ -584,6 +595,7 @@ tbm_bo        tbm_bo_import     (tbm_bufmgr bufmgr, tbm_key key);
  * @brief Imports the buffer object associated with the fd.
  * @details The reference count of the tbm_bo is 1.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks You must release the fd using close().
  * @param[in] bufmgr : the buffer manager
  * @param[in] fd : the fd associated with the buffer object
  * @return a buffer object
@@ -976,6 +988,28 @@ int tbm_bo_get_user_data    (tbm_bo bo, unsigned long key, void** data);
  */
 tbm_error_e tbm_get_last_error    (void);
 
+/**
+ * @brief Gets the tbm buffer capability.
+ * @since_tizen 2.4
+ * @param[in] bufmgr : the buffer manager
+ * @return the tbm bufmgr capability
+ * @par Example
+   @code
+   #include <tbm_bufmgr.h>
+
+   int bufmgr_fd;
+   tbm_bufmgr bufmgr;
+   unsigned int capability;
+
+   bufmgr = tbm_bufmgr_init (bufmgr_fd);
+
+   capability = tbm_bufmgr_get_capability (bufmgr);
+
+   tbm_bufmgr_deinit (bufmgr);
+   @endcode
+ */
+unsigned int tbm_bufmgr_get_capability (tbm_bufmgr bufmgr);
+
 #ifdef __cplusplus
 }
 #endif