VERSION, GST_LICENSE, PACKAGE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
}
+/* test helpers */
+
typedef struct
{
GstEvent *event;
start_flow (chain_data);
- GST_DEBUG ("Pushing buffer on pad: %s:%s",
- GST_DEBUG_PAD_NAME (chain_data->sinkpad));
+ GST_INFO_OBJECT (chain_data->sinkpad, "Pushing buffer %" GST_PTR_FORMAT,
+ chain_data->buffer);
flow = gst_pad_push (chain_data->srcpad, chain_data->buffer);
fail_unless (flow == chain_data->expected_result,
"got flow %s instead of %s on %s:%s", gst_flow_get_name (flow),
{
ChainData *chain_data = (ChainData *) user_data;
GstTestAggregator *aggregator = (GstTestAggregator *) chain_data->aggregator;
- GstEventType event_type;
+ GstEventType event_type = GST_EVENT_TYPE (chain_data->event);
start_flow (chain_data);
- GST_INFO_OBJECT (chain_data->srcpad, "Pushing event: %"
- GST_PTR_FORMAT, chain_data->event);
+ GST_INFO_OBJECT (chain_data->sinkpad, "Pushing event: %" GST_PTR_FORMAT,
+ chain_data->event);
- event_type = GST_EVENT_TYPE (chain_data->event);
switch (event_type) {
case GST_EVENT_GAP:
aggregator->gap_expected = TRUE;
fail_unless (gst_pad_push_event (chain_data->srcpad,
chain_data->event) == TRUE);
-
+ chain_data->event = NULL;
return NULL;
}
}
static GstPadProbeReturn
-downstream_probe_cb (GstPad * pad, GstPadProbeInfo * info, TestData * test)
+_downstream_probe_cb (GstPad * pad, GstPadProbeInfo * info, TestData * test)
{
GST_DEBUG ("PROBING ");
if (info->type & GST_PAD_PROBE_TYPE_EVENT_FLUSH) {
return GST_PAD_PROBE_OK;
}
-
/*
* Not thread safe, will create a new ChainData which contains
* an activated src pad linked to a requested sink pad of @agg, and
static void
_chain_data_clear (ChainData * data)
{
- if (data->buffer)
- gst_buffer_unref (data->buffer);
+ gst_buffer_replace (&data->buffer, NULL);
+ gst_event_replace (&data->event, NULL);
if (data->srcpad)
gst_object_unref (data->srcpad);
if (data->sinkpad)
test->ml = g_main_loop_new (NULL, TRUE);
test->srcpad = GST_AGGREGATOR (test->aggregator)->srcpad;
- GST_DEBUG ("Srcpad: %p", test->srcpad);
+ GST_DEBUG_OBJECT (test->srcpad, "Init test data for srcpad");
if (needs_flushing) {
static gint num_sink_pads = 0;
g_free (pad_name);
fail_unless (gst_pad_link (test->srcpad, test->sinkpad) == GST_PAD_LINK_OK);
gst_pad_add_probe (test->srcpad, GST_PAD_PROBE_TYPE_EVENT_FLUSH,
- (GstPadProbeCallback) downstream_probe_cb, test, NULL);
+ (GstPadProbeCallback) _downstream_probe_cb, test, NULL);
} else {
gst_pad_add_probe (test->srcpad, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) _aggregated_cb, test->ml, NULL);
}
-
test->timeout_id =
g_timeout_add (1000, (GSourceFunc) _aggregate_timeout, test->ml);
}
g_main_loop_unref (test->ml);
}
+/* tests */
+
GST_START_TEST (test_aggregate)
{
GThread *thread1, *thread2;
-
ChainData data1 = { 0, };
ChainData data2 = { 0, };
TestData test = { 0, };
g_main_loop_run (test.ml);
g_source_remove (test.timeout_id);
-
/* these will return immediately as when the data is popped the threads are
* unlocked and will terminate */
g_thread_join (thread1);
GST_START_TEST (test_aggregate_eos)
{
GThread *thread1, *thread2;
-
ChainData data1 = { 0, };
ChainData data2 = { 0, };
TestData test = { 0, };
GST_START_TEST (test_aggregate_gap)
{
GThread *thread;
-
ChainData data = { 0, };
TestData test = { 0, };
GstBus *bus;
GstMessage *msg;
GstElement *pipeline, *src, *agg, *sink;
-
gint count = 0;
pipeline = gst_pipeline_new ("pipeline");
GstBus *bus;
GstMessage *msg;
GstElement *pipeline, *src, *src1, *agg, *sink;
-
gint count = 0;
pipeline = gst_pipeline_new ("pipeline");
GstMessage *msg;
GstElement *pipeline, *src, *src1, *agg, *sink;
GstPad *src1pad;
-
gint count = 0;
pipeline = gst_pipeline_new ("pipeline");
{
GstEvent *event;
GThread *thread1, *thread2;
-
ChainData data1 = { 0, };
ChainData data2 = { 0, };
TestData test = { 0, };
GstBus *bus;
GstMessage *message;
GstElement *pipeline, *src, *agg, *sink;
-
gint count = 0, i;
gboolean seek_res, carry_on = TRUE;
- gst_init (NULL, NULL);
-
pipeline = gst_pipeline_new ("pipeline");
agg = gst_check_setup_element ("testaggregator");
/* Used to notify that we removed the pad from */
GCond cond;
GMutex lock;
-
GstBus *bus;
GstState state;
GstMessage *message;
gboolean carry_on = TRUE;
guint num_iterations = 100;
-
GstPad *pad;
GstElement *pipeline, *src, *src1 = NULL, *agg, *sink;
-
gint count = 0;
- gst_init (NULL, NULL);
g_mutex_init (&lock);
g_cond_init (&cond);
GstBus *bus;
GstMessage *message;
GstElement *pipeline, *src, *agg, *sink;
-
gint i, state_i = 0, num_srcs = 3;
gboolean carry_on = TRUE, ready = FALSE;
GstStateChangeReturn state_return;
GST_STATE_PLAYING, GST_STATE_NULL, GST_STATE_PLAYING, GST_STATE_NULL,
};
- gst_init (NULL, NULL);
-
pipeline = gst_pipeline_new ("pipeline");
agg = gst_check_setup_element ("testaggregator");