pad_monitor->current_timestamp = GST_CLOCK_TIME_NONE;
pad_monitor->current_duration = GST_CLOCK_TIME_NONE;
- pad_monitor->last_flow_return = GST_FLOW_OK;
-
pad_monitor->timestamp_range_start = GST_CLOCK_TIME_NONE;
pad_monitor->timestamp_range_end = GST_CLOCK_TIME_NONE;
}
GstPad *otherpad;
GstPad *peerpad;
GstState state, pending;
- GstValidatePadMonitor *othermonitor;
GstFlowReturn aggregated = GST_FLOW_NOT_LINKED;
gboolean found_a_pad = FALSE;
GstPad *pad =
otherpad = g_value_get_object (&value);
peerpad = gst_pad_get_peer (otherpad);
if (peerpad) {
- othermonitor = _GET_PAD_MONITOR (peerpad);
- if (othermonitor) {
- found_a_pad = TRUE;
- GST_VALIDATE_MONITOR_LOCK (othermonitor);
- aggregated =
- _combine_flows (aggregated, othermonitor->last_flow_return);
- GST_VALIDATE_MONITOR_UNLOCK (othermonitor);
- }
+ found_a_pad = TRUE;
+ aggregated =
+ _combine_flows (aggregated,
+ gst_pad_get_last_flow_return (peerpad));
gst_object_unref (peerpad);
}
GST_VALIDATE_PAD_MONITOR_PARENT_LOCK (pad_monitor);
GST_VALIDATE_MONITOR_LOCK (pad_monitor);
- pad_monitor->last_flow_return = ret;
if (ret == GST_FLOW_EOS) {
mark_pads_eos (pad_monitor);
}
TRUE));
}
-static GstValidatePadMonitor *
-_get_pad_monitor (GstPad * pad)
-{
- GstValidatePadMonitor *m = get_pad_monitor (pad);
-
- gst_object_unref (pad);
-
- return m;
-}
-
static void
_test_flow_aggregation (GstFlowReturn flow, GstFlowReturn flow1,
GstFlowReturn flow2, GstFlowReturn demux_flow, gboolean should_fail)
{
GstPad *srcpad;
GstValidateReport *report;
- GstValidatePadMonitor *pmonitor, *pmonitor1, *pmonitor2;
+ GstPad *p, *p1, *p2;
GstElement *demuxer = fake_demuxer_new ();
GstBin *pipeline = GST_BIN (gst_pipeline_new ("validate-pipeline"));
GList *reports;
gst_check_setup_events_with_stream_id (srcpad, demuxer, NULL,
GST_FORMAT_TIME, "the-stream");
- pmonitor = _get_pad_monitor (gst_pad_get_peer (demuxer->srcpads->data));
- pmonitor1 =
- _get_pad_monitor (gst_pad_get_peer (demuxer->srcpads->next->data));
- pmonitor2 =
- _get_pad_monitor (gst_pad_get_peer (demuxer->srcpads->next->next->data));
+ p = gst_pad_get_peer (demuxer->srcpads->data);
+ p1 = gst_pad_get_peer (demuxer->srcpads->next->data);
+ p2 = gst_pad_get_peer (demuxer->srcpads->next->next->data);
- pmonitor->last_flow_return = flow;
- pmonitor1->last_flow_return = flow1;
- pmonitor2->last_flow_return = flow2;
+ p->ABI.abi.last_flowret = flow;
+ p1->ABI.abi.last_flowret = flow1;
+ p2->ABI.abi.last_flowret = flow2;
FAKE_DEMUXER (demuxer)->return_value = demux_flow;
+ gst_object_unref (p);
+ gst_object_unref (p1);
+ gst_object_unref (p2);
+
fail_unless_equals_int (gst_pad_push (srcpad, gst_discont_buffer_new ()),
demux_flow);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
ASSERT_OBJECT_REFCOUNT (pipeline, "ours", 1);
gst_object_ref (demuxer);
- gst_object_ref (pmonitor);
_stop_monitoring_bin (pipeline, runner);
ASSERT_OBJECT_REFCOUNT (demuxer, "plop", 1);
gst_object_unref (demuxer);
- ASSERT_OBJECT_REFCOUNT (pmonitor, "plop", 1);
- gst_object_unref (pmonitor);
gst_object_unref (srcpad);
}