From 6aba832e7f7b66b92c008d3d15c052818b5d5d72 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Sun, 22 Nov 2009 22:31:38 +0100 Subject: [PATCH] vdpau: fix gst_vdp_[video|yuv]_to_output_caps to also add rgb caps --- sys/vdpau/gstvdputils.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/vdpau/gstvdputils.c b/sys/vdpau/gstvdputils.c index 5fb8f50299..21c5cc2a43 100644 --- a/sys/vdpau/gstvdputils.c +++ b/sys/vdpau/gstvdputils.c @@ -29,11 +29,18 @@ gst_vdp_yuv_to_output_caps (GstCaps * caps) gint i; result = gst_caps_copy (caps); - for (i = 0; i < gst_caps_get_size (result); i++) { - GstStructure *structure = gst_caps_get_structure (result, i); + for (i = 0; i < gst_caps_get_size (caps); 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_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; @@ -46,10 +53,14 @@ gst_vdp_video_to_output_caps (GstCaps * caps) gint i; result = gst_caps_copy (caps); - for (i = 0; i < gst_caps_get_size (result); i++) { - GstStructure *structure = gst_caps_get_structure (result, i); + for (i = 0; i < gst_caps_get_size (caps); i++) { + + GstStructure *structure, *rgb_structure; 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_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_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;