pad: rename GstActivateMode to GstPadActivateMode

These might be useful:
sed -i -e 's/GstActivateMode/GstPadActivateMode/g' `git grep GstActivateMode | sed -e 's/:.*//' | sort -u`
sed -i -e 's/GST_ACTIVATE_/GST_PAD_ACTIVATE_/g'    `git grep GST_ACTIVATE_   | sed -e 's/:.*//' | sort -u`
This commit is contained in:
Tim-Philipp Müller 2011-11-01 00:25:02 +00:00
parent bffc9207b5
commit 4f004eff38
13 changed files with 108 additions and 104 deletions

View file

@ -1543,7 +1543,7 @@ GST_PAD_LINK_SUCCESSFUL
GstPadLinkCheck
GST_PAD_LINK_CHECK_DEFAULT
GstFlowReturn
GstActivateMode
GstPadActivateMode
GstPadProbeReturn
GstPadProbeType
GST_PAD_PROBE_TYPE_BLOCKING

View file

@ -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_activate_mode_get_type ());
g_type_class_ref (gst_pad_activate_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 ());
@ -1102,7 +1102,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_activate_mode_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_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 ()));

View file

@ -625,11 +625,11 @@ gst_pad_activate_default (GstPad * pad)
}
static void
pre_activate (GstPad * pad, GstActivateMode new_mode)
pre_activate (GstPad * pad, GstPadActivateMode new_mode)
{
switch (new_mode) {
case GST_ACTIVATE_PUSH:
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PULL:
GST_OBJECT_LOCK (pad);
GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE %d, unset flushing",
new_mode);
@ -637,7 +637,7 @@ pre_activate (GstPad * pad, GstActivateMode new_mode)
GST_PAD_ACTIVATE_MODE (pad) = new_mode;
GST_OBJECT_UNLOCK (pad);
break;
case GST_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_OBJECT_LOCK (pad);
GST_DEBUG_OBJECT (pad, "setting ACTIVATE_MODE NONE, set flushing");
GST_PAD_SET_FLUSHING (pad);
@ -650,14 +650,14 @@ pre_activate (GstPad * pad, GstActivateMode new_mode)
}
static void
post_activate (GstPad * pad, GstActivateMode new_mode)
post_activate (GstPad * pad, GstPadActivateMode new_mode)
{
switch (new_mode) {
case GST_ACTIVATE_PUSH:
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PULL:
/* nop */
break;
case GST_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
/* ensures that streaming stops */
GST_PAD_STREAM_LOCK (pad);
GST_DEBUG_OBJECT (pad, "stopped streaming");
@ -692,7 +692,7 @@ post_activate (GstPad * pad, GstActivateMode new_mode)
gboolean
gst_pad_set_active (GstPad * pad, gboolean active)
{
GstActivateMode old;
GstPadActivateMode old;
gboolean ret = FALSE;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
@ -703,15 +703,15 @@ gst_pad_set_active (GstPad * pad, gboolean active)
if (active) {
switch (old) {
case GST_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PUSH:
GST_DEBUG_OBJECT (pad, "activating pad from push");
ret = TRUE;
break;
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PULL:
GST_DEBUG_OBJECT (pad, "activating pad from pull");
ret = TRUE;
break;
case GST_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_DEBUG_OBJECT (pad, "activating pad from none");
ret = (GST_PAD_ACTIVATEFUNC (pad)) (pad);
break;
@ -721,15 +721,15 @@ gst_pad_set_active (GstPad * pad, gboolean active)
}
} else {
switch (old) {
case GST_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PUSH:
GST_DEBUG_OBJECT (pad, "deactivating pad from push");
ret = gst_pad_activate_push (pad, FALSE);
break;
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PULL:
GST_DEBUG_OBJECT (pad, "deactivating pad from pull");
ret = gst_pad_activate_pull (pad, FALSE);
break;
case GST_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_DEBUG_OBJECT (pad, "deactivating pad from none");
ret = TRUE;
break;
@ -779,7 +779,7 @@ gst_pad_set_active (GstPad * pad, gboolean active)
gboolean
gst_pad_activate_pull (GstPad * pad, gboolean active)
{
GstActivateMode old, new;
GstPadActivateMode old, new;
GstPad *peer;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
@ -790,10 +790,10 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
if (active) {
switch (old) {
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PULL:
GST_DEBUG_OBJECT (pad, "activating pad from pull, was ok");
goto was_ok;
case GST_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PUSH:
GST_DEBUG_OBJECT (pad,
"activating pad from push, deactivate push first");
/* pad was activate in the wrong direction, deactivate it
@ -801,16 +801,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_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_DEBUG_OBJECT (pad, "activating pad from none");
break;
}
} else {
switch (old) {
case GST_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_DEBUG_OBJECT (pad, "deactivating pad from none, was ok");
goto was_ok;
case GST_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_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... */
@ -818,7 +818,7 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
goto deactivate_failed;
/* everything is fine now */
goto was_ok;
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PULL:
GST_DEBUG_OBJECT (pad, "deactivating pad from pull");
break;
}
@ -845,7 +845,7 @@ gst_pad_activate_pull (GstPad * pad, gboolean active)
getrange function */
}
new = active ? GST_ACTIVATE_PULL : GST_ACTIVATE_NONE;
new = active ? GST_PAD_ACTIVATE_PULL : GST_PAD_ACTIVATE_NONE;
pre_activate (pad, new);
if (GST_PAD_ACTIVATEPULLFUNC (pad)) {
@ -919,7 +919,7 @@ failure:
gboolean
gst_pad_activate_push (GstPad * pad, gboolean active)
{
GstActivateMode old, new;
GstPadActivateMode 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",
@ -931,10 +931,10 @@ gst_pad_activate_push (GstPad * pad, gboolean active)
if (active) {
switch (old) {
case GST_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PUSH:
GST_DEBUG_OBJECT (pad, "activating pad from push, was ok");
goto was_ok;
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_PULL:
GST_DEBUG_OBJECT (pad,
"activating pad from push, deactivating pull first");
/* pad was activate in the wrong direction, deactivate it
@ -942,16 +942,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_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_DEBUG_OBJECT (pad, "activating pad from none");
break;
}
} else {
switch (old) {
case GST_ACTIVATE_NONE:
case GST_PAD_ACTIVATE_NONE:
GST_DEBUG_OBJECT (pad, "deactivating pad from none, was ok");
goto was_ok;
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_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... */
@ -959,13 +959,13 @@ gst_pad_activate_push (GstPad * pad, gboolean active)
goto deactivate_failed;
/* everything is fine now */
goto was_ok;
case GST_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PUSH:
GST_DEBUG_OBJECT (pad, "deactivating pad from push");
break;
}
}
new = active ? GST_ACTIVATE_PUSH : GST_ACTIVATE_NONE;
new = active ? GST_PAD_ACTIVATE_PUSH : GST_PAD_ACTIVATE_NONE;
pre_activate (pad, new);
if (GST_PAD_ACTIVATEPUSHFUNC (pad)) {
@ -1066,16 +1066,16 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
GST_OBJECT_LOCK (pad);
/* FIXME : I'm not checking for != GST_ACTIVATE_correct_direction
/* FIXME : I'm not checking for != GST_PAD_ACTIVATE_correct_direction
* because the pad might not be activated yet.
* This means that _add_probe() might return a valid probeid ...
* which will potentially never be called if the pad
* is activated in the wrong direction */
if (G_UNLIKELY ((mask & GST_PAD_PROBE_TYPE_PUSH) &&
(GST_PAD_ACTIVATE_MODE (pad) == GST_ACTIVATE_PULL)))
(GST_PAD_ACTIVATE_MODE (pad) == GST_PAD_ACTIVATE_PULL)))
goto wrong_direction;
if (G_UNLIKELY ((mask & GST_PAD_PROBE_TYPE_PULL) &&
(GST_PAD_ACTIVATE_MODE (pad) == GST_ACTIVATE_PUSH)))
(GST_PAD_ACTIVATE_MODE (pad) == GST_PAD_ACTIVATE_PUSH)))
goto wrong_direction;
/* make a new probe */
@ -4451,7 +4451,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_ACTIVATE_NONE)) {
if (G_LIKELY (GST_PAD_ACTIVATE_MODE (pad) != GST_PAD_ACTIVATE_NONE)) {
GST_PAD_UNSET_FLUSHING (pad);
GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "cleared flush flag");
}

View file

@ -212,20 +212,20 @@ typedef enum {
#define GST_PAD_LINK_CHECK_DEFAULT ((GstPadLinkCheck) (GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS))
/**
* GstActivateMode:
* @GST_ACTIVATE_NONE: Pad will not handle dataflow
* @GST_ACTIVATE_PUSH: Pad handles dataflow in downstream push mode
* @GST_ACTIVATE_PULL: Pad handles dataflow in upstream pull mode
* 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
*
* The status of a GstPad. After activating a pad, which usually happens when the
* parent element goes from READY to PAUSED, the GstActivateMode defines if the
* parent element goes from READY to PAUSED, the GstPadActivateMode defines if the
* pad operates in push or pull mode.
*/
typedef enum {
GST_ACTIVATE_NONE,
GST_ACTIVATE_PUSH,
GST_ACTIVATE_PULL
} GstActivateMode;
GST_PAD_ACTIVATE_NONE,
GST_PAD_ACTIVATE_PUSH,
GST_PAD_ACTIVATE_PULL
} GstPadActivateMode;
/* pad states */
/**
@ -630,7 +630,7 @@ struct _GstPad {
GstPadAcceptCapsFunction acceptcapsfunc;
GstPadFixateCapsFunction fixatecapsfunc;
GstActivateMode mode;
GstPadActivateMode mode;
GstPadActivateFunction activatefunc;
GstPadActivateModeFunction activatepushfunc;
GstPadActivateModeFunction activatepullfunc;
@ -712,7 +712,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_ACTIVATE_NONE)
#define GST_PAD_IS_ACTIVE(pad) (GST_PAD_ACTIVATE_MODE(pad) != GST_PAD_ACTIVATE_NONE)
#define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED))
#define GST_PAD_IS_BLOCKING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKING))

View file

@ -226,7 +226,7 @@ static const GstFormat fmtlist[] = {
struct _GstBaseParsePrivate
{
GstActivateMode pad_mode;
GstPadActivateMode pad_mode;
GstAdapter *adapter;
@ -555,7 +555,7 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass)
parse->priv->adapter = gst_adapter_new ();
parse->priv->pad_mode = GST_ACTIVATE_NONE;
parse->priv->pad_mode = GST_PAD_ACTIVATE_NONE;
g_static_mutex_init (&parse->priv->index_lock);
@ -1699,7 +1699,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_ACTIVATE_PULL) {
&& parse->priv->pad_mode == GST_PAD_ACTIVATE_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
@ -1833,7 +1833,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_ACTIVATE_PULL ||
(parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL ||
parse->priv->upstream_seekable)) {
/* segment times are typically estimates,
* actual frame data might lead subclass to different timestamps,
@ -1901,7 +1901,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_ACTIVATE_PULL ? "loop" : "chain");
parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL ? "loop" : "chain");
gst_pad_push_event (parse->srcpad, pending_segment);
/* have caps; check identity */
@ -1986,7 +1986,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_ACTIVATE_PUSH &&
(parse->priv->pad_mode == GST_PAD_ACTIVATE_PUSH &&
!parse->priv->upstream_seekable)))
ret = GST_FLOW_OK;
}
@ -2939,7 +2939,7 @@ gst_base_parse_activate (GstBaseParse * parse, gboolean active)
klass = GST_BASE_PARSE_GET_CLASS (parse);
if (active) {
if (parse->priv->pad_mode == GST_ACTIVATE_NONE && klass->start)
if (parse->priv->pad_mode == GST_PAD_ACTIVATE_NONE && klass->start)
result = klass->start (parse);
/* If the subclass implements ::detect we want to
@ -2951,10 +2951,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_ACTIVATE_NONE && klass->stop)
if (parse->priv->pad_mode != GST_PAD_ACTIVATE_NONE && klass->stop)
result = klass->stop (parse);
parse->priv->pad_mode = GST_ACTIVATE_NONE;
parse->priv->pad_mode = GST_PAD_ACTIVATE_NONE;
}
GST_DEBUG_OBJECT (parse, "activate return: %d", result);
return result;
@ -2973,7 +2973,8 @@ 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_ACTIVATE_PUSH : GST_ACTIVATE_NONE;
parse->priv->pad_mode =
active ? GST_PAD_ACTIVATE_PUSH : GST_PAD_ACTIVATE_NONE;
GST_DEBUG_OBJECT (parse, "sink activate push return: %d", result);
@ -3005,7 +3006,8 @@ gst_base_parse_sink_activate_pull (GstPad * sinkpad, gboolean active)
}
if (result)
parse->priv->pad_mode = active ? GST_ACTIVATE_PULL : GST_ACTIVATE_NONE;
parse->priv->pad_mode =
active ? GST_PAD_ACTIVATE_PULL : GST_PAD_ACTIVATE_NONE;
GST_DEBUG_OBJECT (parse, "sink activate pull return: %d", result);
@ -3549,7 +3551,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_ACTIVATE_PULL || !hpos ||
if (parse->priv->pad_mode != GST_PAD_ACTIVATE_PULL || !hpos ||
!GST_CLOCK_TIME_IS_VALID (ltime) ||
(!GST_CLOCK_TIME_IS_VALID (htime) && time != G_MAXINT64)) {
return GST_FLOW_OK;
@ -3709,7 +3711,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_ACTIVATE_PUSH)
if (rate < 0.0 && parse->priv->pad_mode == GST_PAD_ACTIVATE_PUSH)
goto negative_rate;
if (cur_type != GST_SEEK_TYPE_SET ||
@ -3779,7 +3781,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_ACTIVATE_PULL) {
if (parse->priv->pad_mode == GST_PAD_ACTIVATE_PULL) {
gint64 last_stop;
GST_DEBUG_OBJECT (parse, "seek in PULL mode");

View file

@ -575,7 +575,7 @@ gst_base_sink_pad_getcaps (GstPad * pad, GstCaps * filter)
bsink = GST_BASE_SINK (gst_pad_get_parent (pad));
bclass = GST_BASE_SINK_GET_CLASS (bsink);
if (bsink->pad_mode == GST_ACTIVATE_PULL) {
if (bsink->pad_mode == GST_PAD_ACTIVATE_PULL) {
/* if we are operating in pull mode we only accept the negotiated caps */
caps = gst_pad_get_current_caps (pad);
}
@ -650,7 +650,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_ACTIVATE_NONE;
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
basesink->preroll_lock = g_mutex_new ();
basesink->preroll_cond = g_cond_new ();
priv->preroll_queue = g_queue_new ();
@ -3289,7 +3289,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_ACTIVATE_PUSH) {
if (basesink->pad_mode == GST_PAD_ACTIVATE_PUSH) {
/* we need new segment info after the flush. */
basesink->have_newsegment = FALSE;
if (reset_time) {
@ -3607,7 +3607,7 @@ gst_base_sink_chain_main (GstBaseSink * basesink, GstPad * pad,
{
GstFlowReturn result;
if (G_UNLIKELY (basesink->pad_mode != GST_ACTIVATE_PUSH))
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_ACTIVATE_PUSH))
goto wrong_mode;
GST_BASE_SINK_PREROLL_LOCK (basesink);
@ -3988,7 +3988,7 @@ gst_base_sink_loop (GstPad * pad)
basesink = GST_BASE_SINK (GST_OBJECT_PARENT (pad));
g_assert (basesink->pad_mode == GST_ACTIVATE_PULL);
g_assert (basesink->pad_mode == GST_PAD_ACTIVATE_PULL);
if ((blocksize = basesink->priv->blocksize) == 0)
blocksize = -1;
@ -4156,7 +4156,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_ACTIVATE_PULL;
basesink->pad_mode = GST_PAD_ACTIVATE_PULL;
/* we first try to negotiate a format so that when we try to activate
* downstream, it knows about our format */
@ -4208,19 +4208,19 @@ gst_base_sink_pad_activate_push (GstPad * pad, gboolean active)
if (active) {
if (!basesink->can_activate_push) {
result = FALSE;
basesink->pad_mode = GST_ACTIVATE_NONE;
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
} else {
result = TRUE;
basesink->pad_mode = GST_ACTIVATE_PUSH;
basesink->pad_mode = GST_PAD_ACTIVATE_PUSH;
}
} else {
if (G_UNLIKELY (basesink->pad_mode != GST_ACTIVATE_PUSH)) {
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_ACTIVATE_PUSH)) {
g_warning ("Internal GStreamer activation error!!!");
result = FALSE;
} else {
gst_base_sink_set_flushing (basesink, pad, TRUE);
result = TRUE;
basesink->pad_mode = GST_ACTIVATE_NONE;
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
}
}
@ -4339,14 +4339,14 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
goto activate_failed;
} else {
if (G_UNLIKELY (basesink->pad_mode != GST_ACTIVATE_PULL)) {
if (G_UNLIKELY (basesink->pad_mode != GST_PAD_ACTIVATE_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_ACTIVATE_NONE;
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
/* clear any pending caps */
GST_OBJECT_LOCK (basesink);
gst_caps_replace (&basesink->priv->pull_caps, NULL);
@ -4361,7 +4361,7 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
activate_failed:
{
/* reset, as starting the thread failed */
basesink->pad_mode = GST_ACTIVATE_NONE;
basesink->pad_mode = GST_PAD_ACTIVATE_NONE;
GST_ERROR_OBJECT (basesink, "subclass failed to activate in pull mode");
return FALSE;
@ -4375,7 +4375,7 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
GstPad *pad;
GstBaseSink *basesink = GST_BASE_SINK (element);
gboolean forward, result = TRUE;
GstActivateMode mode;
GstPadActivateMode mode;
GST_OBJECT_LOCK (element);
/* get the pad and the scheduling mode */
@ -4413,7 +4413,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_ACTIVATE_PULL)
if (mode == GST_PAD_ACTIVATE_PULL)
result = gst_base_sink_perform_seek (basesink, pad, event);
break;
case GST_EVENT_STEP:
@ -4471,7 +4471,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_ACTIVATE_PUSH)
if (basesink->pad_mode == GST_PAD_ACTIVATE_PUSH)
segment = &basesink->clip_segment;
else
segment = &basesink->segment;
@ -4681,7 +4681,7 @@ gst_base_sink_get_duration (GstBaseSink * basesink, GstFormat format,
{
gboolean res = FALSE;
if (basesink->pad_mode == GST_ACTIVATE_PULL) {
if (basesink->pad_mode == GST_PAD_ACTIVATE_PULL) {
gint64 uduration;
/* get the duration in bytes, in pull mode that's all we are sure to
@ -4830,7 +4830,7 @@ default_element_query (GstElement * element, GstQuery * query)
break;
case GST_QUERY_SEGMENT:
{
if (basesink->pad_mode == GST_ACTIVATE_PULL) {
if (basesink->pad_mode == GST_PAD_ACTIVATE_PULL) {
gst_query_set_segment (query, basesink->segment.rate,
GST_FORMAT_TIME, basesink->segment.start, basesink->segment.stop);
res = TRUE;

View file

@ -71,7 +71,7 @@ struct _GstBaseSink {
/*< protected >*/
GstPad *sinkpad;
GstActivateMode pad_mode;
GstPadActivateMode pad_mode;
/*< protected >*/ /* with LOCK */
guint64 offset;

View file

@ -1696,9 +1696,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_ACTIVATE_PULL)
if (GST_PAD_ACTIVATE_MODE (src->srcpad) == GST_PAD_ACTIVATE_PULL)
goto wrong_mode;
started = GST_PAD_ACTIVATE_MODE (src->srcpad) == GST_ACTIVATE_PUSH;
started = GST_PAD_ACTIVATE_MODE (src->srcpad) == GST_PAD_ACTIVATE_PUSH;
GST_OBJECT_UNLOCK (src->srcpad);
if (started) {
@ -3070,7 +3070,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_ACTIVATE_PUSH);
start = (GST_PAD_ACTIVATE_MODE (basesrc->srcpad) == GST_PAD_ACTIVATE_PUSH);
GST_OBJECT_UNLOCK (basesrc->srcpad);
if (start)
gst_pad_start_task (basesrc->srcpad, (GstTaskFunction) gst_base_src_loop,

View file

@ -240,7 +240,7 @@ struct _GstBaseTransformPrivate
/* previous buffer had a discont */
gboolean discont;
GstActivateMode pad_mode;
GstPadActivateMode pad_mode;
gboolean gap_aware;
@ -438,7 +438,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_ACTIVATE_NONE;
trans->priv->pad_mode = GST_PAD_ACTIVATE_NONE;
trans->priv->gap_aware = FALSE;
trans->passthrough = FALSE;
@ -1261,7 +1261,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_ACTIVATE_PULL) {
if (pad == trans->srcpad && trans->priv->pad_mode == GST_PAD_ACTIVATE_PULL) {
/* FIXME hm? */
ret &= gst_pad_push_event (otherpeer, gst_event_new_caps (othercaps));
if (!ret) {
@ -2129,7 +2129,7 @@ gst_base_transform_activate (GstBaseTransform * trans, gboolean active)
if (active) {
GstCaps *incaps, *outcaps;
if (trans->priv->pad_mode == GST_ACTIVATE_NONE && bclass->start)
if (trans->priv->pad_mode == GST_PAD_ACTIVATE_NONE && bclass->start)
result &= bclass->start (trans);
incaps = gst_pad_get_current_caps (trans->sinkpad);
@ -2172,7 +2172,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_ACTIVATE_NONE && bclass->stop)
if (trans->priv->pad_mode != GST_PAD_ACTIVATE_NONE && bclass->stop)
result &= bclass->stop (trans);
gst_base_transform_set_allocation (trans, NULL, NULL, 0, 0);
@ -2192,7 +2192,8 @@ 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_ACTIVATE_PUSH : GST_ACTIVATE_NONE;
trans->priv->pad_mode =
active ? GST_PAD_ACTIVATE_PUSH : GST_PAD_ACTIVATE_NONE;
gst_object_unref (trans);
@ -2213,7 +2214,8 @@ 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_ACTIVATE_PULL : GST_ACTIVATE_NONE;
trans->priv->pad_mode =
active ? GST_PAD_ACTIVATE_PULL : GST_PAD_ACTIVATE_NONE;
gst_object_unref (trans);

View file

@ -244,7 +244,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_ACTIVATE_NONE;
tee->sink_mode = GST_PAD_ACTIVATE_NONE;
gst_pad_set_event_function (tee->sinkpad,
GST_DEBUG_FUNCPTR (gst_tee_sink_event));
@ -289,7 +289,7 @@ gst_tee_request_new_pad (GstElement * element, GstPadTemplate * templ,
gchar *name;
GstPad *srcpad;
GstTee *tee;
GstActivateMode mode;
GstPadActivateMode mode;
gboolean res;
PushData *data;
@ -316,10 +316,10 @@ gst_tee_request_new_pad (GstElement * element, GstPadTemplate * templ,
GST_OBJECT_UNLOCK (tee);
switch (mode) {
case GST_ACTIVATE_PULL:
case GST_PAD_ACTIVATE_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_ACTIVATE_PUSH:
case GST_PAD_ACTIVATE_PUSH:
res = gst_pad_activate_push (srcpad, TRUE);
break;
default:
@ -757,7 +757,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_ACTIVATE_PUSH;
tee->sink_mode = active && GST_PAD_ACTIVATE_PUSH;
if (active && !tee->has_chain)
goto no_chain;
@ -810,7 +810,7 @@ gst_tee_src_activate_pull (GstPad * pad, gboolean active)
if (pad == tee->pull_pad)
tee->pull_pad = NULL;
}
tee->sink_mode = active & GST_ACTIVATE_PULL;
tee->sink_mode = active & GST_PAD_ACTIVATE_PULL;
GST_OBJECT_UNLOCK (tee);
gst_object_unref (tee);

View file

@ -78,7 +78,7 @@ struct _GstTee {
gboolean silent;
gchar *last_message;
GstActivateMode sink_mode;
GstPadActivateMode sink_mode;
GstTeePullMode pull_mode;
GstPad *pull_pad;
};

View file

@ -1153,14 +1153,14 @@ gst_activate_mode_get_type (void)
{
static gsize id = 0;
static const GEnumValue values[] = {
{C_ENUM (GST_ACTIVATE_NONE), "GST_ACTIVATE_NONE", "none"},
{C_ENUM (GST_ACTIVATE_PUSH), "GST_ACTIVATE_PUSH", "push"},
{C_ENUM (GST_ACTIVATE_PULL), "GST_ACTIVATE_PULL", "pull"},
{C_ENUM (GST_PAD_ACTIVATE_NONE), "GST_PAD_ACTIVATE_NONE", "none"},
{C_ENUM (GST_PAD_ACTIVATE_PUSH), "GST_PAD_ACTIVATE_PUSH", "push"},
{C_ENUM (GST_PAD_ACTIVATE_PULL), "GST_PAD_ACTIVATE_PULL", "pull"},
{0, NULL, NULL}
};
if (g_once_init_enter (&id)) {
GType tmp = g_enum_register_static ("GstActivateMode", values);
GType tmp = g_enum_register_static ("GstPadActivateMode", values);
g_once_init_leave (&id, tmp);
}

View file

@ -51,7 +51,6 @@ EXPORTS
_gst_trace_add_entry
_gst_trace_mutex DATA
_gst_trace_on DATA
gst_activate_mode_get_type
gst_alloc_trace_available
gst_alloc_trace_flags_get_type
gst_alloc_trace_get
@ -645,6 +644,7 @@ EXPORTS
gst_object_unparent
gst_object_unref
gst_pad_accept_caps
gst_pad_activate_mode_get_type
gst_pad_activate_pull
gst_pad_activate_push
gst_pad_add_probe