Is there a clever way to know if a GstQueue is half full? (I can't use
Ideally I would like to have a "halffull" signal similar to how there is a
I might be able to play around with the threshold but that would introduce
My current plan is to call the "current-level-bytes" property from a timer
that runs often.
I haven't got it working yet but it's obviously not the most elegant
Is there a user callback that can be invoked everytime there is new
data/buffer pushed into the queue? That way I could read the amount of data
there. Maybe on the queue pad?
My application is pretty straight forward, it streams data from a cam to
YouTube. I have a leaky Queue that will signal when the buffer is overrun
and I will then lower the bitrate/resolution. Getting a half full event
would make the rate controller even better.
You can just add a pad probe to the queue's sink pad that triggers every time
a buffer passes into the queue. Within the callback, you can check
current-level-bytes and current-level-buffers and go from there.
// Callback function
static GstPadProbeReturn check_queue_levels_cb(GstPad* pad, GstPadProbeInfo
*info, gpointer data)
// Do stuff
// Link callback to queue pad
GstPad* queue_sink_pad = gst_element_get_static_pad(queue_element, "sink");
check_queue_levels_cb, userdata, NULL);