mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
rtpmux: Refactor the event handler function
20070321163311-65035-987e7f25d1ab5335b79f44b277abf15e4e37d317.gz
This commit is contained in:
parent
db1523ae60
commit
5483c78ac0
1 changed files with 46 additions and 37 deletions
|
@ -156,28 +156,13 @@ gst_rtp_dtmf_mux_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event)
|
gst_rtp_dtmf_mux_stream_lock_event_handler (GstRTPDTMFMux *mux, GstPad * pad,
|
||||||
|
const GstStructure * event_structure)
|
||||||
{
|
{
|
||||||
GstRTPDTMFMux *mux;
|
|
||||||
GstEventType type;
|
|
||||||
gboolean ret = FALSE;
|
|
||||||
|
|
||||||
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
|
||||||
|
|
||||||
mux = (GstRTPDTMFMux *) gst_pad_get_parent (pad);
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
|
|
||||||
{
|
|
||||||
const GstStructure *structure;
|
|
||||||
|
|
||||||
structure = gst_event_get_structure (event);
|
|
||||||
/* FIXME: is this event generic enough to be given a generic name? */
|
|
||||||
if (structure && gst_structure_has_name (structure, "stream-lock")) {
|
|
||||||
gboolean lock;
|
gboolean lock;
|
||||||
|
|
||||||
if (!gst_structure_get_boolean (structure, "lock", &lock))
|
if (!gst_structure_get_boolean (event_structure, "lock", &lock))
|
||||||
break;
|
return FALSE;
|
||||||
|
|
||||||
GST_OBJECT_LOCK (mux);
|
GST_OBJECT_LOCK (mux);
|
||||||
if (lock) {
|
if (lock) {
|
||||||
|
@ -211,6 +196,30 @@ gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (mux);
|
GST_OBJECT_UNLOCK (mux);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event)
|
||||||
|
{
|
||||||
|
GstRTPDTMFMux *mux;
|
||||||
|
GstEventType type;
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
||||||
|
|
||||||
|
mux = (GstRTPDTMFMux *) gst_pad_get_parent (pad);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
|
||||||
|
{
|
||||||
|
const GstStructure *structure;
|
||||||
|
|
||||||
|
structure = gst_event_get_structure (event);
|
||||||
|
/* FIXME: is this event generic enough to be given a generic name? */
|
||||||
|
if (structure && gst_structure_has_name (structure, "stream-lock")) {
|
||||||
|
ret = gst_rtp_dtmf_mux_stream_lock_event_handler (mux, pad, structure);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue