Commit 12d5f034 authored by Wim Taymans's avatar Wim Taymans

pad: fix scheduling mode enums

GstPadActivateMode -> GstPadMode
GST_PAD_ACTIVATE_* -> GST_PAD_MODE_*
parent cb54ab7d
......@@ -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 ()));
......
......@@ -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");
}
......
......@@ -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,
......