summaryrefslogtreecommitdiffstats
path: root/patches/gst-plugins-good-0.10.23/0002-gstv4l2sink-destroy-open-buffers-when-changing-to-NU.patch
blob: b4b08f7bfe0ec3cc2704093cf049b511f385468f (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
From 49e64005c4ed0a09ccf9ccb2b0e7521e64d21efd Mon Sep 17 00:00:00 2001
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
Date: Wed, 23 Jun 2010 11:47:43 +0200
Subject: [PATCH 2/2] [gstv4l2sink] destroy open buffers when changing to NULL

In the case we change the State from READY_TO_NULL the open buffers
still hold a open dup filedescriptor to the device, therefor the device
release function will not be called and the device probably answer with
-EBUSY when we reopen it at transition NULL_TO_READY.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 sys/v4l2/gstv4l2sink.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

Index: gst-plugins-good-0.10.23/sys/v4l2/gstv4l2sink.c
===================================================================
--- gst-plugins-good-0.10.23.orig/sys/v4l2/gstv4l2sink.c	2010-06-23 17:36:47.000000000 +0200
+++ gst-plugins-good-0.10.23/sys/v4l2/gstv4l2sink.c	2010-06-23 17:36:55.000000000 +0200
@@ -461,6 +461,8 @@
       }
       break;
     case GST_STATE_CHANGE_READY_TO_NULL:
+      gst_v4l2_buffer_pool_destroy(v4l2sink->pool);
+		v4l2sink->pool=NULL;
       /* close the device */
       if (!gst_v4l2_object_stop (v4l2sink->v4l2object))
         return GST_STATE_CHANGE_FAILURE;
@@ -557,13 +559,7 @@
   }
 
   if (v4l2sink->pool) {
-    /* TODO: if we've already allocated buffers, we probably need to
-     * do something here to free and reallocate....
-     *
-     *   gst_v4l2_object_stop_streaming()
-     *   gst_v4l2_buffer_pool_destroy()
-     *
-     */
+     gst_v4l2_object_stop_streaming(v4l2sink->v4l2object);
     GST_DEBUG_OBJECT (v4l2sink, "warning, changing caps not supported yet");
     return FALSE;
   }