mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
pad: fix scheduling mode enums
GstPadActivateMode -> GstPadMode GST_PAD_ACTIVATE_* -> GST_PAD_MODE_*
This commit is contained in:
parent
cb54ab7d90
commit
12d5f03453
12 changed files with 108 additions and 112 deletions
|
@ -1570,7 +1570,7 @@ GST_PAD_LINK_SUCCESSFUL
|
|||
GstPadLinkCheck
|
||||
GST_PAD_LINK_CHECK_DEFAULT
|
||||
GstFlowReturn
|
||||
GstPadActivateMode
|
||||
GstPadMode
|
||||
GstPadProbeReturn
|
||||
GstPadProbeType
|
||||
GST_PAD_PROBE_TYPE_BLOCKING
|
||||
|
@ -1715,8 +1715,8 @@ GST_TYPE_PAD_FLAGS
|
|||
GST_TYPE_PAD_LINK_RETURN
|
||||
GST_TYPE_PAD_LINK_CHECK
|
||||
GST_TYPE_PAD_PRESENCE
|
||||
GST_TYPE_PAD_MODE
|
||||
GST_TYPE_FLOW_RETURN
|
||||
GST_TYPE_ACTIVATE_MODE
|
||||
GST_TYPE_PROBE_RETURN
|
||||
GST_TYPE_PROBE_TYPE
|
||||
|
||||
|
@ -1752,7 +1752,7 @@ GST_PAD_BLOCK_GET_COND
|
|||
GST_PAD_BLOCK_SIGNAL
|
||||
GST_PAD_BLOCK_WAIT
|
||||
GST_PAD_CAST
|
||||
GST_PAD_ACTIVATE_MODE
|
||||
GST_PAD_MODE
|
||||
GST_PAD_DO_BUFFER_SIGNALS
|
||||
GST_PAD_DO_EVENT_SIGNALS
|
||||
GST_PAD_IS_BLOCKED
|
||||
|
|
|
@ -127,7 +127,7 @@ The 0.11 porting guide
|
|||
|
||||
GST_FLOW_UNEXPECTED -> GST_FLOW_EOS
|
||||
|
||||
GstActivateMode -> GstPadActivateMode, GST_ACTIVATE_* -> GST_PAD_ACTIVATE_*
|
||||
GstActivateMode -> GstPadMode, GST_ACTIVATE_* -> GST_PAD_MODE_*
|
||||
|
||||
The GstPadAcceptCapsFunction was removed and replaced with a
|
||||
GST_QUERY_ACCEPT_CAPS query.
|
||||
|
|
|
@ -728,7 +728,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|||
g_type_class_ref (gst_pad_link_return_get_type ());
|
||||
g_type_class_ref (gst_pad_link_check_get_type ());
|
||||
g_type_class_ref (gst_flow_return_get_type ());
|
||||
g_type_class_ref (gst_pad_activate_mode_get_type ());
|
||||
g_type_class_ref (gst_pad_mode_get_type ());
|
||||
g_type_class_ref (gst_pad_direction_get_type ());
|
||||
g_type_class_ref (gst_pad_flags_get_type ());
|
||||
g_type_class_ref (gst_pad_presence_get_type ());
|
||||
|
@ -1103,7 +1103,7 @@ gst_deinit (void)
|
|||
g_type_class_unref (g_type_class_peek (gst_pad_link_return_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_link_check_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_flow_return_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_activate_mode_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_mode_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_direction_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_flags_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_presence_get_type ()));
|
||||
|
|
78
gst/gstpad.c
78
gst/gstpad.c
|
@ -622,23 +622,23 @@ gst_pad_activate_default (GstPad * pad)
|
|||
}
|
||||
|
||||
static void
|
||||
pre_activate (GstPad * pad, GstPadActivateMode new_mode)
|
||||
pre_activate (GstPad * pad, GstPadMode new_mode)
|
||||
{
|
||||
switch (new_mode) {
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_OBJECT_LOCK (pad);
|
||||
GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE %d, unset flushing",
|
||||
new_mode);
|
||||
GST_PAD_UNSET_FLUSHING (pad);
|
||||
GST_PAD_ACTIVATE_MODE (pad) = new_mode;
|
||||
GST_PAD_MODE (pad) = new_mode;
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
break;
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_OBJECT_LOCK (pad);
|
||||
GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE NONE, set flushing");
|
||||
GST_PAD_SET_FLUSHING (pad);
|
||||
GST_PAD_ACTIVATE_MODE (pad) = new_mode;
|
||||
GST_PAD_MODE (pad) = new_mode;
|
||||
/* unlock blocked pads so element can resume and stop */
|
||||
GST_PAD_BLOCK_BROADCAST (pad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
@ -647,14 +647,14 @@ pre_activate (GstPad * pad, GstPadActivateMode new_mode)
|
|||
}
|
||||
|
||||
static void
|
||||
post_activate (GstPad * pad, GstPadActivateMode new_mode)
|
||||
post_activate (GstPad * pad, GstPadMode new_mode)
|
||||
{
|
||||
switch (new_mode) {
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
case GST_PAD_MODE_PULL:
|
||||
/* nop */
|
||||
break;
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
/* ensures that streaming stops */
|
||||
GST_PAD_STREAM_LOCK (pad);
|
||||
GST_DEBUG_OBJECT (pad, "stopped streaming");
|
||||
|
@ -689,26 +689,26 @@ post_activate (GstPad * pad, GstPadActivateMode new_mode)
|
|||
gboolean
|
||||
gst_pad_set_active (GstPad * pad, gboolean active)
|
||||
{
|
||||
GstPadActivateMode old;
|
||||
GstPadMode old;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||
|
||||
GST_OBJECT_LOCK (pad);
|
||||
old = GST_PAD_ACTIVATE_MODE (pad);
|
||||
old = GST_PAD_MODE (pad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (active) {
|
||||
switch (old) {
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from push");
|
||||
ret = TRUE;
|
||||
break;
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from pull");
|
||||
ret = TRUE;
|
||||
break;
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from none");
|
||||
ret = (GST_PAD_ACTIVATEFUNC (pad)) (pad);
|
||||
break;
|
||||
|
@ -718,15 +718,15 @@ gst_pad_set_active (GstPad * pad, gboolean active)
|
|||
}
|
||||
} else {
|
||||
switch (old) {
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from push");
|
||||
ret = gst_pad_activate_push (pad, FALSE);
|
||||
break;
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from pull");
|
||||
ret = gst_pad_activate_pull (pad, FALSE);
|
||||
break;
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from none");
|
||||
ret = TRUE;
|
||||
break;
|
||||
|
@ -776,21 +776,21 @@ gst_pad_set_active (GstPad * pad, gboolean active)
|
|||
gboolean
|
||||
gst_pad_activate_pull (GstPad * pad, gboolean active)
|
||||
{
|
||||
GstPadActivateMode old, new;
|
||||
GstPadMode old, new;
|
||||
GstPad *peer;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||
|
||||
GST_OBJECT_LOCK (pad);
|
||||
old = GST_PAD_ACTIVATE_MODE (pad);
|
||||
old = GST_PAD_MODE (pad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (active) {
|
||||
switch (old) {
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from pull, was ok");
|
||||
goto was_ok;
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
GST_DEBUG_OBJECT (pad,
|
||||
"activating pad from push, deactivate push first");
|
||||
/* pad was activate in the wrong direction, deactivate it
|
||||
|
@ -798,16 +798,16 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
if (G_UNLIKELY (!gst_pad_activate_push (pad, FALSE)))
|
||||
goto deactivate_failed;
|
||||
/* fallthrough, pad is deactivated now. */
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from none");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (old) {
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from none, was ok");
|
||||
goto was_ok;
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from push, weird");
|
||||
/* pad was activated in the other direction, deactivate it
|
||||
* in push mode, this should not happen... */
|
||||
|
@ -815,7 +815,7 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
goto deactivate_failed;
|
||||
/* everything is fine now */
|
||||
goto was_ok;
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from pull");
|
||||
break;
|
||||
}
|
||||
|
@ -842,7 +842,7 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
getrange function */
|
||||
}
|
||||
|
||||
new = active ? GST_PAD_ACTIVATE_PULL : GST_PAD_ACTIVATE_NONE;
|
||||
new = active ? GST_PAD_MODE_PULL : GST_PAD_MODE_NONE;
|
||||
pre_activate (pad, new);
|
||||
|
||||
if (GST_PAD_ACTIVATEPULLFUNC (pad)) {
|
||||
|
@ -893,7 +893,7 @@ failure:
|
|||
GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in pull mode",
|
||||
active ? "activate" : "deactivate");
|
||||
GST_PAD_SET_FLUSHING (pad);
|
||||
GST_PAD_ACTIVATE_MODE (pad) = old;
|
||||
GST_PAD_MODE (pad) = old;
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -916,22 +916,22 @@ failure:
|
|||
gboolean
|
||||
gst_pad_activate_push (GstPad * pad, gboolean active)
|
||||
{
|
||||
GstPadActivateMode old, new;
|
||||
GstPadMode old, new;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "trying to set %s in push mode",
|
||||
active ? "activated" : "deactivated");
|
||||
|
||||
GST_OBJECT_LOCK (pad);
|
||||
old = GST_PAD_ACTIVATE_MODE (pad);
|
||||
old = GST_PAD_MODE (pad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (active) {
|
||||
switch (old) {
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from push, was ok");
|
||||
goto was_ok;
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_DEBUG_OBJECT (pad,
|
||||
"activating pad from push, deactivating pull first");
|
||||
/* pad was activate in the wrong direction, deactivate it
|
||||
|
@ -939,16 +939,16 @@ gst_pad_activate_push (GstPad * pad, gboolean active)
|
|||
if (G_UNLIKELY (!gst_pad_activate_pull (pad, FALSE)))
|
||||
goto deactivate_failed;
|
||||
/* fallthrough, pad is deactivated now. */
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_DEBUG_OBJECT (pad, "activating pad from none");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (old) {
|
||||
case GST_PAD_ACTIVATE_NONE:
|
||||
case GST_PAD_MODE_NONE:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from none, was ok");
|
||||
goto was_ok;
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from pull, weird");
|
||||
/* pad was activated in the other direction, deactivate it
|
||||
* in pull mode, this should not happen... */
|
||||
|
@ -956,13 +956,13 @@ gst_pad_activate_push (GstPad * pad, gboolean active)
|
|||
goto deactivate_failed;
|
||||
/* everything is fine now */
|
||||
goto was_ok;
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
GST_DEBUG_OBJECT (pad, "deactivating pad from push");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
new = active ? GST_PAD_ACTIVATE_PUSH : GST_PAD_ACTIVATE_NONE;
|
||||
new = active ? GST_PAD_MODE_PUSH : GST_PAD_MODE_NONE;
|
||||
pre_activate (pad, new);
|
||||
|
||||
if (GST_PAD_ACTIVATEPUSHFUNC (pad)) {
|
||||
|
@ -998,7 +998,7 @@ failure:
|
|||
GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in push mode",
|
||||
active ? "activate" : "deactivate");
|
||||
GST_PAD_SET_FLUSHING (pad);
|
||||
GST_PAD_ACTIVATE_MODE (pad) = old;
|
||||
GST_PAD_MODE (pad) = old;
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -4220,7 +4220,7 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
|
|||
needs_events = FALSE;
|
||||
break;
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
if (G_LIKELY (GST_PAD_ACTIVATE_MODE (pad) != GST_PAD_ACTIVATE_NONE)) {
|
||||
if (G_LIKELY (GST_PAD_MODE (pad) != GST_PAD_MODE_NONE)) {
|
||||
GST_PAD_UNSET_FLUSHING (pad);
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "cleared flush flag");
|
||||
}
|
||||
|
|
24
gst/gstpad.h
24
gst/gstpad.h
|
@ -212,20 +212,20 @@ typedef enum {
|
|||
#define GST_PAD_LINK_CHECK_DEFAULT ((GstPadLinkCheck) (GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS))
|
||||
|
||||
/**
|
||||
* GstPadActivateMode:
|
||||
* @GST_PAD_ACTIVATE_NONE: Pad will not handle dataflow
|
||||
* @GST_PAD_ACTIVATE_PUSH: Pad handles dataflow in downstream push mode
|
||||
* @GST_PAD_ACTIVATE_PULL: Pad handles dataflow in upstream pull mode
|
||||
* GstPadMode:
|
||||
* @GST_PAD_MODE_NONE: Pad will not handle dataflow
|
||||
* @GST_PAD_MODE_PUSH: Pad handles dataflow in downstream push mode
|
||||
* @GST_PAD_MODE_PULL: Pad handles dataflow in upstream pull mode
|
||||
*
|
||||
* The status of a GstPad. After activating a pad, which usually happens when the
|
||||
* parent element goes from READY to PAUSED, the GstPadActivateMode defines if the
|
||||
* parent element goes from READY to PAUSED, the GstPadMode defines if the
|
||||
* pad operates in push or pull mode.
|
||||
*/
|
||||
typedef enum {
|
||||
GST_PAD_ACTIVATE_NONE,
|
||||
GST_PAD_ACTIVATE_PUSH,
|
||||
GST_PAD_ACTIVATE_PULL
|
||||
} GstPadActivateMode;
|
||||
GST_PAD_MODE_NONE,
|
||||
GST_PAD_MODE_PUSH,
|
||||
GST_PAD_MODE_PULL
|
||||
} GstPadMode;
|
||||
|
||||
/* pad states */
|
||||
/**
|
||||
|
@ -648,7 +648,7 @@ struct _GstPad {
|
|||
GCond *block_cond;
|
||||
GHookList probes;
|
||||
|
||||
GstPadActivateMode mode;
|
||||
GstPadMode mode;
|
||||
GstPadActivateFunction activatefunc;
|
||||
GstPadActivateModeFunction activatepushfunc;
|
||||
GstPadActivateModeFunction activatepullfunc;
|
||||
|
@ -703,7 +703,7 @@ struct _GstPadClass {
|
|||
#define GST_PAD_PAD_TEMPLATE(pad) (GST_PAD_CAST(pad)->padtemplate)
|
||||
#define GST_PAD_DIRECTION(pad) (GST_PAD_CAST(pad)->direction)
|
||||
#define GST_PAD_TASK(pad) (GST_PAD_CAST(pad)->task)
|
||||
#define GST_PAD_ACTIVATE_MODE(pad) (GST_PAD_CAST(pad)->mode)
|
||||
#define GST_PAD_MODE(pad) (GST_PAD_CAST(pad)->mode)
|
||||
|
||||
#define GST_PAD_ACTIVATEFUNC(pad) (GST_PAD_CAST(pad)->activatefunc)
|
||||
#define GST_PAD_ACTIVATEPUSHFUNC(pad) (GST_PAD_CAST(pad)->activatepushfunc)
|
||||
|
@ -724,7 +724,7 @@ struct _GstPadClass {
|
|||
|
||||
#define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL)
|
||||
|
||||
#define GST_PAD_IS_ACTIVE(pad) (GST_PAD_ACTIVATE_MODE(pad) != GST_PAD_ACTIVATE_NONE)
|
||||
#define GST_PAD_IS_ACTIVE(pad) (GST_PAD_MODE(pad) != GST_PAD_MODE_NONE)
|
||||
|
||||
#define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKED))
|
||||
#define GST_PAD_IS_BLOCKING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLAG_BLOCKING))
|
||||
|
|
|
@ -226,7 +226,7 @@ static const GstFormat fmtlist[] = {
|
|||
|
||||
struct _GstBaseParsePrivate
|
||||
{
|
||||
GstPadActivateMode pad_mode;
|
||||
GstPadMode pad_mode;
|
||||
|
||||
GstAdapter *adapter;
|
||||
|
||||
|
@ -558,7 +558,7 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass)
|
|||
|
||||
parse->priv->adapter = gst_adapter_new ();
|
||||
|
||||
parse->priv->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
parse->priv->pad_mode = GST_PAD_MODE_NONE;
|
||||
|
||||
g_static_mutex_init (&parse->priv->index_lock);
|
||||
|
||||
|
@ -1738,7 +1738,7 @@ gst_base_parse_handle_and_push_frame (GstBaseParse * parse,
|
|||
* If so, that allows and enables extra seek and duration determining options */
|
||||
if (G_UNLIKELY (parse->priv->first_frame_offset < 0 && ret == GST_FLOW_OK)) {
|
||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer) && parse->priv->has_timing_info
|
||||
&& parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL) {
|
||||
&& parse->priv->pad_mode == GST_PAD_MODE_PULL) {
|
||||
parse->priv->first_frame_offset = offset;
|
||||
parse->priv->first_frame_ts = GST_BUFFER_TIMESTAMP (buffer);
|
||||
GST_DEBUG_OBJECT (parse, "subclass provided ts %" GST_TIME_FORMAT
|
||||
|
@ -1872,7 +1872,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
|
||||
/* segment adjustment magic; only if we are running the whole show */
|
||||
if (!parse->priv->passthrough && parse->segment.rate > 0.0 &&
|
||||
(parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL ||
|
||||
(parse->priv->pad_mode == GST_PAD_MODE_PULL ||
|
||||
parse->priv->upstream_seekable)) {
|
||||
/* segment times are typically estimates,
|
||||
* actual frame data might lead subclass to different timestamps,
|
||||
|
@ -1940,7 +1940,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
parse->priv->pending_segment = NULL;
|
||||
|
||||
GST_DEBUG_OBJECT (parse, "%s push pending segment",
|
||||
parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL ? "loop" : "chain");
|
||||
parse->priv->pad_mode == GST_PAD_MODE_PULL ? "loop" : "chain");
|
||||
gst_pad_push_event (parse->srcpad, pending_segment);
|
||||
|
||||
/* have caps; check identity */
|
||||
|
@ -2025,7 +2025,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
/* if we are not sufficiently in control, let upstream decide on EOS */
|
||||
if (ret == GST_FLOW_EOS &&
|
||||
(parse->priv->passthrough ||
|
||||
(parse->priv->pad_mode == GST_PAD_ACTIVATE_PUSH &&
|
||||
(parse->priv->pad_mode == GST_PAD_MODE_PUSH &&
|
||||
!parse->priv->upstream_seekable)))
|
||||
ret = GST_FLOW_OK;
|
||||
}
|
||||
|
@ -2979,7 +2979,7 @@ gst_base_parse_activate (GstBaseParse * parse, gboolean active)
|
|||
klass = GST_BASE_PARSE_GET_CLASS (parse);
|
||||
|
||||
if (active) {
|
||||
if (parse->priv->pad_mode == GST_PAD_ACTIVATE_NONE && klass->start)
|
||||
if (parse->priv->pad_mode == GST_PAD_MODE_NONE && klass->start)
|
||||
result = klass->start (parse);
|
||||
|
||||
/* If the subclass implements ::detect we want to
|
||||
|
@ -2991,10 +2991,10 @@ gst_base_parse_activate (GstBaseParse * parse, gboolean active)
|
|||
GST_PAD_STREAM_LOCK (parse->sinkpad);
|
||||
GST_PAD_STREAM_UNLOCK (parse->sinkpad);
|
||||
|
||||
if (parse->priv->pad_mode != GST_PAD_ACTIVATE_NONE && klass->stop)
|
||||
if (parse->priv->pad_mode != GST_PAD_MODE_NONE && klass->stop)
|
||||
result = klass->stop (parse);
|
||||
|
||||
parse->priv->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
parse->priv->pad_mode = GST_PAD_MODE_NONE;
|
||||
}
|
||||
GST_DEBUG_OBJECT (parse, "activate return: %d", result);
|
||||
return result;
|
||||
|
@ -3013,8 +3013,7 @@ gst_base_parse_sink_activate_push (GstPad * pad, gboolean active)
|
|||
result = gst_base_parse_activate (parse, active);
|
||||
|
||||
if (result)
|
||||
parse->priv->pad_mode =
|
||||
active ? GST_PAD_ACTIVATE_PUSH : GST_PAD_ACTIVATE_NONE;
|
||||
parse->priv->pad_mode = active ? GST_PAD_MODE_PUSH : GST_PAD_MODE_NONE;
|
||||
|
||||
GST_DEBUG_OBJECT (parse, "sink activate push return: %d", result);
|
||||
|
||||
|
@ -3046,8 +3045,7 @@ gst_base_parse_sink_activate_pull (GstPad * sinkpad, gboolean active)
|
|||
}
|
||||
|
||||
if (result)
|
||||
parse->priv->pad_mode =
|
||||
active ? GST_PAD_ACTIVATE_PULL : GST_PAD_ACTIVATE_NONE;
|
||||
parse->priv->pad_mode = active ? GST_PAD_MODE_PULL : GST_PAD_MODE_NONE;
|
||||
|
||||
GST_DEBUG_OBJECT (parse, "sink activate pull return: %d", result);
|
||||
|
||||
|
@ -3576,7 +3574,7 @@ gst_base_parse_locate_time (GstBaseParse * parse, GstClockTime * _time,
|
|||
/* check preconditions are satisfied;
|
||||
* start and end are needed, except for special case where we scan for
|
||||
* last frame to determine duration */
|
||||
if (parse->priv->pad_mode != GST_PAD_ACTIVATE_PULL || !hpos ||
|
||||
if (parse->priv->pad_mode != GST_PAD_MODE_PULL || !hpos ||
|
||||
!GST_CLOCK_TIME_IS_VALID (ltime) ||
|
||||
(!GST_CLOCK_TIME_IS_VALID (htime) && time != G_MAXINT64)) {
|
||||
return GST_FLOW_OK;
|
||||
|
@ -3736,7 +3734,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event)
|
|||
cur_type, GST_TIME_ARGS (cur), stop_type, GST_TIME_ARGS (stop));
|
||||
|
||||
/* no negative rates in push mode */
|
||||
if (rate < 0.0 && parse->priv->pad_mode == GST_PAD_ACTIVATE_PUSH)
|
||||
if (rate < 0.0 && parse->priv->pad_mode == GST_PAD_MODE_PUSH)
|
||||
goto negative_rate;
|
||||
|
||||
if (cur_type != GST_SEEK_TYPE_SET ||
|
||||
|
@ -3806,7 +3804,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event)
|
|||
"seek stop %" G_GINT64_FORMAT " in bytes: %" G_GINT64_FORMAT,
|
||||
seeksegment.stop, seekstop);
|
||||
|
||||
if (parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL) {
|
||||
if (parse->priv->pad_mode == GST_PAD_MODE_PULL) {
|
||||
gint64 last_stop;
|
||||
|
||||
GST_DEBUG_OBJECT (parse, "seek in PULL mode");
|
||||
|
|
|
@ -575,7 +575,7 @@ gst_base_sink_query_caps (GstBaseSink * bsink, GstPad * pad, GstCaps * filter)
|
|||
bclass = GST_BASE_SINK_GET_CLASS (bsink);
|
||||
fixed = GST_PAD_IS_FIXED_CAPS (pad);
|
||||
|
||||
if (fixed || bsink->pad_mode == GST_PAD_ACTIVATE_PULL) {
|
||||
if (fixed || bsink->pad_mode == GST_PAD_MODE_PULL) {
|
||||
/* if we are operating in pull mode or fixed caps, we only accept the
|
||||
* currently negotiated caps */
|
||||
caps = gst_pad_get_current_caps (pad);
|
||||
|
@ -651,7 +651,7 @@ gst_base_sink_init (GstBaseSink * basesink, gpointer g_class)
|
|||
gst_pad_set_chain_list_function (basesink->sinkpad, gst_base_sink_chain_list);
|
||||
gst_element_add_pad (GST_ELEMENT_CAST (basesink), basesink->sinkpad);
|
||||
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
basesink->pad_mode = GST_PAD_MODE_NONE;
|
||||
basesink->preroll_lock = g_mutex_new ();
|
||||
basesink->preroll_cond = g_cond_new ();
|
||||
priv->preroll_queue = g_queue_new ();
|
||||
|
@ -3290,7 +3290,7 @@ gst_base_sink_flush_stop (GstBaseSink * basesink, GstPad * pad,
|
|||
basesink->priv->call_preroll = TRUE;
|
||||
basesink->priv->current_step.valid = FALSE;
|
||||
basesink->priv->pending_step.valid = FALSE;
|
||||
if (basesink->pad_mode == GST_PAD_ACTIVATE_PUSH) {
|
||||
if (basesink->pad_mode == GST_PAD_MODE_PUSH) {
|
||||
/* we need new segment info after the flush. */
|
||||
basesink->have_newsegment = FALSE;
|
||||
if (reset_time) {
|
||||
|
@ -3601,7 +3601,7 @@ gst_base_sink_chain_main (GstBaseSink * basesink, GstPad * pad,
|
|||
{
|
||||
GstFlowReturn result;
|
||||
|
||||
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_ACTIVATE_PUSH))
|
||||
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_MODE_PUSH))
|
||||
goto wrong_mode;
|
||||
|
||||
GST_BASE_SINK_PREROLL_LOCK (basesink);
|
||||
|
@ -3985,7 +3985,7 @@ gst_base_sink_loop (GstPad * pad)
|
|||
parent = GST_OBJECT_PARENT (pad);
|
||||
basesink = GST_BASE_SINK (parent);
|
||||
|
||||
g_assert (basesink->pad_mode == GST_PAD_ACTIVATE_PULL);
|
||||
g_assert (basesink->pad_mode == GST_PAD_MODE_PULL);
|
||||
|
||||
if ((blocksize = basesink->priv->blocksize) == 0)
|
||||
blocksize = -1;
|
||||
|
@ -4153,7 +4153,7 @@ gst_base_sink_pad_activate (GstPad * pad)
|
|||
/* set the pad mode before starting the task so that it's in the
|
||||
* correct state for the new thread. also the sink set_caps and get_caps
|
||||
* function checks this */
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_PULL;
|
||||
basesink->pad_mode = GST_PAD_MODE_PULL;
|
||||
|
||||
/* we first try to negotiate a format so that when we try to activate
|
||||
* downstream, it knows about our format */
|
||||
|
@ -4205,19 +4205,19 @@ gst_base_sink_pad_activate_push (GstPad * pad, gboolean active)
|
|||
if (active) {
|
||||
if (!basesink->can_activate_push) {
|
||||
result = FALSE;
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
basesink->pad_mode = GST_PAD_MODE_NONE;
|
||||
} else {
|
||||
result = TRUE;
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_PUSH;
|
||||
basesink->pad_mode = GST_PAD_MODE_PUSH;
|
||||
}
|
||||
} else {
|
||||
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_ACTIVATE_PUSH)) {
|
||||
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_MODE_PUSH)) {
|
||||
g_warning ("Internal GStreamer activation error!!!");
|
||||
result = FALSE;
|
||||
} else {
|
||||
gst_base_sink_set_flushing (basesink, pad, TRUE);
|
||||
result = TRUE;
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
basesink->pad_mode = GST_PAD_MODE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4331,14 +4331,14 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
goto activate_failed;
|
||||
|
||||
} else {
|
||||
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_ACTIVATE_PULL)) {
|
||||
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_MODE_PULL)) {
|
||||
g_warning ("Internal GStreamer activation error!!!");
|
||||
result = FALSE;
|
||||
} else {
|
||||
result = gst_base_sink_set_flushing (basesink, pad, TRUE);
|
||||
if (bclass->activate_pull)
|
||||
result &= bclass->activate_pull (basesink, FALSE);
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
basesink->pad_mode = GST_PAD_MODE_NONE;
|
||||
/* clear any pending caps */
|
||||
GST_OBJECT_LOCK (basesink);
|
||||
gst_caps_replace (&basesink->priv->pull_caps, NULL);
|
||||
|
@ -4353,7 +4353,7 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
|
|||
activate_failed:
|
||||
{
|
||||
/* reset, as starting the thread failed */
|
||||
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
basesink->pad_mode = GST_PAD_MODE_NONE;
|
||||
|
||||
GST_ERROR_OBJECT (basesink, "subclass failed to activate in pull mode");
|
||||
return FALSE;
|
||||
|
@ -4367,7 +4367,7 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
|
|||
GstPad *pad;
|
||||
GstBaseSink *basesink = GST_BASE_SINK (element);
|
||||
gboolean forward, result = TRUE;
|
||||
GstPadActivateMode mode;
|
||||
GstPadMode mode;
|
||||
|
||||
GST_OBJECT_LOCK (element);
|
||||
/* get the pad and the scheduling mode */
|
||||
|
@ -4405,7 +4405,7 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
|
|||
}
|
||||
case GST_EVENT_SEEK:
|
||||
/* in pull mode we will execute the seek */
|
||||
if (mode == GST_PAD_ACTIVATE_PULL)
|
||||
if (mode == GST_PAD_MODE_PULL)
|
||||
result = gst_base_sink_perform_seek (basesink, pad, event);
|
||||
break;
|
||||
case GST_EVENT_STEP:
|
||||
|
@ -4463,7 +4463,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
|||
/* we don't use the clip segment in pull mode, when seeking we update the
|
||||
* main segment directly with the new segment values without it having to be
|
||||
* activated by the rendering after preroll */
|
||||
if (basesink->pad_mode == GST_PAD_ACTIVATE_PUSH)
|
||||
if (basesink->pad_mode == GST_PAD_MODE_PUSH)
|
||||
segment = &basesink->clip_segment;
|
||||
else
|
||||
segment = &basesink->segment;
|
||||
|
@ -4673,7 +4673,7 @@ gst_base_sink_get_duration (GstBaseSink * basesink, GstFormat format,
|
|||
{
|
||||
gboolean res = FALSE;
|
||||
|
||||
if (basesink->pad_mode == GST_PAD_ACTIVATE_PULL) {
|
||||
if (basesink->pad_mode == GST_PAD_MODE_PULL) {
|
||||
gint64 uduration;
|
||||
|
||||
/* get the duration in bytes, in pull mode that's all we are sure to
|
||||
|
@ -4808,7 +4808,7 @@ default_element_query (GstElement * element, GstQuery * query)
|
|||
break;
|
||||
case GST_QUERY_SEGMENT:
|
||||
{
|
||||
if (basesink->pad_mode == GST_PAD_ACTIVATE_PULL) {
|
||||
if (basesink->pad_mode == GST_PAD_MODE_PULL) {
|
||||
gst_query_set_segment (query, basesink->segment.rate,
|
||||
GST_FORMAT_TIME, basesink->segment.start, basesink->segment.stop);
|
||||
res = TRUE;
|
||||
|
|
|
@ -71,7 +71,7 @@ struct _GstBaseSink {
|
|||
|
||||
/*< protected >*/
|
||||
GstPad *sinkpad;
|
||||
GstPadActivateMode pad_mode;
|
||||
GstPadMode pad_mode;
|
||||
|
||||
/*< protected >*/ /* with LOCK */
|
||||
guint64 offset;
|
||||
|
|
|
@ -1675,9 +1675,9 @@ gst_base_src_send_event (GstElement * element, GstEvent * event)
|
|||
gboolean started;
|
||||
|
||||
GST_OBJECT_LOCK (src->srcpad);
|
||||
if (GST_PAD_ACTIVATE_MODE (src->srcpad) == GST_PAD_ACTIVATE_PULL)
|
||||
if (GST_PAD_MODE (src->srcpad) == GST_PAD_MODE_PULL)
|
||||
goto wrong_mode;
|
||||
started = GST_PAD_ACTIVATE_MODE (src->srcpad) == GST_PAD_ACTIVATE_PUSH;
|
||||
started = GST_PAD_MODE (src->srcpad) == GST_PAD_MODE_PUSH;
|
||||
GST_OBJECT_UNLOCK (src->srcpad);
|
||||
|
||||
if (started) {
|
||||
|
@ -3037,7 +3037,7 @@ gst_base_src_set_playing (GstBaseSrc * basesrc, gboolean live_play)
|
|||
/* have to restart the task in case it stopped because of the unlock when
|
||||
* we went to PAUSED. Only do this if we operating in push mode. */
|
||||
GST_OBJECT_LOCK (basesrc->srcpad);
|
||||
start = (GST_PAD_ACTIVATE_MODE (basesrc->srcpad) == GST_PAD_ACTIVATE_PUSH);
|
||||
start = (GST_PAD_MODE (basesrc->srcpad) == GST_PAD_MODE_PUSH);
|
||||
GST_OBJECT_UNLOCK (basesrc->srcpad);
|
||||
if (start)
|
||||
gst_pad_start_task (basesrc->srcpad, (GstTaskFunction) gst_base_src_loop,
|
||||
|
|
|
@ -240,7 +240,7 @@ struct _GstBaseTransformPrivate
|
|||
/* previous buffer had a discont */
|
||||
gboolean discont;
|
||||
|
||||
GstPadActivateMode pad_mode;
|
||||
GstPadMode pad_mode;
|
||||
|
||||
gboolean gap_aware;
|
||||
|
||||
|
@ -442,7 +442,7 @@ gst_base_transform_init (GstBaseTransform * trans,
|
|||
trans->priv->qos_enabled = DEFAULT_PROP_QOS;
|
||||
trans->cache_caps1 = NULL;
|
||||
trans->cache_caps2 = NULL;
|
||||
trans->priv->pad_mode = GST_PAD_ACTIVATE_NONE;
|
||||
trans->priv->pad_mode = GST_PAD_MODE_NONE;
|
||||
trans->priv->gap_aware = FALSE;
|
||||
|
||||
trans->passthrough = FALSE;
|
||||
|
@ -1237,7 +1237,7 @@ gst_base_transform_setcaps (GstBaseTransform * trans, GstPad * pad,
|
|||
/* we know this will work, we implement the setcaps */
|
||||
gst_pad_push_event (otherpad, gst_event_new_caps (othercaps));
|
||||
|
||||
if (pad == trans->srcpad && trans->priv->pad_mode == GST_PAD_ACTIVATE_PULL) {
|
||||
if (pad == trans->srcpad && trans->priv->pad_mode == GST_PAD_MODE_PULL) {
|
||||
/* FIXME hm? */
|
||||
ret &= gst_pad_push_event (otherpeer, gst_event_new_caps (othercaps));
|
||||
if (!ret) {
|
||||
|
@ -2099,7 +2099,7 @@ gst_base_transform_activate (GstBaseTransform * trans, gboolean active)
|
|||
if (active) {
|
||||
GstCaps *incaps, *outcaps;
|
||||
|
||||
if (trans->priv->pad_mode == GST_PAD_ACTIVATE_NONE && bclass->start)
|
||||
if (trans->priv->pad_mode == GST_PAD_MODE_NONE && bclass->start)
|
||||
result &= bclass->start (trans);
|
||||
|
||||
incaps = gst_pad_get_current_caps (trans->sinkpad);
|
||||
|
@ -2142,7 +2142,7 @@ gst_base_transform_activate (GstBaseTransform * trans, gboolean active)
|
|||
gst_caps_replace (&trans->cache_caps1, NULL);
|
||||
gst_caps_replace (&trans->cache_caps2, NULL);
|
||||
|
||||
if (trans->priv->pad_mode != GST_PAD_ACTIVATE_NONE && bclass->stop)
|
||||
if (trans->priv->pad_mode != GST_PAD_MODE_NONE && bclass->stop)
|
||||
result &= bclass->stop (trans);
|
||||
|
||||
gst_base_transform_set_allocation (trans, NULL, NULL, 0, 0);
|
||||
|
@ -2162,8 +2162,7 @@ gst_base_transform_sink_activate_push (GstPad * pad, gboolean active)
|
|||
result = gst_base_transform_activate (trans, active);
|
||||
|
||||
if (result)
|
||||
trans->priv->pad_mode =
|
||||
active ? GST_PAD_ACTIVATE_PUSH : GST_PAD_ACTIVATE_NONE;
|
||||
trans->priv->pad_mode = active ? GST_PAD_MODE_PUSH : GST_PAD_MODE_NONE;
|
||||
|
||||
gst_object_unref (trans);
|
||||
|
||||
|
@ -2184,8 +2183,7 @@ gst_base_transform_src_activate_pull (GstPad * pad, gboolean active)
|
|||
result &= gst_base_transform_activate (trans, active);
|
||||
|
||||
if (result)
|
||||
trans->priv->pad_mode =
|
||||
active ? GST_PAD_ACTIVATE_PULL : GST_PAD_ACTIVATE_NONE;
|
||||
trans->priv->pad_mode = active ? GST_PAD_MODE_PULL : GST_PAD_MODE_NONE;
|
||||
|
||||
gst_object_unref (trans);
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ gst_tee_init (GstTee * tee)
|
|||
tee->dyn_lock = g_mutex_new ();
|
||||
|
||||
tee->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
|
||||
tee->sink_mode = GST_PAD_ACTIVATE_NONE;
|
||||
tee->sink_mode = GST_PAD_MODE_NONE;
|
||||
|
||||
gst_pad_set_event_function (tee->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_tee_sink_event));
|
||||
|
@ -294,7 +294,7 @@ gst_tee_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
|||
gchar *name;
|
||||
GstPad *srcpad;
|
||||
GstTee *tee;
|
||||
GstPadActivateMode mode;
|
||||
GstPadMode mode;
|
||||
gboolean res;
|
||||
PushData *data;
|
||||
|
||||
|
@ -321,10 +321,10 @@ gst_tee_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
|||
GST_OBJECT_UNLOCK (tee);
|
||||
|
||||
switch (mode) {
|
||||
case GST_PAD_ACTIVATE_PULL:
|
||||
case GST_PAD_MODE_PULL:
|
||||
/* we already have a src pad in pull mode, and our pull mode can only be
|
||||
SINGLE, so fall through to activate this new pad in push mode */
|
||||
case GST_PAD_ACTIVATE_PUSH:
|
||||
case GST_PAD_MODE_PUSH:
|
||||
res = gst_pad_activate_push (srcpad, TRUE);
|
||||
break;
|
||||
default:
|
||||
|
@ -732,7 +732,7 @@ gst_tee_sink_activate_push (GstPad * pad, gboolean active)
|
|||
tee = GST_TEE (GST_OBJECT_PARENT (pad));
|
||||
|
||||
GST_OBJECT_LOCK (tee);
|
||||
tee->sink_mode = active && GST_PAD_ACTIVATE_PUSH;
|
||||
tee->sink_mode = active && GST_PAD_MODE_PUSH;
|
||||
|
||||
if (active && !tee->has_chain)
|
||||
goto no_chain;
|
||||
|
@ -785,7 +785,7 @@ gst_tee_src_activate_pull (GstPad * pad, gboolean active)
|
|||
if (pad == tee->pull_pad)
|
||||
tee->pull_pad = NULL;
|
||||
}
|
||||
tee->sink_mode = active & GST_PAD_ACTIVATE_PULL;
|
||||
tee->sink_mode = active & GST_PAD_MODE_PULL;
|
||||
GST_OBJECT_UNLOCK (tee);
|
||||
|
||||
return res;
|
||||
|
|
|
@ -78,7 +78,7 @@ struct _GstTee {
|
|||
gboolean silent;
|
||||
gchar *last_message;
|
||||
|
||||
GstPadActivateMode sink_mode;
|
||||
GstPadMode sink_mode;
|
||||
GstTeePullMode pull_mode;
|
||||
GstPad *pull_pad;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue