From 111235f88e860ec2b11d876ee185dfedf117c4b2 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 12 Nov 2018 21:27:14 +0900 Subject: [PATCH] hwc: add tdm_hwc_get_video_available_properties. The available video properties is different from the ui properties. The client needs to get the only available video properties. Change-Id: Ibb13dded2bec0efc486899daf1a59ea8e528e414 --- include/tdm.h | 9 +++++++++ include/tdm_backend.h | 10 ++++++++++ src/tdm_hwc.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index c8ab346..ab9197c 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -906,6 +906,15 @@ tdm_hwc_create_window(tdm_hwc *hwc, tdm_error *error); tdm_error tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *count); +/** + * @brief Get the available video property array of a hwc object. + * @param[in] hwc A hwc + * @param[out] props The available video property array + * @param[out] count The count of video properties + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_hwc_get_video_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *count); /** * @brief Get the hwc video capability diff --git a/include/tdm_backend.h b/include/tdm_backend.h index da89269..40390c3 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -803,6 +803,16 @@ typedef struct _tdm_func_hwc { tdm_error (*hwc_get_video_supported_formats)(tdm_hwc *hwc, const tbm_format **formats, int *count); /** + * @brief Get the available video property array of a hwc object. + * @param[in] hwc A hwc object + * @param[out] props The available video property array + * @param[out] count The count of video properties + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ + tdm_error (*hwc_get_video_available_properties)(tdm_hwc *hwc, const tdm_prop **props, + int *count); + + /** * @brief Get the hwc video capability * @param[in] hwc A hwc object * @param[out] video_capability A hwc hwc video capability diff --git a/src/tdm_hwc.c b/src/tdm_hwc.c index 5dd71a3..bd7428c 100644 --- a/src/tdm_hwc.c +++ b/src/tdm_hwc.c @@ -209,6 +209,37 @@ tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, in } EXTERN tdm_error +tdm_hwc_get_video_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *count) +{ + tdm_private_module *private_module; + tdm_func_hwc *func_hwc = NULL; + + HWC_FUNC_ENTRY(); + + TDM_RETURN_VAL_IF_FAIL(props != NULL, TDM_ERROR_INVALID_PARAMETER); + TDM_RETURN_VAL_IF_FAIL(count != NULL, TDM_ERROR_INVALID_PARAMETER); + + _pthread_mutex_lock(&private_display->lock); + + private_module = private_output->private_module; + func_hwc = &private_module->func_hwc; + + if (!func_hwc->hwc_get_video_available_properties) { + /* LCOV_EXCL_START */ + _pthread_mutex_unlock(&private_display->lock); + TDM_WRN("not implemented!!"); + return TDM_ERROR_NOT_IMPLEMENTED; + /* LCOV_EXCL_STOP */ + } + + ret = func_hwc->hwc_get_video_available_properties(private_hwc->hwc_backend, props, count); + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error tdm_hwc_get_video_capability(tdm_hwc *hwc, tdm_hwc_video_capability *video_capability) { -- 2.7.4