/* TRUE if we are waiting for a valid timestamp */
gboolean pending_ts;
- /* the return of the latest push */
- GstFlowReturn flow_return;
-
/* Output data */
PendingPacketState state;
return TRUE;
}
-static GstFlowReturn
-tsdemux_combine_flows (GstTSDemux * demux, TSDemuxStream * stream,
- GstFlowReturn ret)
-{
- /* Store the value */
- stream->flow_return = ret;
- return gst_flow_combiner_update_flow (demux->flowcombiner, ret);
-}
-
static inline void
add_iso639_language_to_tags (TSDemuxStream * stream, gchar * lang_code)
{
stream->first_dts = GST_CLOCK_TIME_NONE;
stream->continuity_counter = CONTINUITY_UNSET;
}
- stream->flow_return = GST_FLOW_OK;
}
static void
stream->pad = NULL;
}
gst_ts_demux_stream_flush (stream, GST_TS_DEMUX_CAST (base));
- stream->flow_return = GST_FLOW_NOT_LINKED;
}
static void
stream->first_dts = GST_CLOCK_TIME_NONE;
stream->raw_pts = -1;
stream->raw_dts = -1;
- if (stream->flow_return == GST_FLOW_FLUSHING) {
- stream->flow_return = GST_FLOW_OK;
- }
stream->continuity_counter = CONTINUITY_UNSET;
}
res = gst_pad_push (stream->pad, buffer);
GST_DEBUG_OBJECT (stream->pad, "Returned %s", gst_flow_get_name (res));
- res = tsdemux_combine_flows (demux, stream, res);
+ res = gst_flow_combiner_update_flow (demux->flowcombiner, res);
GST_DEBUG_OBJECT (stream->pad, "combined %s", gst_flow_get_name (res));
beach:
static void
gst_mxf_demux_remove_pad (GstMXFDemuxPad * pad, GstMXFDemux * demux)
{
- gst_element_remove_pad (GST_ELEMENT (demux), GST_PAD (pad));
+ gst_flow_combiner_remove_pad (demux->flowcombiner, GST_PAD_CAST (pad));
+ gst_element_remove_pad (GST_ELEMENT (demux), GST_PAD_CAST (pad));
}
static void
gst_mxf_demux_combine_flows (GstMXFDemux * demux,
GstMXFDemuxPad * pad, GstFlowReturn ret)
{
- guint i;
-
/* store the value */
pad->last_flow = ret;
- /* any other error that is not-linked can be returned right away */
- if (ret != GST_FLOW_NOT_LINKED)
- goto done;
-
- /* only return NOT_LINKED if all other pads returned NOT_LINKED */
- for (i = 0; i < demux->src->len; i++) {
- GstMXFDemuxPad *opad = g_ptr_array_index (demux->src, i);
-
- if (opad == NULL)
- continue;
+ ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret);
- ret = opad->last_flow;
- /* some other return value (must be SUCCESS but we can return
- * other values as well) */
- if (ret != GST_FLOW_NOT_LINKED)
- goto done;
- }
- /* if we get here, all other pads were unlinked and we return
- * NOT_LINKED then */
-done:
GST_LOG_OBJECT (demux, "combined return %s", gst_flow_get_name (ret));
return ret;
}
g_rw_lock_writer_unlock (&demux->metadata_lock);
- for (l = pads; l; l = l->next)
+ for (l = pads; l; l = l->next) {
+ gst_flow_combiner_add_pad (demux->flowcombiner, l->data);
gst_element_add_pad (GST_ELEMENT_CAST (demux), l->data);
+ }
g_list_free (pads);
if (first_run)
demux->adapter = NULL;
}
+ if (demux->flowcombiner) {
+ gst_flow_combiner_free (demux->flowcombiner);
+ demux->flowcombiner = NULL;
+ }
+
if (demux->close_seg_event) {
gst_event_unref (demux->close_seg_event);
demux->close_seg_event = NULL;
demux->max_drift = 500 * GST_MSECOND;
demux->adapter = gst_adapter_new ();
+ demux->flowcombiner = gst_flow_combiner_new ();
g_rw_lock_init (&demux->metadata_lock);
demux->src = g_ptr_array_new ();