To act like a real live element, block the streaming when paused, and
return NO_PREROLL.
https://bugzilla.gnome.org/show_bug.cgi?id=601853
identity = GST_IDENTITY (object);
g_free (identity->last_message);
identity = GST_IDENTITY (object);
g_free (identity->last_message);
+ g_cond_clear (&identity->blocked_cond);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
identity->dump = DEFAULT_DUMP;
identity->last_message = NULL;
identity->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
identity->dump = DEFAULT_DUMP;
identity->last_message = NULL;
identity->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
+ g_cond_init (&identity->blocked_cond);
gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM_CAST (identity), TRUE);
}
gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM_CAST (identity), TRUE);
}
GstClock *clock;
GST_OBJECT_LOCK (identity);
GstClock *clock;
GST_OBJECT_LOCK (identity);
+
+ while (identity->blocked)
+ g_cond_wait (&identity->blocked_cond, GST_OBJECT_GET_LOCK (identity));
+
+
if ((clock = GST_ELEMENT (identity)->clock)) {
GstClockReturn cret;
GstClockTime timestamp;
if ((clock = GST_ELEMENT (identity)->clock)) {
GstClockReturn cret;
GstClockTime timestamp;
{
GstStateChangeReturn ret;
GstIdentity *identity = GST_IDENTITY (element);
{
GstStateChangeReturn ret;
GstIdentity *identity = GST_IDENTITY (element);
+ gboolean no_preroll = FALSE;
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
+ GST_OBJECT_LOCK (identity);
+ identity->blocked = TRUE;
+ GST_OBJECT_UNLOCK (identity);
+ if (identity->sync)
+ no_preroll = TRUE;
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+ GST_OBJECT_LOCK (identity);
+ identity->blocked = FALSE;
+ g_cond_broadcast (&identity->blocked_cond);
+ GST_OBJECT_UNLOCK (identity);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_OBJECT_LOCK (identity);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_OBJECT_LOCK (identity);
gst_clock_id_unref (identity->clock_id);
identity->clock_id = NULL;
}
gst_clock_id_unref (identity->clock_id);
identity->clock_id = NULL;
}
+ identity->blocked = FALSE;
+ g_cond_broadcast (&identity->blocked_cond);
GST_OBJECT_UNLOCK (identity);
break;
default:
GST_OBJECT_UNLOCK (identity);
break;
default:
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
GST_OBJECT_LOCK (identity);
identity->upstream_latency = 0;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
GST_OBJECT_LOCK (identity);
identity->upstream_latency = 0;
+ identity->blocked = TRUE;
GST_OBJECT_UNLOCK (identity);
GST_OBJECT_UNLOCK (identity);
+ if (identity->sync)
+ no_preroll = TRUE;
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
break;
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
break;
+ if (no_preroll && ret == GST_STATE_CHANGE_SUCCESS)
+ ret = GST_STATE_CHANGE_NO_PREROLL;
+
guint64 offset;
gboolean signal_handoffs;
GstClockTime upstream_latency;
guint64 offset;
gboolean signal_handoffs;
GstClockTime upstream_latency;
+ GCond blocked_cond;
+ gboolean blocked;
};
struct _GstIdentityClass {
};
struct _GstIdentityClass {