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 | |
parent | 472cdc4c6166962ccf76f4c7b808df3134145241 (diff) |
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
-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 @@ | |||
20 | 20 | ||
21 | #include "gstvdpvideobuffer.h" | 21 | #include "gstvdpvideobuffer.h" |
22 | #include "gstvdpvideobufferpool.h" | 22 | #include "gstvdpvideobufferpool.h" |
23 | #include "gstvdputils.h" | ||
23 | 24 | ||
24 | #include "gstvdpvideosrcpad.h" | 25 | #include "gstvdpvideosrcpad.h" |
25 | 26 | ||
@@ -162,7 +163,6 @@ gst_vdp_video_src_pad_setcaps (GstPad * pad, GstCaps * caps) | |||
162 | GstVdpVideoSrcPad *vdp_pad = GST_VDP_VIDEO_SRC_PAD (pad); | 163 | GstVdpVideoSrcPad *vdp_pad = GST_VDP_VIDEO_SRC_PAD (pad); |
163 | const GstStructure *structure; | 164 | const GstStructure *structure; |
164 | 165 | ||
165 | VdpChromaType chroma_type; | ||
166 | GstCaps *video_caps; | 166 | GstCaps *video_caps; |
167 | 167 | ||
168 | structure = gst_caps_get_structure (caps, 0); | 168 | structure = gst_caps_get_structure (caps, 0); |
@@ -174,27 +174,21 @@ gst_vdp_video_src_pad_setcaps (GstPad * pad, GstCaps * caps) | |||
174 | if (!gst_structure_get_fourcc (structure, "format", &vdp_pad->fourcc)) | 174 | if (!gst_structure_get_fourcc (structure, "format", &vdp_pad->fourcc)) |
175 | return FALSE; | 175 | return FALSE; |
176 | 176 | ||
177 | chroma_type = VDP_CHROMA_TYPE_420; | 177 | video_caps = gst_vdp_yuv_to_video_caps (caps); |
178 | |||
179 | vdp_pad->yuv_output = TRUE; | 178 | vdp_pad->yuv_output = TRUE; |
180 | } else if (gst_structure_has_name (structure, "video/x-vdpau-video")) { | 179 | } else if (gst_structure_has_name (structure, "video/x-vdpau-video")) { |
181 | if (!gst_structure_get_int (structure, "width", &vdp_pad->width)) | 180 | if (!gst_structure_get_int (structure, "width", &vdp_pad->width)) |
182 | return FALSE; | 181 | return FALSE; |
183 | if (!gst_structure_get_int (structure, "height", &vdp_pad->height)) | 182 | if (!gst_structure_get_int (structure, "height", &vdp_pad->height)) |
184 | return FALSE; | 183 | return FALSE; |
185 | if (!gst_structure_get_int (structure, "chroma-type", | ||
186 | (gint *) & chroma_type)) | ||
187 | return FALSE; | ||
188 | 184 | ||
185 | video_caps = gst_caps_ref (caps); | ||
189 | vdp_pad->yuv_output = FALSE; | 186 | vdp_pad->yuv_output = FALSE; |
190 | } else | 187 | } else |
191 | return FALSE; | 188 | return FALSE; |
192 | 189 | ||
193 | video_caps = gst_caps_new_simple ("video/x-vdpau-video", | ||
194 | "chroma-type", G_TYPE_INT, (gint) chroma_type, | ||
195 | "width", G_TYPE_INT, vdp_pad->width, | ||
196 | "height", G_TYPE_INT, vdp_pad->height, NULL); | ||
197 | gst_vdp_buffer_pool_set_caps (vdp_pad->bpool, video_caps); | 190 | gst_vdp_buffer_pool_set_caps (vdp_pad->bpool, video_caps); |
191 | gst_caps_unref (video_caps); | ||
198 | 192 | ||
199 | return TRUE; | 193 | return TRUE; |
200 | } | 194 | } |