v4l2sink: fix for PAUSED->READY->PAUSED state transitions
authorRob Clark <rob@ti.com>
Sat, 25 Dec 2010 17:52:36 +0000 (11:52 -0600)
committerRob Clark <rob@ti.com>
Wed, 29 Dec 2010 17:46:41 +0000 (11:46 -0600)
When v4l2sink goes to PAUSED->READY it only stops streaming, so the state
should be set to STATE_PENDING_STREAMON in case the element transitions
back to PLAYING.

sys/v4l2/gstv4l2sink.c

index 46c66ad..703c304 100644 (file)
@@ -472,7 +472,7 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
         if (!gst_v4l2_object_stop_streaming (v4l2sink->v4l2object)) {
           return GST_STATE_CHANGE_FAILURE;
         }
-        v4l2sink->state = STATE_OFF;
+        v4l2sink->state = STATE_PENDING_STREAMON;
       }
       break;
     case GST_STATE_CHANGE_READY_TO_NULL:
@@ -482,6 +482,7 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
       /* close the device */
       if (!gst_v4l2_object_stop (v4l2sink->v4l2object))
         return GST_STATE_CHANGE_FAILURE;
+      v4l2sink->state = STATE_OFF;
       break;
     default:
       break;