[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-cvs
Subject:    [gst-cvs] gst-plugins-bad: camerabin: Set camerasrc to READY state
From:       ensonic () kemper ! freedesktop ! org (Stefan Kost)
Date:       2009-07-31 13:15:11
Message-ID: 20090731131511.56A6E10051 () kemper ! freedesktop ! org
[Download RAW message or body]

Module: gst-plugins-bad
Branch: master
Commit: 89788ddc1f4caa951880ac0402499fb62690f980
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=89788ddc1f4caa951880ac0402499fb62690f980


Author: Tommi Myöhänen <ext-tommi.1.myohanen@nokia.com>
Date:   Thu Jul 30 14:17:59 2009 +0300

camerabin: Set camerasrc to READY state instead of PAUSED when acquiring allowed caps

---

 gst/camerabin/gstcamerabin.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c
index c64db54..c3010ab 100644
--- a/gst/camerabin/gstcamerabin.c
+++ b/gst/camerabin/gstcamerabin.c
@@ -1095,7 +1095,6 @@ gst_camerabin_get_allowed_input_caps (GstCameraBin * camera)
   GstCaps *caps = NULL;
   GstPad *pad = NULL, *peer_pad = NULL;
   GstState state;
-  gboolean temp_videosrc_pause = FALSE;
   GstElement *videosrc;
 
   g_return_val_if_fail (camera != NULL, NULL);
@@ -1121,27 +1120,25 @@ gst_camerabin_get_allowed_input_caps (GstCameraBin * camera)
 
   state = GST_STATE (videosrc);
 
-  /* Make this function work also in READY and NULL state */
-  if (state == GST_STATE_READY || state == GST_STATE_NULL) {
-    GST_DEBUG_OBJECT (camera, "setting videosrc to paused temporarily");
-    temp_videosrc_pause = TRUE;
+  /* Make this function work also in NULL state */
+  if (state == GST_STATE_NULL) {
+    GST_DEBUG_OBJECT (camera, "setting videosrc to ready temporarily");
     peer_pad = gst_pad_get_peer (pad);
     if (peer_pad) {
       gst_pad_unlink (pad, peer_pad);
     }
-    /* Set videosrc to PAUSED to open video device */
+    /* Set videosrc to READY to open video device */
     gst_element_set_locked_state (videosrc, TRUE);
-    gst_element_set_state (videosrc, GST_STATE_PAUSED);
+    gst_element_set_state (videosrc, GST_STATE_READY);
   }
 
   camera->allowed_caps = gst_pad_get_caps (pad);
 
   /* Restore state and re-link if necessary */
-  if (temp_videosrc_pause) {
+  if (state == GST_STATE_NULL) {
     GST_DEBUG_OBJECT (camera, "restoring videosrc state %d", state);
     /* Reset videosrc to NULL state, some drivers seem to need this */
     gst_element_set_state (videosrc, GST_STATE_NULL);
-    gst_element_set_state (videosrc, state);
     if (peer_pad) {
       gst_pad_link (pad, peer_pad);
       gst_object_unref (peer_pad);



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
gstreamer-cvs mailing list
gstreamer-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic