mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
Revert "gstaggregator: pads must inherit from #GstAggregatorPad"
This reverts commit 9774b3775d
.
Pushed by mistake
This commit is contained in:
parent
609adc0609
commit
a567cc13a5
3 changed files with 20 additions and 29 deletions
|
@ -61,10 +61,6 @@
|
||||||
* flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE
|
* flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE
|
||||||
* to ease their identification and subsequent processing.
|
* to ease their identification and subsequent processing.
|
||||||
*
|
*
|
||||||
* * Subclasses must use (a subclass of) #GstAggregatorPad for both their
|
|
||||||
* sink and source pads.
|
|
||||||
* See gst_element_class_add_static_pad_template_with_gtype().
|
|
||||||
*
|
|
||||||
* This class used to live in gst-plugins-bad and was moved to core.
|
* This class used to live in gst-plugins-bad and was moved to core.
|
||||||
*
|
*
|
||||||
* Since: 1.14
|
* Since: 1.14
|
||||||
|
@ -465,8 +461,7 @@ gst_aggregator_reset_flow_values (GstAggregator * self)
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
self->priv->send_stream_start = TRUE;
|
self->priv->send_stream_start = TRUE;
|
||||||
self->priv->send_segment = TRUE;
|
self->priv->send_segment = TRUE;
|
||||||
gst_segment_init (&GST_AGGREGATOR_PAD (self->srcpad)->segment,
|
gst_segment_init (&self->segment, GST_FORMAT_TIME);
|
||||||
GST_FORMAT_TIME);
|
|
||||||
self->priv->first_buffer = TRUE;
|
self->priv->first_buffer = TRUE;
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
}
|
}
|
||||||
|
@ -484,8 +479,7 @@ gst_aggregator_push_mandatory_events (GstAggregator * self)
|
||||||
GST_INFO_OBJECT (self, "pushing stream start");
|
GST_INFO_OBJECT (self, "pushing stream start");
|
||||||
/* stream-start (FIXME: create id based on input ids) */
|
/* stream-start (FIXME: create id based on input ids) */
|
||||||
g_snprintf (s_id, sizeof (s_id), "agg-%08x", g_random_int ());
|
g_snprintf (s_id, sizeof (s_id), "agg-%08x", g_random_int ());
|
||||||
if (!gst_pad_push_event (GST_PAD (self->srcpad),
|
if (!gst_pad_push_event (self->srcpad, gst_event_new_stream_start (s_id))) {
|
||||||
gst_event_new_stream_start (s_id))) {
|
|
||||||
GST_WARNING_OBJECT (self->srcpad, "Sending stream start event failed");
|
GST_WARNING_OBJECT (self->srcpad, "Sending stream start event failed");
|
||||||
}
|
}
|
||||||
self->priv->send_stream_start = FALSE;
|
self->priv->send_stream_start = FALSE;
|
||||||
|
@ -495,7 +489,7 @@ gst_aggregator_push_mandatory_events (GstAggregator * self)
|
||||||
|
|
||||||
GST_INFO_OBJECT (self, "pushing caps: %" GST_PTR_FORMAT,
|
GST_INFO_OBJECT (self, "pushing caps: %" GST_PTR_FORMAT,
|
||||||
self->priv->srccaps);
|
self->priv->srccaps);
|
||||||
if (!gst_pad_push_event (GST_PAD (self->srcpad),
|
if (!gst_pad_push_event (self->srcpad,
|
||||||
gst_event_new_caps (self->priv->srccaps))) {
|
gst_event_new_caps (self->priv->srccaps))) {
|
||||||
GST_WARNING_OBJECT (self->srcpad, "Sending caps event failed");
|
GST_WARNING_OBJECT (self->srcpad, "Sending caps event failed");
|
||||||
}
|
}
|
||||||
|
@ -505,8 +499,7 @@ gst_aggregator_push_mandatory_events (GstAggregator * self)
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
if (self->priv->send_segment && !self->priv->flush_seeking) {
|
if (self->priv->send_segment && !self->priv->flush_seeking) {
|
||||||
segment =
|
segment = gst_event_new_segment (&self->segment);
|
||||||
gst_event_new_segment (&GST_AGGREGATOR_PAD (self->srcpad)->segment);
|
|
||||||
|
|
||||||
if (!self->priv->seqnum)
|
if (!self->priv->seqnum)
|
||||||
/* This code-path is in preparation to be able to run without a source
|
/* This code-path is in preparation to be able to run without a source
|
||||||
|
@ -1835,8 +1828,8 @@ gst_aggregator_send_event (GstElement * element, GstEvent * event)
|
||||||
&start, &stop_type, &stop);
|
&start, &stop_type, &stop);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
gst_segment_do_seek (&GST_AGGREGATOR_PAD (self->srcpad)->segment, rate, fmt,
|
gst_segment_do_seek (&self->segment, rate, fmt, flags, start_type, start,
|
||||||
flags, start_type, start, stop_type, stop, NULL);
|
stop_type, stop, NULL);
|
||||||
self->priv->seqnum = gst_event_get_seqnum (event);
|
self->priv->seqnum = gst_event_get_seqnum (event);
|
||||||
self->priv->first_buffer = FALSE;
|
self->priv->first_buffer = FALSE;
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
@ -1994,8 +1987,8 @@ gst_aggregator_do_seek (GstAggregator * self, GstEvent * event)
|
||||||
priv->flush_seeking = TRUE;
|
priv->flush_seeking = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_segment_do_seek (&GST_AGGREGATOR_PAD (self->srcpad)->segment, rate, fmt,
|
gst_segment_do_seek (&self->segment, rate, fmt, flags, start_type, start,
|
||||||
flags, start_type, start, stop_type, stop, NULL);
|
stop_type, stop, NULL);
|
||||||
|
|
||||||
/* Seeking sets a position */
|
/* Seeking sets a position */
|
||||||
self->priv->first_buffer = FALSE;
|
self->priv->first_buffer = FALSE;
|
||||||
|
@ -2363,11 +2356,10 @@ gst_aggregator_init (GstAggregator * self, GstAggregatorClass * klass)
|
||||||
self->priv->peer_latency_min = self->priv->sub_latency_min = 0;
|
self->priv->peer_latency_min = self->priv->sub_latency_min = 0;
|
||||||
self->priv->peer_latency_max = self->priv->sub_latency_max = 0;
|
self->priv->peer_latency_max = self->priv->sub_latency_max = 0;
|
||||||
self->priv->has_peer_latency = FALSE;
|
self->priv->has_peer_latency = FALSE;
|
||||||
|
gst_aggregator_reset_flow_values (self);
|
||||||
|
|
||||||
self->srcpad = gst_pad_new_from_template (pad_template, "src");
|
self->srcpad = gst_pad_new_from_template (pad_template, "src");
|
||||||
|
|
||||||
gst_aggregator_reset_flow_values (self);
|
|
||||||
|
|
||||||
gst_pad_set_event_function (self->srcpad,
|
gst_pad_set_event_function (self->srcpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_aggregator_src_pad_event_func));
|
GST_DEBUG_FUNCPTR (gst_aggregator_src_pad_event_func));
|
||||||
gst_pad_set_query_function (self->srcpad,
|
gst_pad_set_query_function (self->srcpad,
|
||||||
|
@ -2525,7 +2517,6 @@ gst_aggregator_pad_chain_internal (GstAggregator * self,
|
||||||
|
|
||||||
if (self->priv->first_buffer) {
|
if (self->priv->first_buffer) {
|
||||||
GstClockTime start_time;
|
GstClockTime start_time;
|
||||||
GstAggregatorPad *srcpad = GST_AGGREGATOR_PAD (self->srcpad);
|
|
||||||
|
|
||||||
switch (self->priv->start_time_selection) {
|
switch (self->priv->start_time_selection) {
|
||||||
case GST_AGGREGATOR_START_TIME_SELECTION_ZERO:
|
case GST_AGGREGATOR_START_TIME_SELECTION_ZERO:
|
||||||
|
@ -2559,10 +2550,10 @@ gst_aggregator_pad_chain_internal (GstAggregator * self,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start_time != -1) {
|
if (start_time != -1) {
|
||||||
if (srcpad->segment.position == -1)
|
if (self->segment.position == -1)
|
||||||
srcpad->segment.position = start_time;
|
self->segment.position = start_time;
|
||||||
else
|
else
|
||||||
srcpad->segment.position = MIN (start_time, srcpad->segment.position);
|
self->segment.position = MIN (start_time, self->segment.position);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Selecting start time %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (self, "Selecting start time %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (start_time));
|
GST_TIME_ARGS (start_time));
|
||||||
|
|
|
@ -140,6 +140,9 @@ struct _GstAggregator
|
||||||
|
|
||||||
GstPad * srcpad;
|
GstPad * srcpad;
|
||||||
|
|
||||||
|
/* Only access with the object lock held */
|
||||||
|
GstSegment segment;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GstAggregatorPrivate * priv;
|
GstAggregatorPrivate * priv;
|
||||||
|
|
||||||
|
|
|
@ -152,11 +152,9 @@ gst_test_aggregator_class_init (GstTestAggregatorClass * klass)
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink_%u", GST_PAD_SINK, GST_PAD_REQUEST,
|
GST_STATIC_PAD_TEMPLATE ("sink_%u", GST_PAD_SINK, GST_PAD_REQUEST,
|
||||||
GST_STATIC_CAPS_ANY);
|
GST_STATIC_CAPS_ANY);
|
||||||
|
|
||||||
gst_element_class_add_static_pad_template_with_gtype (gstelement_class,
|
gst_element_class_add_static_pad_template (gstelement_class, &_src_template);
|
||||||
&_src_template, GST_TYPE_AGGREGATOR_PAD);
|
|
||||||
|
|
||||||
gst_element_class_add_static_pad_template_with_gtype (gstelement_class,
|
gst_element_class_add_static_pad_template (gstelement_class, &_sink_template);
|
||||||
&_sink_template, GST_TYPE_AGGREGATOR_PAD);
|
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (gstelement_class, "Aggregator",
|
gst_element_class_set_static_metadata (gstelement_class, "Aggregator",
|
||||||
"Testing", "Combine N buffers", "Stefan Sauer <ensonic@users.sf.net>");
|
"Testing", "Combine N buffers", "Stefan Sauer <ensonic@users.sf.net>");
|
||||||
|
@ -169,8 +167,7 @@ static void
|
||||||
gst_test_aggregator_init (GstTestAggregator * self)
|
gst_test_aggregator_init (GstTestAggregator * self)
|
||||||
{
|
{
|
||||||
GstAggregator *agg = GST_AGGREGATOR (self);
|
GstAggregator *agg = GST_AGGREGATOR (self);
|
||||||
gst_segment_init (&GST_AGGREGATOR_PAD (agg->srcpad)->segment,
|
gst_segment_init (&agg->segment, GST_FORMAT_TIME);
|
||||||
GST_FORMAT_TIME);
|
|
||||||
self->timestamp = 0;
|
self->timestamp = 0;
|
||||||
self->gap_expected = FALSE;
|
self->gap_expected = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -811,8 +808,8 @@ GST_START_TEST (test_flushing_seek)
|
||||||
GST_BUFFER_TIMESTAMP (buf) = 0;
|
GST_BUFFER_TIMESTAMP (buf) = 0;
|
||||||
_chain_data_init (&data2, test.aggregator, buf, NULL);
|
_chain_data_init (&data2, test.aggregator, buf, NULL);
|
||||||
|
|
||||||
gst_segment_init (&GST_AGGREGATOR_PAD (GST_AGGREGATOR (test.
|
gst_segment_init (&GST_AGGREGATOR (test.aggregator)->segment,
|
||||||
aggregator)->srcpad)->segment, GST_FORMAT_TIME);
|
GST_FORMAT_TIME);
|
||||||
|
|
||||||
/* now do a successful flushing seek */
|
/* now do a successful flushing seek */
|
||||||
event = gst_event_new_seek (1, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
|
event = gst_event_new_seek (1, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
|
||||||
|
|
Loading…
Reference in a new issue