ivtc: Use input framerate when possible

if input is 30000/1001 ... use 24000/1001 as the output fixated framerate
This commit is contained in:
Edward Hervey 2013-08-20 16:01:47 +02:00
parent f0eda4b54c
commit 7667b79205

View file

@ -201,8 +201,21 @@ gst_ivtc_fixate_caps (GstBaseTransform * trans, GstPadDirection direction,
result = gst_caps_make_writable (othercaps);
if (direction == GST_PAD_SINK) {
GstVideoInfo info;
if (gst_video_info_from_caps (&info, caps)) {
/* Smarter decision */
GST_DEBUG_OBJECT (trans, "Input framerate is %d/%d", info.fps_n,
info.fps_d);
if (info.fps_n == 30000 && info.fps_d == 1001)
gst_caps_set_simple (result, "framerate", GST_TYPE_FRACTION, 24000,
1001, NULL);
else
gst_caps_set_simple (result, "framerate", GST_TYPE_FRACTION, 24, 1,
NULL);
} else {
gst_caps_set_simple (result, "framerate", GST_TYPE_FRACTION, 24, 1, NULL);
}
}
result = gst_caps_fixate (result);