mpdparser: remove unused functions gst_mpdparser_get_chunk_by_index and gst_mpdparser_find_segment_by_index

https://bugzilla.gnome.org/show_bug.cgi?id=758233
This commit is contained in:
Florin Apostol 2015-11-19 15:59:56 +00:00 committed by Thiago Santos
parent 49ccb72b47
commit ef84f294c0
3 changed files with 0 additions and 87 deletions

View file

@ -3790,86 +3790,6 @@ gst_mpdparser_get_segment_end_time (GstMpdClient * client, GPtrArray * segments,
return end; return end;
} }
static gboolean
gst_mpdparser_find_segment_by_index (GstMpdClient * client,
GPtrArray * segments, gint index, GstMediaSegment * result)
{
gint i;
for (i = 0; i < segments->len; i++) {
GstMediaSegment *s;
gint repeat;
s = g_ptr_array_index (segments, i);
if (s->repeat >= 0) {
repeat = s->repeat;
} else {
GstClockTime start = s->start;
GstClockTime end =
gst_mpdparser_get_segment_end_time (client, segments, s, i);
repeat = (guint) (end - start) / s->duration;
}
if (s->number + repeat >= index) {
/* it is in this segment */
result->SegmentURL = s->SegmentURL;
result->number = index;
result->scale_start =
s->scale_start + (index - s->number) * s->scale_duration;
result->scale_duration = s->scale_duration;
result->start = s->start + (index - s->number) * s->duration;
result->duration = s->duration;
return TRUE;
}
}
return FALSE;
}
gboolean
gst_mpdparser_get_chunk_by_index (GstMpdClient * client, guint indexStream,
guint indexChunk, GstMediaSegment * segment)
{
GstActiveStream *stream;
/* select stream */
g_return_val_if_fail (client != NULL, FALSE);
g_return_val_if_fail (client->active_streams != NULL, FALSE);
stream = g_list_nth_data (client->active_streams, indexStream);
g_return_val_if_fail (stream != NULL, FALSE);
indexChunk += 1;
if (stream->segments) {
return gst_mpdparser_find_segment_by_index (client, stream->segments,
indexChunk, segment);
} else {
GstClockTime duration;
GstStreamPeriod *stream_period;
guint64 scale_dur;
g_return_val_if_fail (stream->cur_seg_template->MultSegBaseType->
SegmentTimeline == NULL, FALSE);
/* segment template generator */
duration = gst_mpd_client_get_segment_duration (client, stream, &scale_dur);
if (!GST_CLOCK_TIME_IS_VALID (duration))
return FALSE;
stream_period = gst_mpdparser_get_stream_period (client);
segment->number = indexChunk
+ stream->cur_seg_template->MultSegBaseType->startNumber;
segment->scale_start = indexChunk * scale_dur;
segment->scale_duration = scale_dur;
segment->start = duration * indexChunk;
segment->duration = duration;
segment->SegmentURL = NULL;
if (segment->start >= stream_period->duration) {
return FALSE;
}
}
return TRUE;
}
static gboolean static gboolean
gst_mpd_client_add_media_segment (GstActiveStream * stream, gst_mpd_client_add_media_segment (GstActiveStream * stream,
GstSegmentURLNode * url_node, guint number, gint repeat, GstSegmentURLNode * url_node, guint number, gint repeat,

View file

@ -566,7 +566,6 @@ gint gst_mpdparser_get_rep_idx_with_min_bandwidth (GList * Representations);
/* URL management */ /* URL management */
const gchar *gst_mpdparser_get_baseURL (GstMpdClient *client, guint indexStream); const gchar *gst_mpdparser_get_baseURL (GstMpdClient *client, guint indexStream);
gboolean gst_mpdparser_get_chunk_by_index (GstMpdClient *client, guint indexStream, guint indexChunk, GstMediaSegment * segment);
/* Active stream */ /* Active stream */
guint gst_mpdparser_get_nb_active_stream (GstMpdClient *client); guint gst_mpdparser_get_nb_active_stream (GstMpdClient *client);

View file

@ -3839,7 +3839,6 @@ GST_START_TEST (dash_mpdparser_segments)
gboolean hasNextSegment; gboolean hasNextSegment;
GstActiveStream *activeStream; GstActiveStream *activeStream;
GstFlowReturn flow; GstFlowReturn flow;
GstMediaSegment segment;
GstDateTime *segmentEndTime; GstDateTime *segmentEndTime;
GstDateTime *gst_time; GstDateTime *gst_time;
GDateTime *g_time; GDateTime *g_time;
@ -3932,11 +3931,6 @@ GST_START_TEST (dash_mpdparser_segments)
gst_mpd_client_has_next_segment (mpdclient, activeStream, TRUE); gst_mpd_client_has_next_segment (mpdclient, activeStream, TRUE);
assert_equals_int (hasNextSegment, 0); assert_equals_int (hasNextSegment, 0);
/* get chunk 0. segment_index will not change */
ret = gst_mpdparser_get_chunk_by_index (mpdclient, 0, 0, &segment);
assert_equals_int (ret, 1);
assert_equals_int (segment.number, 1);
/* segment index is still 1 */ /* segment index is still 1 */
hasNextSegment = hasNextSegment =
gst_mpd_client_has_next_segment (mpdclient, activeStream, TRUE); gst_mpd_client_has_next_segment (mpdclient, activeStream, TRUE);