tdm_output_hwc_get_target_buffer_queue(tdm_output *output, tdm_error *error);
/**
+ * @brief Get the supported format array for video hwc windows of a output object.
+ * @param[in] output A output object
+ * @param[out] formats The available format array
+ * @param[out] count The count of formats
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+tdm_error
+tdm_output_hwc_get_video_supported_formats(tdm_layer *layer, const tbm_format **formats,
+ int *count);
+
+/**
* @brief Get the capabilities of a layer object.
* @param[in] layer A layer object
* @param[out] capabilities The capabilities of a layer object
tdm_hwc_window_video_capability *video_capability);
/**
- * @brief Get the window video supported format
- * @param[in] hwc_window A window object
- * @param[out] formats A hwc window supported formats
- * @param[out] count A number of the hwc window supported formats
- * @return #TDM_ERROR_NONE if success. Otherwise, error value.
- * @since 2.0.0
- */
-tdm_error
-tdm_hwc_window_video_get_supported_format(tdm_hwc_window *hwc_window,
- const tbm_format **formats,
- int *count);
-
-/**
* @brief Destroy a pp object
* @param[in] pp A pp object
* @see tdm_display_create_pp
tbm_surface_queue_h (*output_hwc_get_target_buffer_queue)(tdm_output *output,
tdm_error *error);
- void (*reserved3)(void);
+ /**
+ * @brief Get the supported format array for video hwc windows of a output object.
+ * @param[in] output A output object
+ * @param[out] formats The available format array
+ * @param[out] count The count of formats
+ * @return #TDM_ERROR_NONE if success. Otherwise, error value.
+ */
+ tdm_error (*output_hwc_get_video_supported_formats)(tdm_layer *layer,
+ const tbm_format **formats, int *count);
void (*reserved4)(void);
void (*reserved5)(void);
void (*reserved6)(void);
* @return #TDM_ERROR_NONE if success. Otherwise, error value.
*/
tdm_error (*hwc_window_video_get_capability)(tdm_hwc_window *hwc_window,
- tdm_hwc_window_video_capability *video_capability);
-
- /**
- * @brief Get the window video supported format
- * @param[in] hwc_window A window object
- * @param[out] formats A hwc window supported formats
- * @param[out] count A number of the hwc window supported formats
- * @return #TDM_ERROR_NONE if success. Otherwise, error value.
- */
- tdm_error (*hwc_window_video_get_supported_format)(tdm_hwc_window *hwc_window,
- const tbm_format **formats,
- int *count);
+ tdm_hwc_window_video_capability *video_capability);
/**
* @brief Get the available property array of a video hwc window object.
}
EXTERN tdm_error
-tdm_hwc_window_video_get_supported_format(tdm_hwc_window *hwc_window,
- const tbm_format **formats,
- int *count)
-{
- tdm_func_hwc_window *func_hwc_window = NULL;
-
- HWC_WINDOW_FUNC_ENTRY();
-
- TDM_RETURN_VAL_IF_FAIL(formats != NULL, TDM_ERROR_INVALID_PARAMETER);
- TDM_RETURN_VAL_IF_FAIL(count != NULL, TDM_ERROR_INVALID_PARAMETER);
-
- _pthread_mutex_lock(&private_display->lock);
-
- func_hwc_window = &private_display->func_hwc_window;
-
- if (!func_hwc_window->hwc_window_video_get_supported_format) {
- /* LCOV_EXCL_START */
- _pthread_mutex_unlock(&private_display->lock);
- TDM_ERR("not implemented!!");
- return TDM_ERROR_NOT_IMPLEMENTED;
- /* LCOV_EXCL_STOP */
- }
-
- ret = func_hwc_window->hwc_window_video_get_supported_format(private_hwc_window->hwc_window_backend,
- formats, count);
-
- _pthread_mutex_unlock(&private_display->lock);
-
- return ret;
-}
-
-EXTERN tdm_error
tdm_hwc_window_video_get_available_properties(tdm_hwc_window *hwc_window,
const tdm_prop **props, int *count)
{
return ret;
}
+tdm_error
+tdm_output_hwc_get_video_supported_formats(tdm_output *output, const tbm_format **formats,
+ int *count)
+{
+ tdm_func_output *func_output;
+ OUTPUT_FUNC_ENTRY();
+
+ TDM_RETURN_VAL_IF_FAIL(formats != NULL, TDM_ERROR_INVALID_PARAMETER);
+ TDM_RETURN_VAL_IF_FAIL(count != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+ _pthread_mutex_lock(&private_display->lock);
+
+ func_output = &private_display->func_output;
+
+ if (!func_output->output_hwc_get_video_supported_formats) {
+ /* LCOV_EXCL_START */
+ _pthread_mutex_unlock(&private_display->lock);
+ TDM_ERR("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
+
+ ret = func_output->output_hwc_get_video_supported_formats(
+ private_output->output_backend, formats, count);
+
+ _pthread_mutex_unlock(&private_display->lock);
+
+ return ret;
+}
+
INTERN void
tdm_output_call_change_handler_internal(tdm_private_output *private_output,
struct list_head *change_handler_list,
}
}
-
-/* tdm_error tdm_hwc_window_video_get_supported_format(tdm_hwc_window *hwc_window, const tbm_format **formats, int *count); */
-TEST_F(TDMHwcWindow, VideoGetSupportedFormatFailNull)
-{
- const tbm_format *formats;
- int count;
-
- error = tdm_hwc_window_video_get_supported_format(NULL, &formats, &count);
- ASSERT_NE(TDM_ERROR_NONE, error);
-
- if (hwc_count > 0) {
- error = tdm_hwc_window_video_get_supported_format(hwc_wins[0], NULL, &count);
- error = tdm_hwc_window_video_get_supported_format(hwc_wins[0], &formats, NULL);
- }
-}
-
-TEST_F(TDMHwcWindow, VideoGetSupportedFormatSuccessful)
-{
- const tbm_format *formats;
- int count;
-
- for (int i = 0; i < hwc_count; i++) {
- /* hwc_window with TDM_COMPOSITION_CLIENT dosn't support tdm_hwc_window_video_get_supported_format()*/
- error = tdm_hwc_window_set_composition_type(hwc_wins[i], TDM_COMPOSITION_CLIENT);
- ASSERT_EQ(TDM_ERROR_NONE, error);
- error = tdm_hwc_window_video_get_supported_format(hwc_wins[i], &formats, &count);
- ASSERT_NE(TDM_ERROR_NONE, error);
-
- /*TODO:: check format for TDM_COMPOSITION_VIDEO*/
- }
-}
-
/* tdm_error tdm_output_hwc_validate(tdm_output *output, uint32_t *num_types); */
TEST_F(TDMOutputHwc, ValidateFailNull)
{