hwc: add tdm_hwc_get_video_available_properties. 99/192899/1 accepted/tizen/5.0/unified/20181116.080132 accepted/tizen/unified/20181115.151623 submit/tizen/20181115.024059 submit/tizen_5.0/20181115.024119
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 12 Nov 2018 12:27:14 +0000 (21:27 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 12 Nov 2018 12:34:05 +0000 (21:34 +0900)
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
include/tdm_backend.h
src/tdm_hwc.c

index c8ab346..ab9197c 100644 (file)
@@ -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
index da89269..40390c3 100644 (file)
@@ -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
index 5dd71a3..bd7428c 100644 (file)
@@ -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)
 {