From: Boram Park Date: Wed, 23 Nov 2016 02:44:19 +0000 (+0900) Subject: add tdm_display_get_capture_available_size & tdm_display_get_max_layer_count X-Git-Tag: accepted/tizen/3.0.m2/mobile/20170104.142956~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8bfecf9035a5b604b54a172b2185f87463f7f4f;p=platform%2Fcore%2Fuifw%2Flibtdm.git add tdm_display_get_capture_available_size & tdm_display_get_max_layer_count Change-Id: I3d3507ef1e3a590422032c35ee1f5c3adc7f2a44 --- diff --git a/include/tdm.h b/include/tdm.h index 7834591..15b1f56 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -203,6 +203,31 @@ tdm_display_get_catpure_available_formats(tdm_display *dpy, const tbm_format **formats, int *count); /** + * @brief Get the capture available size of a display object. + * @details -1 means that a TDM backend module doesn't define the value. + * @param[in] dpy A display object + * @param[out] min_w The minimum width which TDM can handle + * @param[out] min_h The minimum height which TDM can handle + * @param[out] max_w The maximum width which TDM can handle + * @param[out] max_h The maximum height which TDM can handle + * @param[out] preferred_align The preferred align width which TDM can handle + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h, + int *max_w, int *max_h, int *preferred_align); + +/** + * @brief Get the max layer counts which a display object can show on screen. + * @details -1 means that a TDM backend module doesn't define the value. + * @param[in] dpy A display object + * @param[out] count The max count of layers + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_display_get_max_layer_count(tdm_display *dpy, int *max_count); + +/** * @brief Get the output counts which a display object has. * @param[in] dpy A display object * @param[out] count The count of outputs diff --git a/src/tdm_display.c b/src/tdm_display.c index 975e72f..d240d97 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -246,6 +246,52 @@ tdm_display_get_catpure_available_formats(tdm_display *dpy, } EXTERN tdm_error +tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h, + int *max_w, int *max_h, int *preferred_align) +{ + DISPLAY_FUNC_ENTRY(); + + _pthread_mutex_lock(&private_display->lock); + + if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE)) { + TDM_ERR("no capture capability"); + _pthread_mutex_unlock(&private_display->lock); + return TDM_ERROR_NO_CAPABILITY; + } + + if (min_w) + *min_w = private_display->caps_capture.min_w; + if (min_h) + *min_h = private_display->caps_capture.min_h; + if (max_w) + *max_w = private_display->caps_capture.max_w; + if (max_h) + *max_h = private_display->caps_capture.max_h; + if (preferred_align) + *preferred_align = private_display->caps_capture.preferred_align; + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error +tdm_display_get_max_layer_count(tdm_display *dpy, int *max_count) +{ + DISPLAY_FUNC_ENTRY(); + + TDM_RETURN_VAL_IF_FAIL(max_count != NULL, TDM_ERROR_INVALID_PARAMETER); + + _pthread_mutex_lock(&private_display->lock); + + *max_count = private_display->caps_display.max_layer_count; + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error tdm_display_get_output_count(tdm_display *dpy, int *count) { tdm_private_output *private_output = NULL;