mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
Update for pad API changes
GstProbeType, GstProbeReturn and GstActivateMode -> GstPad*
This commit is contained in:
parent
93ed9cd687
commit
10d31a588d
6 changed files with 31 additions and 30 deletions
|
@ -488,7 +488,8 @@ gst_signal_processor_setcaps (GstPad * pad, GstCaps * caps)
|
|||
|
||||
self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad));
|
||||
|
||||
if (self->mode == GST_ACTIVATE_PULL && !gst_caps_is_equal (caps, self->caps)
|
||||
if (self->mode == GST_PAD_ACTIVATE_PULL
|
||||
&& !gst_caps_is_equal (caps, self->caps)
|
||||
&& !gst_signal_processor_setcaps_pull (self, pad, caps))
|
||||
goto setcaps_pull_failed;
|
||||
|
||||
|
@ -1076,20 +1077,20 @@ gst_signal_processor_sink_activate_push (GstPad * pad, gboolean active)
|
|||
self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad));
|
||||
|
||||
if (active) {
|
||||
if (self->mode == GST_ACTIVATE_NONE) {
|
||||
self->mode = GST_ACTIVATE_PUSH;
|
||||
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||
self->mode = GST_PAD_ACTIVATE_PUSH;
|
||||
result = TRUE;
|
||||
} else if (self->mode == GST_ACTIVATE_PUSH) {
|
||||
} else if (self->mode == GST_PAD_ACTIVATE_PUSH) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
g_warning ("foo");
|
||||
result = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (self->mode == GST_ACTIVATE_NONE) {
|
||||
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||
result = TRUE;
|
||||
} else if (self->mode == GST_ACTIVATE_PUSH) {
|
||||
self->mode = GST_ACTIVATE_NONE;
|
||||
} else if (self->mode == GST_PAD_ACTIVATE_PUSH) {
|
||||
self->mode = GST_PAD_ACTIVATE_NONE;
|
||||
result = TRUE;
|
||||
} else {
|
||||
g_warning ("foo");
|
||||
|
@ -1113,29 +1114,29 @@ gst_signal_processor_src_activate_pull (GstPad * pad, gboolean active)
|
|||
self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad));
|
||||
|
||||
if (active) {
|
||||
if (self->mode == GST_ACTIVATE_NONE) {
|
||||
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||
GList *l;
|
||||
|
||||
for (l = GST_ELEMENT (self)->sinkpads; l; l = l->next)
|
||||
result &= gst_pad_activate_pull (pad, active);
|
||||
if (result)
|
||||
self->mode = GST_ACTIVATE_PULL;
|
||||
} else if (self->mode == GST_ACTIVATE_PULL) {
|
||||
self->mode = GST_PAD_ACTIVATE_PULL;
|
||||
} else if (self->mode == GST_PAD_ACTIVATE_PULL) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
g_warning ("foo");
|
||||
result = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (self->mode == GST_ACTIVATE_NONE) {
|
||||
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||
result = TRUE;
|
||||
} else if (self->mode == GST_ACTIVATE_PULL) {
|
||||
} else if (self->mode == GST_PAD_ACTIVATE_PULL) {
|
||||
GList *l;
|
||||
|
||||
for (l = GST_ELEMENT (self)->sinkpads; l; l = l->next)
|
||||
result &= gst_pad_activate_pull (pad, active);
|
||||
if (result)
|
||||
self->mode = GST_ACTIVATE_NONE;
|
||||
self->mode = GST_PAD_ACTIVATE_NONE;
|
||||
result = TRUE;
|
||||
} else {
|
||||
g_warning ("foo");
|
||||
|
|
|
@ -82,7 +82,7 @@ struct _GstSignalProcessor {
|
|||
GstCaps *caps;
|
||||
GstSignalProcessorState state;
|
||||
GstFlowReturn flow_state;
|
||||
GstActivateMode mode;
|
||||
GstPadActivateMode mode;
|
||||
|
||||
/* pending inputs before processing can take place */
|
||||
guint pending_in;
|
||||
|
|
|
@ -436,10 +436,10 @@ static gboolean
|
|||
gst_raw_parse_sink_activate (GstPad * sinkpad)
|
||||
{
|
||||
if (gst_pad_check_pull_range (sinkpad)) {
|
||||
GST_RAW_PARSE (GST_PAD_PARENT (sinkpad))->mode = GST_ACTIVATE_PULL;
|
||||
GST_RAW_PARSE (GST_PAD_PARENT (sinkpad))->mode = GST_PAD_ACTIVATE_PULL;
|
||||
return gst_pad_activate_pull (sinkpad, TRUE);
|
||||
} else {
|
||||
GST_RAW_PARSE (GST_PAD_PARENT (sinkpad))->mode = GST_ACTIVATE_PUSH;
|
||||
GST_RAW_PARSE (GST_PAD_PARENT (sinkpad))->mode = GST_PAD_ACTIVATE_PUSH;
|
||||
return gst_pad_activate_push (sinkpad, TRUE);
|
||||
}
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ gst_raw_parse_src_event (GstPad * pad, GstEvent * event)
|
|||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEEK:
|
||||
if (rp->mode == GST_ACTIVATE_PUSH)
|
||||
if (rp->mode == GST_PAD_ACTIVATE_PUSH)
|
||||
ret = gst_raw_parse_handle_seek_push (rp, event);
|
||||
else
|
||||
ret = gst_raw_parse_handle_seek_pull (rp, event);
|
||||
|
@ -996,7 +996,7 @@ gst_raw_parse_src_query (GstPad * pad, GstQuery * query)
|
|||
if (fmt != GST_FORMAT_TIME && fmt != GST_FORMAT_DEFAULT
|
||||
&& fmt != GST_FORMAT_BYTES) {
|
||||
gst_query_set_seeking (query, fmt, FALSE, -1, -1);
|
||||
} else if (rp->mode == GST_ACTIVATE_PUSH) {
|
||||
} else if (rp->mode == GST_PAD_ACTIVATE_PUSH) {
|
||||
GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES);
|
||||
gboolean seekable;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ struct _GstRawParse
|
|||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
|
||||
GstActivateMode mode;
|
||||
GstPadActivateMode mode;
|
||||
GstAdapter *adapter;
|
||||
|
||||
gint framesize;
|
||||
|
|
|
@ -99,8 +99,8 @@ static void dvb_base_bin_get_property (GObject * object, guint prop_id,
|
|||
static void dvb_base_bin_dispose (GObject * object);
|
||||
static void dvb_base_bin_finalize (GObject * object);
|
||||
|
||||
static GstProbeReturn dvb_base_bin_ts_pad_probe_cb (GstPad * pad,
|
||||
GstProbeType type, gpointer data, gpointer user_data);
|
||||
static GstPadProbeReturn dvb_base_bin_ts_pad_probe_cb (GstPad * pad,
|
||||
GstPadProbeType type, gpointer data, gpointer user_data);
|
||||
static GstStateChangeReturn dvb_base_bin_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
static void dvb_base_bin_handle_message (GstBin * bin, GstMessage * message);
|
||||
|
@ -527,8 +527,8 @@ dvb_base_bin_reset_pmtlist (DvbBaseBin * dvbbasebin)
|
|||
dvbbasebin->pmtlist_changed = FALSE;
|
||||
}
|
||||
|
||||
static GstProbeReturn
|
||||
dvb_base_bin_ts_pad_probe_cb (GstPad * pad, GstProbeType type,
|
||||
static GstPadProbeReturn
|
||||
dvb_base_bin_ts_pad_probe_cb (GstPad * pad, GstPadProbeType type,
|
||||
gpointer data, gpointer user_data)
|
||||
{
|
||||
DvbBaseBin *dvbbasebin = GST_DVB_BASE_BIN (user_data);
|
||||
|
@ -546,7 +546,7 @@ dvb_base_bin_ts_pad_probe_cb (GstPad * pad, GstProbeType type,
|
|||
}
|
||||
}
|
||||
|
||||
return GST_PROBE_OK;
|
||||
return GST_PAD_PROBE_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -564,7 +564,7 @@ dvb_base_bin_init_cam (DvbBaseBin * dvbbasebin)
|
|||
/* HACK: poll the cam in a buffer probe */
|
||||
dvbbasebin->ts_pad =
|
||||
gst_element_get_request_pad (dvbbasebin->mpegtsparse, "src%d");
|
||||
gst_pad_add_probe (dvbbasebin->ts_pad, GST_PROBE_TYPE_BLOCK,
|
||||
gst_pad_add_probe (dvbbasebin->ts_pad, GST_PAD_PROBE_TYPE_BLOCK,
|
||||
dvb_base_bin_ts_pad_probe_cb, dvbbasebin, NULL);
|
||||
} else {
|
||||
GST_ERROR_OBJECT (dvbbasebin, "could not open %s", ca_file);
|
||||
|
|
|
@ -178,8 +178,8 @@ static gboolean setup_add_pad_probe (GstElement * elem, const gchar * pad_name,
|
|||
* Callbacks
|
||||
*/
|
||||
|
||||
static GstProbeReturn
|
||||
pad_has_buffer (GstPad * pad, GstProbeType type, gpointer type_data,
|
||||
static GstPadProbeReturn
|
||||
pad_has_buffer (GstPad * pad, GstPadProbeType type, gpointer type_data,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean *signal_sink = (gboolean *) user_data;
|
||||
|
@ -210,7 +210,7 @@ pad_has_buffer (GstPad * pad, GstProbeType type, gpointer type_data,
|
|||
print_result ();
|
||||
g_idle_add ((GSourceFunc) run_test, NULL);
|
||||
}
|
||||
return GST_PROBE_OK;
|
||||
return GST_PAD_PROBE_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -488,8 +488,8 @@ setup_add_pad_probe (GstElement * elem, const gchar * pad_name,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK | GST_PROBE_TYPE_BUFFER, handler,
|
||||
data, NULL);
|
||||
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_BUFFER,
|
||||
handler, data, NULL);
|
||||
gst_object_unref (pad);
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue