summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2013-08-20 16:01:47 +0200
committerEdward Hervey <edward@collabora.com>2013-08-20 16:02:59 +0200
commit7667b7920547166e2a1a9b835cae4e96c74ef3ba (patch)
treea7d853c919b2f1688ecfce1805d0bbd7d0e381f1
parentf0eda4b54c4d9d11b3826c921f11251e30633474 (diff)
ivtc: Use input framerate when possible
if input is 30000/1001 ... use 24000/1001 as the output fixated framerate
-rw-r--r--gst/ivtc/gstivtc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gst/ivtc/gstivtc.c b/gst/ivtc/gstivtc.c
index 13f3c622f..02f382bd5 100644
--- a/gst/ivtc/gstivtc.c
+++ b/gst/ivtc/gstivtc.c
@@ -201,7 +201,20 @@ gst_ivtc_fixate_caps (GstBaseTransform * trans, GstPadDirection direction,
result = gst_caps_make_writable (othercaps);
if (direction == GST_PAD_SINK) {
- gst_caps_set_simple (result, "framerate", GST_TYPE_FRACTION, 24, 1, NULL);
+ 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);