mpdparser: remove unused functions gst_mpdparser_get_chunk_by_index and gst_mpdparser...
authorFlorin Apostol <florin.apostol@oregan.net>
Thu, 19 Nov 2015 15:59:56 +0000 (15:59 +0000)
committerThiago Santos <thiagoss@osg.samsung.com>
Thu, 19 Nov 2015 18:53:30 +0000 (15:53 -0300)
https://bugzilla.gnome.org/show_bug.cgi?id=758233

ext/dash/gstmpdparser.c
ext/dash/gstmpdparser.h
tests/check/elements/dash_mpd.c

index 7642ceb..2aec32b 100644 (file)
@@ -3791,86 +3791,6 @@ gst_mpdparser_get_segment_end_time (GstMpdClient * client, GPtrArray * segments,
 }
 
 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
 gst_mpd_client_add_media_segment (GstActiveStream * stream,
     GstSegmentURLNode * url_node, guint number, gint repeat,
     guint64 scale_start, guint64 scale_duration,
index 13b9b61..533492b 100644 (file)
@@ -566,7 +566,6 @@ gint gst_mpdparser_get_rep_idx_with_min_bandwidth (GList * Representations);
 
 /* URL management */
 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 */
 guint gst_mpdparser_get_nb_active_stream (GstMpdClient *client);
index 76bf9d2..24212d2 100644 (file)
@@ -3839,7 +3839,6 @@ GST_START_TEST (dash_mpdparser_segments)
   gboolean hasNextSegment;
   GstActiveStream *activeStream;
   GstFlowReturn flow;
-  GstMediaSegment segment;
   GstDateTime *segmentEndTime;
   GstDateTime *gst_time;
   GDateTime *g_time;
@@ -3932,11 +3931,6 @@ GST_START_TEST (dash_mpdparser_segments)
       gst_mpd_client_has_next_segment (mpdclient, activeStream, TRUE);
   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 */
   hasNextSegment =
       gst_mpd_client_has_next_segment (mpdclient, activeStream, TRUE);