/* parse the remainder of the fisbone in the pad with the serialno,
* note that we ignore the start_time as this is usually wrong for
* live streams */
- gst_ogg_map_add_fisbone (&skel_pad->map, packet->packet,
+ gst_ogg_map_add_fisbone (&skel_pad->map, &pad->map, packet->packet,
packet->bytes, NULL);
break;
case GST_OGG_SKELETON_INDEX:
- gst_ogg_map_add_index (&skel_pad->map, packet->packet,
+ gst_ogg_map_add_index (&skel_pad->map, &pad->map, packet->packet,
packet->bytes);
break;
default:
}
gboolean
-gst_ogg_map_add_fisbone (GstOggStream * pad,
+gst_ogg_map_add_fisbone (GstOggStream * pad, GstOggStream * skel_pad,
const guint8 * data, guint size, GstClockTime * p_start_time)
{
GstClockTime start_time;
}
gboolean
-gst_ogg_map_add_index (GstOggStream * pad, const guint8 * data, guint size)
+gst_ogg_map_add_index (GstOggStream * pad, GstOggStream * skel_pad,
+ const guint8 * data, guint size)
{
guint64 i, n_keypoints, isize;
guint64 offset, timestamp;
data += 16;
size -= 16;
+ if (skel_pad->skeleton_major == 4) {
+ guint64 firstsampletime_n, lastsampletime_n;
+ guint64 firstsampletime, lastsampletime;
+
+ firstsampletime_n = GST_READ_UINT64_LE (data);
+ lastsampletime_n = GST_READ_UINT64_LE (data + 8);
+
+ GST_INFO ("firstsampletime %" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT,
+ firstsampletime_n, pad->kp_denom);
+ GST_INFO ("lastsampletime %" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT,
+ lastsampletime_n, pad->kp_denom);
+
+ firstsampletime = gst_util_uint64_scale (GST_SECOND,
+ firstsampletime_n, pad->kp_denom);
+
+ lastsampletime = gst_util_uint64_scale (GST_SECOND,
+ lastsampletime_n, pad->kp_denom);
+
+ if (lastsampletime > firstsampletime)
+ pad->total_time = lastsampletime - firstsampletime;
+ else
+ pad->total_time = -1;
+
+ GST_INFO ("skeleton index parsed total: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (pad->total_time));
+
+ data += 16;
+ size -= 16;
+ }
+
GST_INFO ("skeleton index has %" G_GUINT64_FORMAT " keypoints, denom: %"
G_GINT64_FORMAT, n_keypoints, pad->kp_denom);
gboolean gst_ogg_map_parse_fisbone (GstOggStream * pad, const guint8 * data, guint size,
guint32 * serialno, GstOggSkeleton *type);
-gboolean gst_ogg_map_add_fisbone (GstOggStream * pad, const guint8 * data, guint size,
+gboolean gst_ogg_map_add_fisbone (GstOggStream * pad, GstOggStream * skel_pad, const guint8 * data, guint size,
GstClockTime * p_start_time);
-gboolean gst_ogg_map_add_index (GstOggStream * pad, const guint8 * data, guint size);
+gboolean gst_ogg_map_add_index (GstOggStream * pad, GstOggStream * skel_pad, const guint8 * data, guint size);
gboolean gst_ogg_map_search_index (GstOggStream * pad, gboolean before, guint64 *timestamp, guint64 *offset);