struct
{
int count;
- tbm_format *formats;
- } available_formats;
-
- struct
- {
- int count;
tdm_client_output_mode *modes;
} available_modes;
if (private_voutput->available_modes.modes)
free(private_voutput->available_modes.modes);
- if (private_voutput->available_formats.formats)
- free(private_voutput->available_formats.formats);
-
LIST_FOR_EACH_ENTRY_SAFE(h, hh, &private_voutput->commit_handler_list, link) {
LIST_DEL(&h->link);
free(h);
}
tdm_error
-tdm_client_voutput_set_available_formats(tdm_client_voutput *voutput, const tbm_format *formats, const int count)
-{
- tdm_private_client_voutput *private_voutput;
-
- TDM_RETURN_VAL_IF_FAIL(voutput != NULL, TDM_ERROR_INVALID_PARAMETER);
-
- if ((count > 0) && (formats == NULL))
- return TDM_ERROR_INVALID_PARAMETER;
-
- private_voutput = (tdm_private_client_voutput *)voutput;
-
- if (private_voutput->base.connection == TDM_OUTPUT_CONN_STATUS_CONNECTED)
- return TDM_ERROR_BAD_REQUEST;
-
- if (private_voutput->available_formats.formats)
- free(private_voutput->available_formats.formats);
-
- private_voutput->available_formats.count = count;
-
- if (count != 0)
- {
- private_voutput->available_formats.formats = calloc(count, sizeof(tbm_format));
- memcpy(private_voutput->available_formats.formats, formats, sizeof(tbm_format) * count);
- }
-
- return TDM_ERROR_NONE;
-}
-
-tdm_error
tdm_client_voutput_set_physical_size(tdm_client_voutput *voutput, unsigned int mmWidth, unsigned int mmHeight)
{
tdm_private_client_voutput *private_voutput;
}
void
-_tdm_client_voutput_send_available_formats(tdm_private_client_voutput *private_voutput)
-{
- tbm_format *format;
- struct wl_array array;
- int i, size;
-
- size = sizeof(tbm_format);
- wl_array_init(&array);
- for (i = 0; i < private_voutput->available_formats.count; i++) {
- format = wl_array_add(&array, size);
- *format = private_voutput->available_formats.formats[i];
- }
- wl_tdm_voutput_set_available_formats(private_voutput->wl_voutput, &array);
- wl_array_release(&array);
-}
-
-void
_tdm_client_voutput_send_available_modes(tdm_private_client_voutput *private_voutput)
{
tdm_client_output_mode *modes, *mode;
private_output->connection = TDM_OUTPUT_CONN_STATUS_CONNECTED;
_tdm_client_voutput_send_available_modes(private_voutput);
- _tdm_client_voutput_send_available_formats(private_voutput);
wl_tdm_voutput_set_physical_size(private_voutput->wl_voutput, private_voutput->mmwidth, private_voutput->mmheight);