mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
vdpau: fix gst_vdp_[video|yuv]_to_output_caps to also add rgb caps
This commit is contained in:
parent
2d03815e19
commit
6aba832e7f
1 changed files with 19 additions and 4 deletions
|
@ -29,11 +29,18 @@ gst_vdp_yuv_to_output_caps (GstCaps * caps)
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
result = gst_caps_copy (caps);
|
result = gst_caps_copy (caps);
|
||||||
for (i = 0; i < gst_caps_get_size (result); i++) {
|
for (i = 0; i < gst_caps_get_size (caps); i++) {
|
||||||
GstStructure *structure = gst_caps_get_structure (result, i);
|
GstStructure *structure, *rgb_structure;
|
||||||
|
|
||||||
|
structure = gst_caps_get_structure (result, i);
|
||||||
|
rgb_structure = gst_structure_copy (structure);
|
||||||
|
|
||||||
gst_structure_set_name (structure, "video/x-vdpau-output");
|
gst_structure_set_name (structure, "video/x-vdpau-output");
|
||||||
gst_structure_remove_field (structure, "format");
|
gst_structure_remove_field (structure, "format");
|
||||||
|
|
||||||
|
gst_structure_set_name (rgb_structure, "video/x-raw-rgb");
|
||||||
|
gst_structure_remove_field (rgb_structure, "format");
|
||||||
|
gst_caps_append_structure (result, rgb_structure);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -46,10 +53,14 @@ gst_vdp_video_to_output_caps (GstCaps * caps)
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
result = gst_caps_copy (caps);
|
result = gst_caps_copy (caps);
|
||||||
for (i = 0; i < gst_caps_get_size (result); i++) {
|
for (i = 0; i < gst_caps_get_size (caps); i++) {
|
||||||
GstStructure *structure = gst_caps_get_structure (result, i);
|
|
||||||
|
GstStructure *structure, *rgb_structure;
|
||||||
gint par_n, par_d;
|
gint par_n, par_d;
|
||||||
|
|
||||||
|
structure = gst_caps_get_structure (result, i);
|
||||||
|
rgb_structure = gst_structure_copy (structure);
|
||||||
|
|
||||||
gst_structure_set_name (structure, "video/x-vdpau-output");
|
gst_structure_set_name (structure, "video/x-vdpau-output");
|
||||||
gst_structure_remove_field (structure, "chroma-type");
|
gst_structure_remove_field (structure, "chroma-type");
|
||||||
|
|
||||||
|
@ -63,6 +74,10 @@ gst_vdp_video_to_output_caps (GstCaps * caps)
|
||||||
|
|
||||||
gst_structure_remove_field (structure, "pixel-aspect-ratio");
|
gst_structure_remove_field (structure, "pixel-aspect-ratio");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_structure_set_name (rgb_structure, "video/x-raw-rgb");
|
||||||
|
gst_structure_remove_field (rgb_structure, "chroma-type");
|
||||||
|
gst_caps_append_structure (result, rgb_structure);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue