aboutsummaryrefslogtreecommitdiffstats
path: root/extras/recipes-ti/gstreamer-ti/gstreamer-ti/0003-Support-setting-the-display-framerate-directly-when-.patch
blob: eb7181be64462a35e7c43c696ac049f6e4567a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From fb4dabcac144fcf1a7e9b1eba0114b2eed594d05 Mon Sep 17 00:00:00 2001
From: Don Darling <don.osc2@gmail.com>
Date: Thu, 26 Aug 2010 11:12:39 -0500
Subject: [PATCH 3/8] Support setting the display framerate directly when possible.

If can_set_display_framerate is set to true, TIDmaiVideoSink will attempt to
set the display framerate directly in DMAI, instead of trying to simulate the
desired framerate by occasionally repeating frames.

Platforms that support this will need to enable it explicitly.
---
 .../ticodecplugin/src/gsttidmaivideosink.c         |   24 ++++++++++++++++++++
 .../ticodecplugin/src/gsttidmaivideosink.h         |    1 +
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.c b/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.c
index c87b89c..4e327ae 100644
--- a/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.c
+++ b/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.c
@@ -442,6 +442,7 @@ static void gst_tidmaivideosink_init(GstTIDmaiVideoSink * dmaisink,
     dmaisink->numBufs             = -1;
     dmaisink->framerepeat         = 0;
     dmaisink->repeat_with_refresh = FALSE;
+    dmaisink->can_set_display_framerate = FALSE;
     dmaisink->rotation            = -1;
     dmaisink->tempDmaiBuf         = NULL;
     dmaisink->accelFrameCopy      = TRUE;
@@ -952,6 +953,9 @@ static void gst_tidmaivideosink_check_set_framerate(GstTIDmaiVideoSink * sink)
  *    then 1 is returned to indicate that there will be no frame
  *    repeating.
  *
+ *    If the driver supports explicit configuration of the framerate, we
+ *    don't ever need to repeat frames, and 1 is returned.
+ *
  ******************************************************************************/
 static int gst_tidmaivideosink_get_framerepeat(GstTIDmaiVideoSink * sink)
 {
@@ -959,6 +963,13 @@ static int gst_tidmaivideosink_get_framerepeat(GstTIDmaiVideoSink * sink)
 
     GST_DEBUG("Begin\n");
 
+    /* If the display allows you to configure the frame rate, we never need
+     * to repeat a frame.
+     */
+    if (sink->can_set_display_framerate) {
+        return 1;
+    }
+
     /* Divide the native framerate by the desired framerate.  If the result
      * is a whole number, return it.  Otherwise return 1 -- we don't support
      * fractional repeat rates. */
@@ -1151,6 +1162,19 @@ static gboolean gst_tidmaivideosink_set_display_attrs(GstTIDmaiVideoSink *sink,
     sink->dAttrs.displayDevice = sink->displayDevice == NULL ?
         sink->dAttrs.displayDevice : sink->displayDevice;
 
+    /* Specify framerate if supported by DMAI and the display driver */
+    if (sink->can_set_display_framerate) {
+        #if defined (Platform_dm365)
+        sink->dAttrs.forceFrameRateNum =
+            gst_value_get_fraction_numerator(&sink->iattrs.framerate);
+        sink->dAttrs.forceFrameRateDen =
+            gst_value_get_fraction_denominator(&sink->iattrs.framerate);
+        #else
+        GST_ERROR("setting driver framerate is not supported\n");
+        return FALSE;
+        #endif
+    }
+
     /* Set rotation on OMAP35xx */
     if (sink->cpu_dev == Cpu_Device_OMAP3530) {
         sink->dAttrs.rotation = sink->rotation == -1 ?
diff --git a/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.h b/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.h
index 5d13e08..4800fcd 100644
--- a/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.h
+++ b/gstreamer_ti/ti_build/ticodecplugin/src/gsttidmaivideosink.h
@@ -124,6 +124,7 @@ struct _GstTIDmaiVideoSink {
    */
   int           framerepeat;
   gboolean      repeat_with_refresh;
+  gboolean      can_set_display_framerate;
   gboolean      signal_handoffs;
 
   /* Hardware accelerated copy */
-- 
1.7.0.4