summaryrefslogtreecommitdiff
path: root/gstreamer_ti_dm81xx/opensource_build/patchfiles/gst-plugins-good-0.10.28/0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch
blob: 528e9a6d930846c2c94839c6953feefa4bf4fa05 (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
From 39de525898eea073c1f2486b99b56ef25b6df289 Mon Sep 17 00:00:00 2001
From: Rob Clark <rob@ti.com>
Date: Sun, 4 Apr 2010 06:46:21 -0500
Subject: [PATCH 04/11] v4l2sink: Add support for omap24xxvout driver

---
 sys/v4l2/gstv4l2sink.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
index 6163747..4408428 100644
--- a/sys/v4l2/gstv4l2sink.c
+++ b/sys/v4l2/gstv4l2sink.c
@@ -888,6 +888,18 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
     /* initialize the buffer pool if not initialized yet (first buffer): */
     if (G_UNLIKELY (!v4l2sink->pool)) {
 
+      gboolean no_pending_streamon = FALSE;
+      char *driver = (char *) v4l2sink->v4l2object->vcap.driver;
+
+      /* the omap24xxvout driver wants us to start streaming before we
+       * queue the first buffer:
+       */
+      if (!strcmp ("omap24xxvout", driver)) {
+        GST_DEBUG_OBJECT (v4l2sink,
+            "enabling no_pending_streamon hack for omap24xxvout driver");
+        no_pending_streamon = TRUE;
+      }
+
       /* set_caps() might not be called yet.. so just to make sure: */
       if (!gst_v4l2sink_set_caps (bsink, caps)) {
         return GST_FLOW_ERROR;
@@ -909,7 +921,14 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
       gst_v4l2_xoverlay_prepare_xwindow_id (v4l2sink->v4l2object, TRUE);
 #endif
 
-      v4l2sink->state = STATE_PENDING_STREAMON;
+      if (no_pending_streamon) {
+        if (!gst_v4l2_object_start_streaming (v4l2sink->v4l2object)) {
+          return GST_FLOW_ERROR;
+        }
+        v4l2sink->state = STATE_STREAMING;
+      } else {
+        v4l2sink->state = STATE_PENDING_STREAMON;
+      }
 
       GST_INFO_OBJECT (v4l2sink, "outputting buffers via mmap()");
 
@@ -996,6 +1015,7 @@ gst_v4l2sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
   if (!gst_v4l2_buffer_pool_qbuf (v4l2sink->pool, GST_V4L2_BUFFER (buf))) {
     return GST_FLOW_ERROR;
   }
+
   if (v4l2sink->state == STATE_PENDING_STREAMON) {
     if (!gst_v4l2_object_start_streaming (v4l2sink->v4l2object)) {
       return GST_FLOW_ERROR;
-- 
1.7.0.4