mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
appsrc: signal enough-data even when leaking
this is convenient for application that wish to monitor whether the appsrc is leaking. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1193>
This commit is contained in:
parent
ed6c970d9c
commit
d1fa109083
1 changed files with 21 additions and 18 deletions
|
@ -2500,6 +2500,27 @@ gst_app_src_push_internal (GstAppSrc * appsrc, GstBuffer * buffer,
|
||||||
priv->max_buffers, GST_TIME_ARGS (priv->queued_time),
|
priv->max_buffers, GST_TIME_ARGS (priv->queued_time),
|
||||||
GST_TIME_ARGS (priv->max_time));
|
GST_TIME_ARGS (priv->max_time));
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
Callbacks *callbacks = NULL;
|
||||||
|
gboolean emit;
|
||||||
|
|
||||||
|
emit = priv->emit_signals;
|
||||||
|
if (priv->callbacks)
|
||||||
|
callbacks = callbacks_ref (priv->callbacks);
|
||||||
|
/* only signal on the first push */
|
||||||
|
g_mutex_unlock (&priv->mutex);
|
||||||
|
|
||||||
|
if (callbacks && callbacks->callbacks.enough_data)
|
||||||
|
callbacks->callbacks.enough_data (appsrc, callbacks->user_data);
|
||||||
|
else if (emit)
|
||||||
|
g_signal_emit (appsrc, gst_app_src_signals[SIGNAL_ENOUGH_DATA], 0,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
g_clear_pointer (&callbacks, callbacks_unref);
|
||||||
|
|
||||||
|
g_mutex_lock (&priv->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->leaky_type == GST_APP_LEAKY_TYPE_UPSTREAM) {
|
if (priv->leaky_type == GST_APP_LEAKY_TYPE_UPSTREAM) {
|
||||||
priv->need_discont_upstream = TRUE;
|
priv->need_discont_upstream = TRUE;
|
||||||
goto dropped;
|
goto dropped;
|
||||||
|
@ -2538,24 +2559,6 @@ gst_app_src_push_internal (GstAppSrc * appsrc, GstBuffer * buffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
Callbacks *callbacks = NULL;
|
|
||||||
gboolean emit;
|
|
||||||
|
|
||||||
emit = priv->emit_signals;
|
|
||||||
if (priv->callbacks)
|
|
||||||
callbacks = callbacks_ref (priv->callbacks);
|
|
||||||
/* only signal on the first push */
|
|
||||||
g_mutex_unlock (&priv->mutex);
|
|
||||||
|
|
||||||
if (callbacks && callbacks->callbacks.enough_data)
|
|
||||||
callbacks->callbacks.enough_data (appsrc, callbacks->user_data);
|
|
||||||
else if (emit)
|
|
||||||
g_signal_emit (appsrc, gst_app_src_signals[SIGNAL_ENOUGH_DATA], 0,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
g_clear_pointer (&callbacks, callbacks_unref);
|
|
||||||
|
|
||||||
g_mutex_lock (&priv->mutex);
|
|
||||||
/* continue to check for flushing/eos after releasing the lock */
|
/* continue to check for flushing/eos after releasing the lock */
|
||||||
first = FALSE;
|
first = FALSE;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue