stream->pending_tags = NULL;
}
if (stream->pad) {
- if (stream->active)
+ if (stream->active) {
gst_element_remove_pad (GST_ELEMENT_CAST (demux), stream->pad);
- else
+ gst_flow_combiner_remove_pad (demux->flowcombiner, stream->pad);
+ } else
gst_object_unref (stream->pad);
stream->pad = NULL;
}
for (n = 0; n < demux->num_streams; n++) {
demux->stream[n].discont = TRUE;
- demux->stream[n].last_flow = GST_FLOW_OK;
while (demux->stream[n].payloads->len > 0) {
AsfPayload *payload;
}
}
-static GstFlowReturn
-gst_asf_demux_aggregate_flow_return (GstASFDemux * demux, AsfStream * stream,
- GstFlowReturn flow)
-{
- int i;
-
- GST_DEBUG_OBJECT (demux, "Aggregating");
-
- /* Store the value */
- stream->last_flow = flow;
-
- /* any other error that is not not-linked can be returned right away */
- if (flow != GST_FLOW_NOT_LINKED)
- goto done;
-
- for (i = 0; i < demux->num_streams; i++) {
- if (demux->stream[i].active) {
- flow = demux->stream[i].last_flow;
- GST_DEBUG_OBJECT (demux, "Aggregating: flow %i return %s", i,
- gst_flow_get_name (flow));
- if (flow != GST_FLOW_NOT_LINKED)
- goto done;
- }
- }
-
- /* If we got here, then all our active streams are not linked */
-done:
- return flow;
-}
-
static gboolean
gst_asf_demux_pull_data (GstASFDemux * demux, guint64 offset, guint size,
GstBuffer ** p_buf, GstFlowReturn * p_flow)
if (stream->active) {
ret = gst_pad_push (stream->pad, payload->buf);
- ret = gst_asf_demux_aggregate_flow_return (demux, stream, ret);
+ ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret);
} else {
gst_buffer_unref (payload->buf);
ret = GST_FLOW_OK;
gst_pad_set_caps (stream->pad, stream->caps);
gst_element_add_pad (GST_ELEMENT_CAST (demux), stream->pad);
+ gst_flow_combiner_add_pad (demux->flowcombiner, stream->pad);
stream->active = TRUE;
}
}
demux->data_offset = 0;
demux->index_offset = 0;
demux->base_offset = 0;
+ demux->flowcombiner = gst_flow_combiner_new ();
break;
}
default:
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ gst_asf_demux_reset (demux, FALSE);
+ break;
+
case GST_STATE_CHANGE_READY_TO_NULL:
gst_asf_demux_reset (demux, FALSE);
+ gst_flow_combiner_free (demux->flowcombiner);
+ demux->flowcombiner = NULL;
break;
default:
break;
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
+#include <gst/base/gstflowcombiner.h>
#include "asfheaders.h"
guint16 ds_data_size;
/* for new parsing code */
- GstFlowReturn last_flow; /* last flow return */
GArray *payloads; /* pending payloads */
/* Video stream PAR & interlacing */
guint32 num_streams;
AsfStream stream[GST_ASF_DEMUX_NUM_STREAMS];
gboolean activated_streams;
+ GstFlowCombiner *flowcombiner;
/* for chained asf handling, we need to hold the old asf streams until
* we detect the new ones */