screen-cast-stream-src: Minor adjustment

This change makes it easier to add/remove stream params during test/dev.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2775>
This commit is contained in:
Salman 2023-02-03 19:18:47 +00:00 committed by Marge Bot
parent 43cee4b6b6
commit 6223742996

View File

@ -837,6 +837,7 @@ on_stream_param_changed (void *data,
int32_t width, height, stride, size; int32_t width, height, stride, size;
struct spa_pod_builder pod_builder; struct spa_pod_builder pod_builder;
const struct spa_pod *params[4]; const struct spa_pod *params[4];
int n_params = 0;
const int bpp = 4; const int bpp = 4;
int buffer_types; int buffer_types;
@ -859,7 +860,7 @@ on_stream_param_changed (void *data,
if (spa_pod_find_prop (format, NULL, SPA_FORMAT_VIDEO_modifier)) if (spa_pod_find_prop (format, NULL, SPA_FORMAT_VIDEO_modifier))
buffer_types |= 1 << SPA_DATA_DmaBuf; buffer_types |= 1 << SPA_DATA_DmaBuf;
params[0] = spa_pod_builder_add_object ( params[n_params++] = spa_pod_builder_add_object (
&pod_builder, &pod_builder,
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int (16, 2, 16), SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int (16, 2, 16),
@ -869,19 +870,19 @@ on_stream_param_changed (void *data,
SPA_PARAM_BUFFERS_align, SPA_POD_Int (16), SPA_PARAM_BUFFERS_align, SPA_POD_Int (16),
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int (buffer_types)); SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int (buffer_types));
params[1] = spa_pod_builder_add_object ( params[n_params++] = spa_pod_builder_add_object (
&pod_builder, &pod_builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop),
SPA_PARAM_META_size, SPA_POD_Int (sizeof (struct spa_meta_region))); SPA_PARAM_META_size, SPA_POD_Int (sizeof (struct spa_meta_region)));
params[2] = spa_pod_builder_add_object ( params[n_params++] = spa_pod_builder_add_object (
&pod_builder, &pod_builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id (SPA_META_Cursor), SPA_PARAM_META_type, SPA_POD_Id (SPA_META_Cursor),
SPA_PARAM_META_size, SPA_POD_Int (CURSOR_META_SIZE (384, 384))); SPA_PARAM_META_size, SPA_POD_Int (CURSOR_META_SIZE (384, 384)));
params[3] = spa_pod_builder_add_object ( params[n_params++] = spa_pod_builder_add_object (
&pod_builder, &pod_builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id (SPA_META_Header), SPA_PARAM_META_type, SPA_POD_Id (SPA_META_Header),