GstAdaptiveDemuxTrack *new_track =
gst_adaptive_demux_period_find_matching_track (next_period, track);
if (new_track) {
- GST_DEBUG_OBJECT (demux, "Selecting replacement track %s",
- new_track->stream_id);
+ GST_DEBUG_OBJECT (demux,
+ "Selecting replacement track %s (period %u) for track %s (period %d)",
+ new_track->stream_id, new_track->period_num, track->stream_id,
+ track->period_num);
new_track->selected = TRUE;
gst_pad_set_active (new_track->sinkpad, TRUE);
} else {
- GST_WARNING_OBJECT (demux, "Could not find replacement track for %s",
- track->stream_id);
+ GST_WARNING_OBJECT (demux,
+ "Could not find replacement track for %s (period %u) in period %u",
+ track->stream_id, track->period_num, current_period->period_num);
/* FIXME : Pick a default for that type ? Just continue as-is ? */
}
}
gst_queue_array_pop_head (track->queue);
GST_LOG_OBJECT (demux,
- "track %s item running_time %" GST_STIME_FORMAT " end %" GST_STIME_FORMAT,
- track->stream_id, GST_STIME_ARGS (out_item->runningtime),
+ "track %s (period %u) item running_time %" GST_STIME_FORMAT " end %"
+ GST_STIME_FORMAT, track->stream_id, track->period_num,
+ GST_STIME_ARGS (out_item->runningtime),
GST_STIME_ARGS (out_item->runningtime_end));
return TRUE;
running_time_buffering = running_time = running_time_end =
GST_CLOCK_STIME_NONE;
GST_DEBUG_OBJECT (demux,
- "track %s dequeued pending sticky event %" GST_PTR_FORMAT,
- track->stream_id, event);
+ "track %s (period %u) dequeued pending sticky event %" GST_PTR_FORMAT,
+ track->stream_id, track->period_num, event);
is_pending_sticky = TRUE;
goto handle_event;
}
duration = cstop - cstart;
GST_DEBUG_OBJECT (demux,
- "track %s Starting gap for runningtime %" GST_STIME_FORMAT
+ "track %s (period %u) Starting gap for runningtime %" GST_STIME_FORMAT
" - clipped position %" GST_TIME_FORMAT " duration %" GST_TIME_FORMAT,
- track->stream_id, GST_STIME_ARGS (running_time), GST_TIME_ARGS (pos),
- GST_TIME_ARGS (duration));
+ track->stream_id, track->period_num, GST_STIME_ARGS (running_time),
+ GST_TIME_ARGS (pos), GST_TIME_ARGS (duration));
track->gap_position = pos;
track->gap_duration = duration;
else
track->level_time = 0;
- GST_LOG_OBJECT (demux,
- "track %s input_time:%" GST_STIME_FORMAT " output_time:%"
+ GST_LOG_OBJECT (track->sinkpad,
+ "track %s (period %u) input_time:%" GST_STIME_FORMAT " output_time:%"
GST_STIME_FORMAT " level:%" GST_TIME_FORMAT,
- track->stream_id, GST_STIME_ARGS (track->input_time),
+ track->stream_id, track->period_num, GST_STIME_ARGS (track->input_time),
GST_STIME_ARGS (track->output_time), GST_TIME_ARGS (track->level_time));
}
- GST_LOG_OBJECT (demux,
+ GST_LOG_OBJECT (track->sinkpad,
"track %s item running_time :%" GST_STIME_FORMAT " end :%"
GST_STIME_FORMAT, track->stream_id, GST_STIME_ARGS (item.runningtime),
GST_STIME_ARGS (item.runningtime_end));
gchar *internal_name;
guint i, len;
+ /* Store the period number for debugging output */
+ track->period_num = period_num;
+
internal_name =
g_strdup_printf ("track-period%d-%s", period_num, track->stream_id);
len = strlen (internal_name);
track->type = type;
track->flags = flags;
track->stream_id = g_strdup (stream_id);
+ track->period_num = (guint) (-1);
track->generic_caps = caps;
track->stream_object = gst_stream_new (stream_id, caps, type, flags);
if (tags) {
GstAdaptiveDemuxTrack *track = (GstAdaptiveDemuxTrack *) tmp->data;
GST_LOG_OBJECT (demux,
- "Checking track '%s' active:%d selected:%d eos:%d level:%"
+ "Checking track '%s' (period %u) active:%d selected:%d eos:%d level:%"
GST_TIME_FORMAT " buffering_threshold:%" GST_TIME_FORMAT,
- track->stream_id, track->active, track->selected, track->eos,
- GST_TIME_ARGS (track->level_time),
+ track->stream_id, track->period_num, track->active, track->selected,
+ track->eos, GST_TIME_ARGS (track->level_time),
GST_TIME_ARGS (track->buffering_threshold));
if (track->active && track->selected) {
if (slot->pending_track == NULL) {
slot->pending_track = gst_adaptive_demux_track_ref (track);
GST_DEBUG_OBJECT (demux,
- "Track '%s' will be used on output of track '%s'",
- track->stream_id, slot->track->stream_id);
+ "Track '%s' (period %u) will be used on output of track '%s' (period %u)",
+ track->stream_id, track->period_num,
+ slot->track->stream_id, slot->track->period_num);
}
} else {
/* 2. There is no compatible replacement slot, create a new one */
MIN (global_output_position, track->next_position);
track->waiting_add = FALSE;
} else if (!track->eos) {
- GST_DEBUG_OBJECT (demux, "Need timed data on track %s", track->stream_id);
+ GST_DEBUG_OBJECT (demux, "Need timed data on track %s (period %u)",
+ track->stream_id, track->period_num);
wait_for_data = track->waiting_add = TRUE;
} else {
- GST_DEBUG_OBJECT (demux, "Track %s is EOS, not waiting for timed data",
- track->stream_id);
+ GST_DEBUG_OBJECT (demux,
+ "Track %s (period %u) is EOS, not waiting for timed data",
+ track->stream_id, track->period_num);
}
}
if (!mo) {
GST_DEBUG_OBJECT (demux,
- "Track '%s' doesn't have any pending data (eos:%d pushed_timed_data:%d)",
- track->stream_id, track->eos, slot->pushed_timed_data);
+ "Track '%s' (period %u) doesn't have any pending data (eos:%d pushed_timed_data:%d)",
+ track->stream_id, track->period_num, track->eos,
+ slot->pushed_timed_data);
/* This should only happen if the track is EOS, or exactly in between
* the parser outputting segment/caps before buffers. */
g_assert (track->eos || !slot->pushed_timed_data);
demux_post_buffering_locked (demux);
TRACKS_UNLOCK (demux);
- GST_DEBUG_OBJECT (demux, "Track '%s' dequeued %" GST_PTR_FORMAT,
- track->stream_id, mo);
+ GST_DEBUG_OBJECT (demux,
+ "Track '%s' (period %u) dequeued %" GST_PTR_FORMAT, track->stream_id,
+ track->period_num, mo);
if (GST_IS_EVENT (mo)) {
GstEvent *event = (GstEvent *) mo;
gst_flow_combiner_update_pad_flow (demux->priv->flowcombiner,
slot->pad, slot->flow_ret);
GST_DEBUG_OBJECT (slot->pad,
- "track %s push returned %s (combined %s)", track->stream_id,
+ "track %s (period %u) push returned %s (combined %s)",
+ track->stream_id, track->period_num,
gst_flow_get_name (slot->flow_ret), gst_flow_get_name (ret));
slot->pushed_timed_data = TRUE;
} else {
/* Unique identifier */
gchar *stream_id;
+ /* Period number this track belongs
+ * to (MAXINT if not assigned to a period yet)
+ */
+ guint period_num;
+
/* Unique identifier of the internal stream produced
* by parsebin for the Stream this track comes from */
gchar *upstream_stream_id;