Fix client-source negotiation and states

Avoid buffers without data.

Handle stream state changes in gstpvsrc and gstpvsink

Implement capabilities in v4l2 source
This commit is contained in:
Wim Taymans 2015-05-15 15:58:13 +02:00
parent cbe7b52a70
commit 31cc37b6a5
5 changed files with 99 additions and 32 deletions

View file

@ -368,8 +368,16 @@ gst_pulsevideo_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
goto not_negotiated;
g_mutex_lock (&pvsrc->lock);
g_cond_wait (&pvsrc->cond, &pvsrc->lock);
pv_stream_capture_buffer (pvsrc->stream, &info);
while (TRUE) {
g_cond_wait (&pvsrc->cond, &pvsrc->lock);
if (pv_stream_get_state (pvsrc->stream) != PV_STREAM_STATE_STREAMING)
goto streaming_stopped;
pv_stream_capture_buffer (pvsrc->stream, &info);
if (info.message != NULL)
break;
}
g_mutex_unlock (&pvsrc->lock);
*buffer = gst_buffer_new ();
@ -393,6 +401,11 @@ not_negotiated:
{
return GST_FLOW_NOT_NEGOTIATED;
}
streaming_stopped:
{
g_mutex_unlock (&pvsrc->lock);
return GST_FLOW_FLUSHING;
}
}
static gboolean