diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2010-07-30 14:47:43 +0200 |
---|---|---|
committer | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2010-07-30 14:47:43 +0200 |
commit | 2282e9f5df4bf4c363d98287b79e24d42535879a (patch) | |
tree | bb929ff90d34a1ebf4425f17d7ecf7cbe20986d9 /sys | |
parent | 472cdc4c6166962ccf76f4c7b808df3134145241 (diff) | |
download | gstreamer-plugins-bad-2282e9f5df4bf4c363d98287b79e24d42535879a.tar.gz |
vdpau: use gst_vdp_yuv_to_video_caps in GstVdpVideoSrcPad to transform set caps
this way we'll keep other all other fields in the caps which we didn't take in
account when we manually created the "video/x-vdpau-video" caps
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vdpau/gstvdp/gstvdpvideosrcpad.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/vdpau/gstvdp/gstvdpvideosrcpad.c b/sys/vdpau/gstvdp/gstvdpvideosrcpad.c index 6c8a88368..3ce0ca4a4 100644 --- a/sys/vdpau/gstvdp/gstvdpvideosrcpad.c +++ b/sys/vdpau/gstvdp/gstvdpvideosrcpad.c @@ -20,6 +20,7 @@ #include "gstvdpvideobuffer.h" #include "gstvdpvideobufferpool.h" +#include "gstvdputils.h" #include "gstvdpvideosrcpad.h" @@ -162,7 +163,6 @@ gst_vdp_video_src_pad_setcaps (GstPad * pad, GstCaps * caps) GstVdpVideoSrcPad *vdp_pad = GST_VDP_VIDEO_SRC_PAD (pad); const GstStructure *structure; - VdpChromaType chroma_type; GstCaps *video_caps; structure = gst_caps_get_structure (caps, 0); @@ -174,27 +174,21 @@ gst_vdp_video_src_pad_setcaps (GstPad * pad, GstCaps * caps) if (!gst_structure_get_fourcc (structure, "format", &vdp_pad->fourcc)) return FALSE; - chroma_type = VDP_CHROMA_TYPE_420; - + video_caps = gst_vdp_yuv_to_video_caps (caps); vdp_pad->yuv_output = TRUE; } else if (gst_structure_has_name (structure, "video/x-vdpau-video")) { if (!gst_structure_get_int (structure, "width", &vdp_pad->width)) return FALSE; if (!gst_structure_get_int (structure, "height", &vdp_pad->height)) return FALSE; - if (!gst_structure_get_int (structure, "chroma-type", - (gint *) & chroma_type)) - return FALSE; + video_caps = gst_caps_ref (caps); vdp_pad->yuv_output = FALSE; } else return FALSE; - video_caps = gst_caps_new_simple ("video/x-vdpau-video", - "chroma-type", G_TYPE_INT, (gint) chroma_type, - "width", G_TYPE_INT, vdp_pad->width, - "height", G_TYPE_INT, vdp_pad->height, NULL); gst_vdp_buffer_pool_set_caps (vdp_pad->bpool, video_caps); + gst_caps_unref (video_caps); return TRUE; } |