decodebin3: Rename multiqueue related functions

To make clear on what they apply
This commit is contained in:
Edward Hervey 2024-03-22 12:01:06 +01:00
parent 21a3c7a4cd
commit 75de416557

View file

@ -161,7 +161,7 @@
* stream is in the REQUESTED selection.
* 2) Deactivating a stream (i.e. unlinking a slot from an output) is also done
* within the stream thread, but only in a purposefully called IDLE probe
* that calls reassign_slot().
* that calls mq_slot_reassign().
*
* Based on those two principles, 3 "selection" of streams (stream-id) are used:
* 1) requested_selection
@ -170,7 +170,7 @@
* List of streams that are exposed by decodebin
* 3) to_activate
* List of streams that will be moved to requested_selection in the
* reassign_slot() method (i.e. once a stream was deactivated, and the output
* mq_slot_reassign() method (i.e. once a stream was deactivated, and the output
* was retargetted)
*/
@ -551,15 +551,15 @@ static void db_output_stream_free (DecodebinOutputStream * output);
static DecodebinOutputStream *db_output_stream_new (GstDecodebin3 * dbin,
GstStreamType type);
static GstPadProbeReturn slot_unassign_probe (GstPad * pad,
static GstPadProbeReturn mq_slot_unassign_probe (GstPad * pad,
GstPadProbeInfo * info, MultiQueueSlot * slot);
static gboolean reassign_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot);
static void mq_slot_reassign (MultiQueueSlot * slot);
static MultiQueueSlot
* gst_decodebin_get_slot_for_input_stream_locked (GstDecodebin3 * dbin,
DecodebinInputStream * input);
static void link_input_to_slot (DecodebinInputStream * input,
MultiQueueSlot * slot);
static void free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot);
static void mq_slot_free (GstDecodebin3 * dbin, MultiQueueSlot * slot);
static GstStreamCollection *get_merged_collection (GstDecodebin3 * dbin);
static void update_requested_selection (GstDecodebin3 * dbin);
@ -702,7 +702,7 @@ gst_decodebin3_reset (GstDecodebin3 * dbin)
/* Free multiqueue slots */
for (tmp = dbin->slots; tmp; tmp = tmp->next) {
MultiQueueSlot *slot = (MultiQueueSlot *) tmp->data;
free_multiqueue_slot (dbin, slot);
mq_slot_free (dbin, slot);
}
g_list_free (dbin->slots);
dbin->slots = NULL;
@ -1416,7 +1416,7 @@ remove_slot_from_streaming_thread (GstDecodebin3 * dbin, MultiQueueSlot * slot)
gst_decodebin3_update_min_interleave (dbin);
gst_element_call_async (GST_ELEMENT_CAST (dbin),
(GstElementCallAsyncFunc) free_multiqueue_slot, slot, NULL);
(GstElementCallAsyncFunc) mq_slot_free, slot, NULL);
}
static void
@ -3227,7 +3227,7 @@ check_slot_reconfiguration (GstDecodebin3 * dbin, MultiQueueSlot * slot)
else
GST_ELEMENT_WARNING (slot->dbin, CORE, MISSING_PLUGIN, (NULL),
("Some plugins were missing"));
reassign_slot (dbin, slot);
mq_slot_reassign (slot);
} else {
GstMessage *selection_msg = is_selection_done (dbin);
SELECTION_UNLOCK (dbin);
@ -3910,9 +3910,10 @@ find_slot_for_stream_id (GstDecodebin3 * dbin, const gchar * sid)
/* This function handles the reassignment of a slot. Call this from
* the streaming thread of a slot. */
static gboolean
reassign_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
static void
mq_slot_reassign (MultiQueueSlot * slot)
{
GstDecodebin3 *dbin = slot->dbin;
DecodebinOutputStream *output;
MultiQueueSlot *target_slot = NULL;
GList *tmp;
@ -3925,14 +3926,14 @@ reassign_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
GST_DEBUG_OBJECT (slot->src_pad,
"Called on inactive slot (active_stream == NULL)");
SELECTION_UNLOCK (dbin);
return FALSE;
return;
}
if (G_UNLIKELY (output == NULL)) {
GST_DEBUG_OBJECT (slot->src_pad,
"Slot doesn't have any output to be removed");
SELECTION_UNLOCK (dbin);
return FALSE;
return;
}
sid = gst_stream_get_stream_id (slot->active_stream);
@ -3944,7 +3945,7 @@ reassign_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
SELECTION_UNLOCK (dbin);
GST_DEBUG_OBJECT (slot->src_pad,
"Stream '%s' doesn't need to be deactivated", sid);
return FALSE;
return;
}
/* Unlink slot from output */
@ -4003,8 +4004,6 @@ reassign_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
if (msg)
gst_element_post_message ((GstElement *) slot->dbin, msg);
}
return TRUE;
}
/* Idle probe called when a slot should be unassigned from its output stream.
@ -4013,12 +4012,10 @@ reassign_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
* Also, this method will search for a pending stream which could re-use
* the output stream. */
static GstPadProbeReturn
slot_unassign_probe (GstPad * pad, GstPadProbeInfo * info,
mq_slot_unassign_probe (GstPad * pad, GstPadProbeInfo * info,
MultiQueueSlot * slot)
{
GstDecodebin3 *dbin = slot->dbin;
reassign_slot (dbin, slot);
mq_slot_reassign (slot);
return GST_PAD_PROBE_REMOVE;
}
@ -4218,7 +4215,7 @@ handle_stream_switch (GstDecodebin3 * dbin, GList * select_streams,
for (tmp = slots_to_reassign; tmp; tmp = tmp->next) {
MultiQueueSlot *slot = (MultiQueueSlot *) tmp->data;
gst_pad_add_probe (slot->src_pad, GST_PAD_PROBE_TYPE_IDLE,
(GstPadProbeCallback) slot_unassign_probe, slot, NULL);
(GstPadProbeCallback) mq_slot_unassign_probe, slot, NULL);
}
if (to_deactivate)
@ -4321,9 +4318,8 @@ gst_decodebin3_send_event (GstElement * element, GstEvent * event)
return GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
}
static void
free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
mq_slot_free (GstDecodebin3 * dbin, MultiQueueSlot * slot)
{
if (slot->probe_id)
gst_pad_remove_probe (slot->src_pad, slot->probe_id);