bool tc_tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer)
{
- tdm_info_layer old_info, info;
-
- TDM_UT_RETURN_FALSE_IF_FAIL(buffer != NULL);
-
- TDM_UT_RETURN_FALSE_IF_FAIL(tdm_layer_get_info(layer, &old_info) == TDM_ERROR_NONE);
- TDM_UT_RETURN_FALSE_IF_FAIL(tc_tdm_layer_fill_info(layer, buffer, NULL, &info) == true);
-
- if (memcmp(&old_info, &info, sizeof info)) {
- TDM_UT_RETURN_FALSE_IF_FAIL(tdm_layer_set_info(layer, &info) == TDM_ERROR_NONE);
-
- tdm_output *output;
- tdm_error ret;
- int index = -1;
- unsigned int pipe = 0;
- output = tdm_layer_get_output(layer, &ret);
- TDM_UT_RETURN_FALSE_IF_FAIL(ret == TDM_ERROR_NONE);
- TDM_UT_RETURN_FALSE_IF_FAIL(tdm_layer_get_index(layer, &index) == TDM_ERROR_NONE);
- TDM_UT_RETURN_FALSE_IF_FAIL(tdm_output_get_pipe(output, &pipe) == TDM_ERROR_NONE);
- TDM_INFO("filling output(%d) layer(%d) info done: src_config(%dx%d: %d,%d %dx%d: %c%c%c%c) dst_pos(%d,%d %dx%d) transform(%s)",
- pipe, index,
- info.src_config.size.h, info.src_config.size.v,
- info.src_config.pos.x, info.src_config.pos.y, info.src_config.pos.w, info.src_config.pos.h,
- FOURCC_STR(info.src_config.format),
- info.dst_pos.x, info.dst_pos.y, info.dst_pos.w, info.dst_pos.h,
- tdm_transform_str(info.transform));
- }
-
- TDM_UT_RETURN_FALSE_IF_FAIL(tdm_layer_set_buffer(layer, buffer) == TDM_ERROR_NONE);
-
- return true;
+ return tc_tdm_layer_set_buffer_with_pos(layer, buffer, NULL);
}
bool tc_tdm_layer_set_buffer_with_pos(tdm_layer *layer, tbm_surface_h buffer, tdm_pos *pos)
tdm_info_layer old_info, info;
TDM_UT_RETURN_FALSE_IF_FAIL(buffer != NULL);
- TDM_UT_RETURN_FALSE_IF_FAIL(pos != NULL);
TDM_UT_RETURN_FALSE_IF_FAIL(tdm_layer_get_info(layer, &old_info) == TDM_ERROR_NONE);
TDM_UT_RETURN_FALSE_IF_FAIL(tc_tdm_layer_fill_info(layer, buffer, NULL, &info) == true);
- info.dst_pos.x = pos->x;
- info.dst_pos.y = pos->y;
- TDM_UT_RETURN_FALSE_IF_FAIL(info.dst_pos.w = pos->w);
- TDM_UT_RETURN_FALSE_IF_FAIL(info.dst_pos.h = pos->h);
+ if (pos) {
+ info.dst_pos.x = pos->x;
+ info.dst_pos.y = pos->y;
+ TDM_UT_RETURN_FALSE_IF_FAIL(info.dst_pos.w = pos->w);
+ TDM_UT_RETURN_FALSE_IF_FAIL(info.dst_pos.h = pos->h);
+ }
if (memcmp(&old_info, &info, sizeof info)) {
TDM_UT_RETURN_FALSE_IF_FAIL(tdm_layer_set_info(layer, &info) == TDM_ERROR_NONE);