Add surface internal function for getting bo idx 98/43698/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 9 Jul 2015 05:32:50 +0000 (14:32 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 13 Jul 2015 08:33:15 +0000 (17:33 +0900)
Change-Id: I41c4275a5a3100792c07f369eff49ed73916f69f
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
packaging/libtbm.spec
src/tbm_surface_internal.c [changed mode: 0644->0755]
src/tbm_surface_internal.h [changed mode: 0644->0755]

index 33634bc..4f4efe1 100644 (file)
@@ -2,7 +2,7 @@
 %bcond_with wayland
 
 Name:           libtbm
-Version:        1.1.5
+Version:        1.1.6
 Release:        1
 License:        MIT
 Summary:        The library for Tizen Buffer Manager
old mode 100644 (file)
new mode 100755 (executable)
index 9ba44eb..8c9ddb7
@@ -775,3 +775,21 @@ tbm_surface_internal_get_format (tbm_surface_h surface)
     return format;
 }
 
+int
+tbm_surface_internal_get_plane_bo_idx (tbm_surface_h surface, int plane_idx)
+{
+    TBM_RETURN_VAL_IF_FAIL (surface, 0);
+    TBM_RETURN_VAL_IF_FAIL (plane_idx > -1, 0);
+    struct _tbm_surface *surf;
+    int bo_idx;
+
+    _tbm_surface_mutex_lock();
+
+    surf = (struct _tbm_surface *)surface;
+    bo_idx = surf->planes_bo_idx[plane_idx];
+
+    _tbm_surface_mutex_unlock();
+
+    return bo_idx;
+}
+
old mode 100644 (file)
new mode 100755 (executable)
index 242fd54..44b31c6
@@ -302,6 +302,29 @@ int tbm_surface_internal_get_num_planes (tbm_format format);
  */
 int tbm_surface_internal_get_bpp (tbm_format format);
 
+/**
+ * @brief Gets bo index of plane.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] surface : the tbm_surface_h
+ * @param[in] plane_idx : the bo index in the the tbm_surface
+ * @return bo index of plane, otherwise -1.
+ * @par Example
+   @code
+   #include <tbm_surface.h>
+   #include <tbm_surface_internal.h>
+
+   int bo_idx;
+   tbm_surface_h surface;
+
+   surface = tbm_surfacel_create (128, 128, TBM_FORMAT_YUV420);
+   bo_idx = tbm_surface_internal_get_plane_bo_idx (surface, 0);
+
+   ...
+
+   @endcode
+ */
+int tbm_surface_internal_get_plane_bo_idx (tbm_surface_h surface, int plane_idx);
+
 #ifdef __cplusplus
 }
 #endif