}
}
-static gint64
-gst_matroska_demux_get_length (GstMatroskaDemux * demux)
-{
- GstFormat fmt = GST_FORMAT_BYTES;
- gint64 end = -1;
-
- if (!gst_pad_query_peer_duration (demux->common.sinkpad, &fmt, &end) ||
- fmt != GST_FORMAT_BYTES || end < 0)
- GST_DEBUG_OBJECT (demux, "no upstream length");
-
- return end;
-}
-
static gboolean
gst_matroska_decode_data (GArray * encodings, guint8 ** data_out,
guint * size_out, GstMatroskaTrackEncodingScope scope, gboolean free)
guint needed;
/* remember */
- length = gst_matroska_demux_get_length (demux);
+ length = gst_matroska_read_common_get_length (&demux->common);
before_pos = demux->common.offset;
if (length == (guint64) - 1) {
next:
if (G_UNLIKELY (demux->common.offset ==
- gst_matroska_demux_get_length (demux))) {
+ gst_matroska_read_common_get_length (&demux->common))) {
GST_LOG_OBJECT (demux, "Reached end of stream");
ret = GST_FLOW_UNEXPECTED;
goto eos;
}
}
-static gint64
-gst_matroska_parse_get_length (GstMatroskaParse * parse)
-{
- GstFormat fmt = GST_FORMAT_BYTES;
- gint64 end = -1;
-
- if (!gst_pad_query_peer_duration (parse->common.sinkpad, &fmt, &end) ||
- fmt != GST_FORMAT_BYTES || end < 0)
- GST_DEBUG_OBJECT (parse, "no upstream length");
-
- return end;
-}
-
static gboolean
gst_matroska_decode_data (GArray * encodings, guint8 ** data_out,
guint * size_out, GstMatroskaTrackEncodingScope scope, gboolean free)
guint64 length;
/* remember */
- length = gst_matroska_parse_get_length (parse);
+ length = gst_matroska_read_common_get_length (&parse->common);
if (length == (guint64) - 1) {
GST_DEBUG_OBJECT (parse, "no upstream length, skipping SeakHead entry");
}
next:
- if (G_UNLIKELY (parse->offset == gst_matroska_parse_get_length (parse))) {
+ if (G_UNLIKELY (parse->offset ==
+ gst_matroska_read_common_get_length (&parse->common))) {
GST_LOG_OBJECT (parse, "Reached end of stream");
ret = GST_FLOW_UNEXPECTED;
goto eos;
return TRUE;
}
+gint64
+gst_matroska_read_common_get_length (GstMatroskaReadCommon * common)
+{
+ GstFormat fmt = GST_FORMAT_BYTES;
+ gint64 end = -1;
+
+ if (!gst_pad_query_peer_duration (common->sinkpad, &fmt, &end) ||
+ fmt != GST_FORMAT_BYTES || end < 0)
+ GST_DEBUG_OBJECT (common, "no upstream length");
+
+ return end;
+}
+
/* skip unknown or alike element */
GstFlowReturn
gst_matroska_read_common_parse_skip (GstMatroskaReadCommon * common,
gboolean gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
guint8 ** data_out, guint * size_out,
GstMatroskaTrackCompressionAlgorithm algo);
+gint64 gst_matroska_read_common_get_length (GstMatroskaReadCommon * common);
GstFlowReturn gst_matroska_read_common_parse_index (GstMatroskaReadCommon *
common, GstEbmlRead * ebml);
GstFlowReturn gst_matroska_read_common_parse_skip (GstMatroskaReadCommon *