From 929b8afd16e6adb3ebcb5c066bbd19bc029faa0c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 19 Sep 2005 11:24:46 +0000 Subject: [PATCH] check/pipelines/simple_launch_lines.c: Fix for bus API. Original commit message from CVS: * check/pipelines/simple_launch_lines.c: (run_pipeline): Fix for bus API. * gst-libs/gst/rtp/gstbasertpdepayload.c: (gst_base_rtp_depayload_chain), (gst_base_rtp_depayload_add_to_queue), (gst_base_rtp_depayload_push), (gst_base_rtp_depayload_set_gst_timestamp), (gst_base_rtp_depayload_queue_release): Some cleanups. * gst-libs/gst/rtp/gstbasertppayload.c: (gst_basertppayload_class_init), (gst_basertppayload_init), (gst_basertppayload_setcaps), (gst_basertppayload_set_options), (gst_basertppayload_set_outcaps), (gst_basertppayload_push), (gst_basertppayload_get_property), (gst_basertppayload_change_state): Added debugging category. --- ChangeLog | 21 +++++++++++++++++++++ check/pipelines/simple_launch_lines.c | 13 ++++++++++--- gst-libs/gst/rtp/gstbasertpdepayload.c | 9 +++------ gst-libs/gst/rtp/gstbasertppayload.c | 6 ++++++ tests/check/pipelines/simple-launch-lines.c | 13 ++++++++++--- 5 files changed, 50 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03420d8..c83f926 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2005-09-19 Wim Taymans + + * check/pipelines/simple_launch_lines.c: (run_pipeline): + Fix for bus API. + + * gst-libs/gst/rtp/gstbasertpdepayload.c: + (gst_base_rtp_depayload_chain), + (gst_base_rtp_depayload_add_to_queue), + (gst_base_rtp_depayload_push), + (gst_base_rtp_depayload_set_gst_timestamp), + (gst_base_rtp_depayload_queue_release): + Some cleanups. + + * gst-libs/gst/rtp/gstbasertppayload.c: + (gst_basertppayload_class_init), (gst_basertppayload_init), + (gst_basertppayload_setcaps), (gst_basertppayload_set_options), + (gst_basertppayload_set_outcaps), (gst_basertppayload_push), + (gst_basertppayload_get_property), + (gst_basertppayload_change_state): + Added debugging category. + 2005-09-18 David Schleef * gst/playback/gstdecodebin.c: free plugin list correctly diff --git a/check/pipelines/simple_launch_lines.c b/check/pipelines/simple_launch_lines.c index ae51d5a..19d91a3 100644 --- a/check/pipelines/simple_launch_lines.c +++ b/check/pipelines/simple_launch_lines.c @@ -47,6 +47,7 @@ run_pipeline (GstElement * pipe, const gchar * descr, GstMessageType events, GstMessageType tevent) { GstBus *bus; + GstMessage *message; GstMessageType revent; g_assert (pipe); @@ -59,11 +60,16 @@ run_pipeline (GstElement * pipe, const gchar * descr, } while (1) { - revent = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 2); + message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 2); + /* always have to pop the message before getting back into poll */ - if (revent != GST_MESSAGE_UNKNOWN) + if (message) { + revent = GST_MESSAGE_TYPE (message); gst_message_unref (gst_bus_pop (bus)); + } else { + revent = GST_MESSAGE_UNKNOWN; + } if (revent == tevent) { break; @@ -137,7 +143,8 @@ GST_START_TEST (test_basetransform_based) GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), GST_MESSAGE_UNKNOWN); } -GST_END_TEST Suite * simple_launch_lines_suite (void) +GST_END_TEST Suite * +simple_launch_lines_suite (void) { Suite *s = suite_create ("Pipelines"); TCase *tc_chain = tcase_create ("linear"); diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.c b/gst-libs/gst/rtp/gstbasertpdepayload.c index e1440f4..0ab0e9c 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.c +++ b/gst-libs/gst/rtp/gstbasertpdepayload.c @@ -211,17 +211,14 @@ static GstFlowReturn gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in) { GstBaseRTPDepayload *filter; + GstBaseRTPDepayloadClass *bclass; GstFlowReturn ret = GST_FLOW_OK; - g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); - g_return_val_if_fail (GST_BUFFER (in) != NULL, GST_FLOW_ERROR); - filter = GST_BASE_RTP_DEPAYLOAD (GST_OBJECT_PARENT (pad)); - g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (filter), GST_FLOW_ERROR); g_return_val_if_fail (filter->clock_rate > 0, GST_FLOW_ERROR); - GstBaseRTPDepayloadClass *bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); + bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); if (filter->process_only) { GST_DEBUG ("Pushing directly!"); @@ -330,7 +327,7 @@ gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter, // if this is the first buf send a discont if (first) { // send discont - GstEvent *event = gst_event_new_newsegment (1.0, GST_FORMAT_TIME, + GstEvent *event = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_TIME, ts, GST_CLOCK_TIME_NONE, 0); gst_pad_push_event (filter->srcpad, event); diff --git a/gst-libs/gst/rtp/gstbasertppayload.c b/gst-libs/gst/rtp/gstbasertppayload.c index 95b470a..a2f05b4 100644 --- a/gst-libs/gst/rtp/gstbasertppayload.c +++ b/gst-libs/gst/rtp/gstbasertppayload.c @@ -22,6 +22,9 @@ #include "gstbasertppayload.h" +GST_DEBUG_CATEGORY (basertppayload_debug); +#define GST_CAT_DEFAULT (basertppayload_debug) + /* BaseRTPPayload signals and args */ enum { @@ -131,6 +134,9 @@ gst_basertppayload_class_init (GstBaseRTPPayloadClass * klass) 0, G_MAXUINT, 0, G_PARAM_READABLE)); gstelement_class->change_state = gst_basertppayload_change_state; + + GST_DEBUG_CATEGORY_INIT (basertppayload_debug, "basertppayload", 0, + "Base class for RTP Payloaders"); } static void diff --git a/tests/check/pipelines/simple-launch-lines.c b/tests/check/pipelines/simple-launch-lines.c index ae51d5a..19d91a3 100644 --- a/tests/check/pipelines/simple-launch-lines.c +++ b/tests/check/pipelines/simple-launch-lines.c @@ -47,6 +47,7 @@ run_pipeline (GstElement * pipe, const gchar * descr, GstMessageType events, GstMessageType tevent) { GstBus *bus; + GstMessage *message; GstMessageType revent; g_assert (pipe); @@ -59,11 +60,16 @@ run_pipeline (GstElement * pipe, const gchar * descr, } while (1) { - revent = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 2); + message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 2); + /* always have to pop the message before getting back into poll */ - if (revent != GST_MESSAGE_UNKNOWN) + if (message) { + revent = GST_MESSAGE_TYPE (message); gst_message_unref (gst_bus_pop (bus)); + } else { + revent = GST_MESSAGE_UNKNOWN; + } if (revent == tevent) { break; @@ -137,7 +143,8 @@ GST_START_TEST (test_basetransform_based) GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), GST_MESSAGE_UNKNOWN); } -GST_END_TEST Suite * simple_launch_lines_suite (void) +GST_END_TEST Suite * +simple_launch_lines_suite (void) { Suite *s = suite_create ("Pipelines"); TCase *tc_chain = tcase_create ("linear"); -- 2.7.4