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

@ -257,6 +257,21 @@ gst_pulsevideo_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
g_mutex_unlock (&pvsink->lock);
pv_stream_start (pvsink->stream, format, PV_STREAM_MODE_BUFFER);
g_mutex_lock (&pvsink->lock);
while (TRUE) {
PvStreamState state = pv_stream_get_state (pvsink->stream);
if (state == PV_STREAM_STATE_STREAMING)
break;
if (state == PV_STREAM_STATE_ERROR)
goto connect_error;
g_cond_wait (&pvsink->cond, &pvsink->lock);
}
g_mutex_unlock (&pvsink->lock);
pvsink->negotiated = TRUE;
return TRUE;