summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorRavi Kiran K N <ravi.kiran@samsung.com>2014-09-02 13:52:43 +0530
committerSebastian Dröge <sebastian@centricular.com>2014-09-04 12:52:19 +0300
commit729c914ca3d396c18ea52fbb9c1070dfbf43ec51 (patch)
tree8494ea2752e024b2b89d81d84a346d01de75d9dd /gst
parent2164b8471edc66f17650acf8846ed5f39c6c8ebc (diff)
smpte: Check if input caps are the same and create output caps from video info
This makes sure that also properties like the pixel-aspect-ratio are the same between both streams and that the output caps contain all fields necessary for complete video caps. https://bugzilla.gnome.org/show_bug.cgi?id=735804
Diffstat (limited to 'gst')
-rw-r--r--gst/smpte/gstsmpte.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c
index 8bc0d2619..a423b8085 100644
--- a/gst/smpte/gstsmpte.c
+++ b/gst/smpte/gstsmpte.c
@@ -507,10 +507,7 @@ gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte)
gst_buffer_unmap (in2, &map);
}
- if (GST_VIDEO_INFO_WIDTH (&smpte->vinfo1) !=
- GST_VIDEO_INFO_WIDTH (&smpte->vinfo2) ||
- GST_VIDEO_INFO_HEIGHT (&smpte->vinfo1) !=
- GST_VIDEO_INFO_HEIGHT (&smpte->vinfo2))
+ if (!gst_video_info_is_equal (&smpte->vinfo1, &smpte->vinfo2))
goto input_formats_do_not_match;
if (smpte->position < smpte->end_position) {
@@ -521,12 +518,7 @@ gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte)
GstCaps *caps;
GstSegment segment;
- caps =
- gst_caps_make_writable (gst_static_caps_get
- (&gst_smpte_src_template.static_caps));
- gst_caps_set_simple (caps, "width", G_TYPE_INT, smpte->width, "height",
- G_TYPE_INT, smpte->height, "framerate", GST_TYPE_FRACTION,
- smpte->fps_num, smpte->fps_denom, NULL);
+ caps = gst_video_info_to_caps (&smpte->vinfo1);
gst_pad_set_caps (smpte->srcpad, caps);
gst_caps_unref (caps);