From 9d6b519068aef680830ee10d3bf79b5e27688cc7 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 9 Jul 2015 14:32:50 +0900 Subject: [PATCH] Add surface internal function for getting bo idx Change-Id: I41c4275a5a3100792c07f369eff49ed73916f69f Signed-off-by: Changyeon Lee --- packaging/libtbm.spec | 2 +- src/tbm_surface_internal.c | 18 ++++++++++++++++++ src/tbm_surface_internal.h | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/tbm_surface_internal.c mode change 100644 => 100755 src/tbm_surface_internal.h diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec index 33634bc..4f4efe1 100644 --- a/packaging/libtbm.spec +++ b/packaging/libtbm.spec @@ -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 diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c old mode 100644 new mode 100755 index 9ba44eb..8c9ddb7 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -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; +} + diff --git a/src/tbm_surface_internal.h b/src/tbm_surface_internal.h old mode 100644 new mode 100755 index 242fd54..44b31c6 --- a/src/tbm_surface_internal.h +++ b/src/tbm_surface_internal.h @@ -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 + #include + + 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 -- 2.7.4