decodebin3: Cleanup no more used MultiQueueSlot

Since MultiQueueSlot cannot be removed inside of streaming thread,
use gst_element_call_async() API.

https://bugzilla.gnome.org/show_bug.cgi?id=773341
This commit is contained in:
Seungha Yang 2016-12-03 21:50:47 +09:00 committed by Edward Hervey
parent 4fcbcf4e48
commit bd6ec225b9

View file

@ -502,6 +502,8 @@ static MultiQueueSlot *get_slot_for_input (GstDecodebin3 * dbin,
static void link_input_to_slot (DecodebinInputStream * input, static void link_input_to_slot (DecodebinInputStream * input,
MultiQueueSlot * slot); MultiQueueSlot * slot);
static void free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot); static void free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot);
static void free_multiqueue_slot_async (GstDecodebin3 * dbin,
MultiQueueSlot * slot);
/* FIXME: Really make all the parser stuff a self-contained helper object */ /* FIXME: Really make all the parser stuff a self-contained helper object */
#include "gstdecodebin3-parse.c" #include "gstdecodebin3-parse.c"
@ -1514,6 +1516,8 @@ multiqueue_src_probe (GstPad * pad, GstPadProbeInfo * info,
dbin->output_streams = g_list_remove (dbin->output_streams, output); dbin->output_streams = g_list_remove (dbin->output_streams, output);
free_output_stream (dbin, output); free_output_stream (dbin, output);
} }
dbin->slots = g_list_remove (dbin->slots, slot);
free_multiqueue_slot_async (dbin, slot);
SELECTION_UNLOCK (dbin); SELECTION_UNLOCK (dbin);
ret = GST_PAD_PROBE_HANDLED; ret = GST_PAD_PROBE_HANDLED;
} }
@ -1532,6 +1536,8 @@ multiqueue_src_probe (GstPad * pad, GstPadProbeInfo * info,
g_list_remove (dbin->output_streams, output); g_list_remove (dbin->output_streams, output);
free_output_stream (dbin, output); free_output_stream (dbin, output);
} }
dbin->slots = g_list_remove (dbin->slots, slot);
free_multiqueue_slot_async (dbin, slot);
} }
SELECTION_UNLOCK (dbin); SELECTION_UNLOCK (dbin);
ret = GST_PAD_PROBE_DROP; ret = GST_PAD_PROBE_DROP;
@ -2400,6 +2406,14 @@ free_multiqueue_slot (GstDecodebin3 * dbin, MultiQueueSlot * slot)
g_free (slot); g_free (slot);
} }
static void
free_multiqueue_slot_async (GstDecodebin3 * dbin, MultiQueueSlot * slot)
{
GST_LOG_OBJECT (dbin, "pushing multiqueue slot on thread pool to free");
gst_element_call_async (GST_ELEMENT_CAST (dbin),
(GstElementCallAsyncFunc) free_multiqueue_slot, slot, NULL);
}
/* Create a DecodebinOutputStream for a given type /* Create a DecodebinOutputStream for a given type
* Note: It will be empty initially, it needs to be configured * Note: It will be empty initially, it needs to be configured
* afterwards */ * afterwards */