mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
gst: pipewireformat: enforce DMA_DRM when possible
with memory:DMABuf, DMA_DRM should be used as 'format'. So only add formats to 'format' if there is no equivalent drm format.
This commit is contained in:
parent
7795e06563
commit
a77c1cbd0b
1 changed files with 10 additions and 6 deletions
|
|
@ -1023,21 +1023,25 @@ handle_dmabuf_prop (const struct spa_pod_prop *prop,
|
||||||
|
|
||||||
for (i = 0; i < n_fmts; i++) {
|
for (i = 0; i < n_fmts; i++) {
|
||||||
for (j = 0; j < n_mods; j++) {
|
for (j = 0; j < n_mods; j++) {
|
||||||
|
gboolean as_drm = FALSE;
|
||||||
const char *fmt_str;
|
const char *fmt_str;
|
||||||
|
|
||||||
if ((mods[j] == DRM_FORMAT_MOD_LINEAR ||
|
|
||||||
mods[j] == DRM_FORMAT_MOD_INVALID) &&
|
|
||||||
(fmt_str = video_id_to_string(id[i])))
|
|
||||||
g_ptr_array_add(fmt_array, g_strdup_printf ("%s", fmt_str));
|
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER_DMA_DRM
|
#ifdef HAVE_GSTREAMER_DMA_DRM
|
||||||
if (mods[j] != DRM_FORMAT_MOD_INVALID) {
|
if (mods[j] != DRM_FORMAT_MOD_INVALID) {
|
||||||
char *drm_str;
|
char *drm_str;
|
||||||
|
|
||||||
if ((drm_str = video_id_to_dma_drm_fourcc(id[i], mods[j])))
|
if ((drm_str = video_id_to_dma_drm_fourcc(id[i], mods[j]))) {
|
||||||
g_ptr_array_add(drm_fmt_array, drm_str);
|
g_ptr_array_add(drm_fmt_array, drm_str);
|
||||||
|
as_drm = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!as_drm &&
|
||||||
|
(mods[j] == DRM_FORMAT_MOD_LINEAR ||
|
||||||
|
mods[j] == DRM_FORMAT_MOD_INVALID) &&
|
||||||
|
(fmt_str = video_id_to_string(id[i])))
|
||||||
|
g_ptr_array_add(fmt_array, g_strdup_printf ("%s", fmt_str));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue