pad: rework probe's hook_marshall function

PUSH and PULL mode have opposite scenarios for IDLE and BLOCK
probes.

For PUSH it will BLOCK with some data type and IDLE won't have a type.
For PULL it will BLOCK before getting some data and will be IDLE when
some data is obtained.

The check in hook_marshall was specific for PUSH mode and would cause
PULL probes to fail to be called. Adding different checks for the mode
to fix this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=761211
This commit is contained in:
Thiago Santos 2016-03-24 17:34:20 -03:00
parent 1967d56aea
commit 368ee8a336

View file

@ -3407,13 +3407,25 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
type = info->type;
original_data = info->data;
/* one of the data types for non-idle probes */
if ((type & GST_PAD_PROBE_TYPE_IDLE) == 0
&& (flags & _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH & type) == 0)
goto no_match;
/* one of the scheduling types */
if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & type) == 0)
goto no_match;
if (type & GST_PAD_PROBE_TYPE_PUSH) {
/* one of the data types for non-idle probes */
if ((type & GST_PAD_PROBE_TYPE_IDLE) == 0
&& (flags & _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH & type) == 0)
goto no_match;
} else if (type & GST_PAD_PROBE_TYPE_PULL) {
/* one of the data types for non-idle probes */
if ((type & GST_PAD_PROBE_TYPE_BLOCKING) == 0
&& (flags & _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH & type) == 0)
goto no_match;
} else {
/* Type must have PULL or PUSH probe types */
g_assert_not_reached ();
}
/* one of the blocking types must match */
if ((type & GST_PAD_PROBE_TYPE_BLOCKING) &&
(flags & GST_PAD_PROBE_TYPE_BLOCKING & type) == 0)