mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-04 06:46:24 -04:00
Reapply "libcamera: Implement proper dmabuf negotiation support"
In order to allow clients to explicitely ask for DMABUFs. This allows the following GST pipeline to have Wayland passthrough (and thus possibly offloading to display hardware): gst-launch-1.0 pipewiresrc ! gtk4paintablesink This reapplies commit950b62a8d8This reverts commitbdc0720bcb.
This commit is contained in:
parent
0c07c78621
commit
b50e6933b7
1 changed files with 52 additions and 42 deletions
|
|
@ -304,6 +304,10 @@ next_fmt:
|
||||||
}
|
}
|
||||||
port->size_index++;
|
port->size_index++;
|
||||||
|
|
||||||
|
for (i = 0; i < 2; i++) {
|
||||||
|
if (i > 0)
|
||||||
|
result.index = result.next++;
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
spa_pod_builder_push_object(&b, &f[0], SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
spa_pod_builder_push_object(&b, &f[0], SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);
|
||||||
spa_pod_builder_add(&b,
|
spa_pod_builder_add(&b,
|
||||||
|
|
@ -315,12 +319,13 @@ next_fmt:
|
||||||
spa_pod_builder_prop(&b, SPA_FORMAT_VIDEO_format, 0);
|
spa_pod_builder_prop(&b, SPA_FORMAT_VIDEO_format, 0);
|
||||||
spa_pod_builder_id(&b, info->format);
|
spa_pod_builder_id(&b, info->format);
|
||||||
}
|
}
|
||||||
if (info->pix.modifier()) {
|
|
||||||
spa_pod_builder_prop(&b, SPA_FORMAT_VIDEO_modifier, 0);
|
if (i == 0) {
|
||||||
|
spa_pod_builder_prop(&b, SPA_FORMAT_VIDEO_modifier, SPA_POD_PROP_FLAG_MANDATORY);
|
||||||
spa_pod_builder_long(&b, info->pix.modifier());
|
spa_pod_builder_long(&b, info->pix.modifier());
|
||||||
}
|
}
|
||||||
spa_pod_builder_prop(&b, SPA_FORMAT_VIDEO_size, 0);
|
|
||||||
|
|
||||||
|
spa_pod_builder_prop(&b, SPA_FORMAT_VIDEO_size, 0);
|
||||||
if (sizeRange.hStep != 0 && sizeRange.vStep != 0) {
|
if (sizeRange.hStep != 0 && sizeRange.vStep != 0) {
|
||||||
spa_pod_builder_push_choice(&b, &f[1], SPA_CHOICE_Step, 0);
|
spa_pod_builder_push_choice(&b, &f[1], SPA_CHOICE_Step, 0);
|
||||||
spa_pod_builder_frame(&b, &f[1]);
|
spa_pod_builder_frame(&b, &f[1]);
|
||||||
|
|
@ -344,10 +349,15 @@ next_fmt:
|
||||||
|
|
||||||
fmt = (struct spa_pod*) spa_pod_builder_pop(&b, &f[0]);
|
fmt = (struct spa_pod*) spa_pod_builder_pop(&b, &f[0]);
|
||||||
|
|
||||||
if (spa_pod_filter(&b, &result.param, fmt, filter) < 0)
|
if (spa_pod_filter(&b, &result.param, fmt, filter) < 0) {
|
||||||
|
if (i == 0)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
goto next;
|
goto next;
|
||||||
|
}
|
||||||
|
|
||||||
spa_node_emit_result(&impl->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result);
|
spa_node_emit_result(&impl->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result);
|
||||||
|
}
|
||||||
|
|
||||||
if (++count != num)
|
if (++count != num)
|
||||||
goto next;
|
goto next;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue