mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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));
|
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))
|
&& !gst_signal_processor_setcaps_pull (self, pad, caps))
|
||||||
goto setcaps_pull_failed;
|
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));
|
self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
if (self->mode == GST_ACTIVATE_NONE) {
|
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||||
self->mode = GST_ACTIVATE_PUSH;
|
self->mode = GST_PAD_ACTIVATE_PUSH;
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else if (self->mode == GST_ACTIVATE_PUSH) {
|
} else if (self->mode == GST_PAD_ACTIVATE_PUSH) {
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else {
|
} else {
|
||||||
g_warning ("foo");
|
g_warning ("foo");
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (self->mode == GST_ACTIVATE_NONE) {
|
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else if (self->mode == GST_ACTIVATE_PUSH) {
|
} else if (self->mode == GST_PAD_ACTIVATE_PUSH) {
|
||||||
self->mode = GST_ACTIVATE_NONE;
|
self->mode = GST_PAD_ACTIVATE_NONE;
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else {
|
} else {
|
||||||
g_warning ("foo");
|
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));
|
self = GST_SIGNAL_PROCESSOR (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
if (self->mode == GST_ACTIVATE_NONE) {
|
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = GST_ELEMENT (self)->sinkpads; l; l = l->next)
|
for (l = GST_ELEMENT (self)->sinkpads; l; l = l->next)
|
||||||
result &= gst_pad_activate_pull (pad, active);
|
result &= gst_pad_activate_pull (pad, active);
|
||||||
if (result)
|
if (result)
|
||||||
self->mode = GST_ACTIVATE_PULL;
|
self->mode = GST_PAD_ACTIVATE_PULL;
|
||||||
} else if (self->mode == GST_ACTIVATE_PULL) {
|
} else if (self->mode == GST_PAD_ACTIVATE_PULL) {
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else {
|
} else {
|
||||||
g_warning ("foo");
|
g_warning ("foo");
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (self->mode == GST_ACTIVATE_NONE) {
|
if (self->mode == GST_PAD_ACTIVATE_NONE) {
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else if (self->mode == GST_ACTIVATE_PULL) {
|
} else if (self->mode == GST_PAD_ACTIVATE_PULL) {
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = GST_ELEMENT (self)->sinkpads; l; l = l->next)
|
for (l = GST_ELEMENT (self)->sinkpads; l; l = l->next)
|
||||||
result &= gst_pad_activate_pull (pad, active);
|
result &= gst_pad_activate_pull (pad, active);
|
||||||
if (result)
|
if (result)
|
||||||
self->mode = GST_ACTIVATE_NONE;
|
self->mode = GST_PAD_ACTIVATE_NONE;
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else {
|
} else {
|
||||||
g_warning ("foo");
|
g_warning ("foo");
|
||||||
|
|
|
@ -82,7 +82,7 @@ struct _GstSignalProcessor {
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstSignalProcessorState state;
|
GstSignalProcessorState state;
|
||||||
GstFlowReturn flow_state;
|
GstFlowReturn flow_state;
|
||||||
GstActivateMode mode;
|
GstPadActivateMode mode;
|
||||||
|
|
||||||
/* pending inputs before processing can take place */
|
/* pending inputs before processing can take place */
|
||||||
guint pending_in;
|
guint pending_in;
|
||||||
|
|
|
@ -436,10 +436,10 @@ static gboolean
|
||||||
gst_raw_parse_sink_activate (GstPad * sinkpad)
|
gst_raw_parse_sink_activate (GstPad * sinkpad)
|
||||||
{
|
{
|
||||||
if (gst_pad_check_pull_range (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);
|
return gst_pad_activate_pull (sinkpad, TRUE);
|
||||||
} else {
|
} 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);
|
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)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
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);
|
ret = gst_raw_parse_handle_seek_push (rp, event);
|
||||||
else
|
else
|
||||||
ret = gst_raw_parse_handle_seek_pull (rp, event);
|
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
|
if (fmt != GST_FORMAT_TIME && fmt != GST_FORMAT_DEFAULT
|
||||||
&& fmt != GST_FORMAT_BYTES) {
|
&& fmt != GST_FORMAT_BYTES) {
|
||||||
gst_query_set_seeking (query, fmt, FALSE, -1, -1);
|
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);
|
GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES);
|
||||||
gboolean seekable;
|
gboolean seekable;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct _GstRawParse
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
|
|
||||||
GstActivateMode mode;
|
GstPadActivateMode mode;
|
||||||
GstAdapter *adapter;
|
GstAdapter *adapter;
|
||||||
|
|
||||||
gint framesize;
|
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_dispose (GObject * object);
|
||||||
static void dvb_base_bin_finalize (GObject * object);
|
static void dvb_base_bin_finalize (GObject * object);
|
||||||
|
|
||||||
static GstProbeReturn dvb_base_bin_ts_pad_probe_cb (GstPad * pad,
|
static GstPadProbeReturn dvb_base_bin_ts_pad_probe_cb (GstPad * pad,
|
||||||
GstProbeType type, gpointer data, gpointer user_data);
|
GstPadProbeType type, gpointer data, gpointer user_data);
|
||||||
static GstStateChangeReturn dvb_base_bin_change_state (GstElement * element,
|
static GstStateChangeReturn dvb_base_bin_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
static void dvb_base_bin_handle_message (GstBin * bin, GstMessage * message);
|
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;
|
dvbbasebin->pmtlist_changed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstProbeReturn
|
static GstPadProbeReturn
|
||||||
dvb_base_bin_ts_pad_probe_cb (GstPad * pad, GstProbeType type,
|
dvb_base_bin_ts_pad_probe_cb (GstPad * pad, GstPadProbeType type,
|
||||||
gpointer data, gpointer user_data)
|
gpointer data, gpointer user_data)
|
||||||
{
|
{
|
||||||
DvbBaseBin *dvbbasebin = GST_DVB_BASE_BIN (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
|
static void
|
||||||
|
@ -564,7 +564,7 @@ dvb_base_bin_init_cam (DvbBaseBin * dvbbasebin)
|
||||||
/* HACK: poll the cam in a buffer probe */
|
/* HACK: poll the cam in a buffer probe */
|
||||||
dvbbasebin->ts_pad =
|
dvbbasebin->ts_pad =
|
||||||
gst_element_get_request_pad (dvbbasebin->mpegtsparse, "src%d");
|
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);
|
dvb_base_bin_ts_pad_probe_cb, dvbbasebin, NULL);
|
||||||
} else {
|
} else {
|
||||||
GST_ERROR_OBJECT (dvbbasebin, "could not open %s", ca_file);
|
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
|
* Callbacks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static GstProbeReturn
|
static GstPadProbeReturn
|
||||||
pad_has_buffer (GstPad * pad, GstProbeType type, gpointer type_data,
|
pad_has_buffer (GstPad * pad, GstPadProbeType type, gpointer type_data,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gboolean *signal_sink = (gboolean *) user_data;
|
gboolean *signal_sink = (gboolean *) user_data;
|
||||||
|
@ -210,7 +210,7 @@ pad_has_buffer (GstPad * pad, GstProbeType type, gpointer type_data,
|
||||||
print_result ();
|
print_result ();
|
||||||
g_idle_add ((GSourceFunc) run_test, NULL);
|
g_idle_add ((GSourceFunc) run_test, NULL);
|
||||||
}
|
}
|
||||||
return GST_PROBE_OK;
|
return GST_PAD_PROBE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -488,8 +488,8 @@ setup_add_pad_probe (GstElement * elem, const gchar * pad_name,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK | GST_PROBE_TYPE_BUFFER, handler,
|
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_BUFFER,
|
||||||
data, NULL);
|
handler, data, NULL);
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue