mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
matroska: refactor code common to matroskademux and matroskaparse
Move the following function to matroska-read-common.[ch] from matroska-demux.c and matroska-parse.c: - gst_matroska_{demux,parse}_peek_pull https://bugzilla.gnome.org/show_bug.cgi?id=650877
This commit is contained in:
parent
72d969b360
commit
5384308c99
4 changed files with 18 additions and 24 deletions
|
@ -461,23 +461,14 @@ gst_matroska_demux_reset (GstElement * element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const guint8 *
|
|
||||||
gst_matroska_demux_peek_pull (GstMatroskaDemux * demux, guint peek)
|
|
||||||
{
|
|
||||||
guint8 *data = NULL;
|
|
||||||
|
|
||||||
gst_matroska_read_common_peek_bytes (&demux->common, demux->common.offset,
|
|
||||||
peek, NULL, &data);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_matroska_demux_peek_id_length_pull (GstMatroskaDemux * demux, guint32 * _id,
|
gst_matroska_demux_peek_id_length_pull (GstMatroskaDemux * demux, guint32 * _id,
|
||||||
guint64 * _length, guint * _needed)
|
guint64 * _length, guint * _needed)
|
||||||
{
|
{
|
||||||
return gst_ebml_peek_id_length (_id, _length, _needed,
|
return gst_ebml_peek_id_length (_id, _length, _needed,
|
||||||
(GstPeekData) gst_matroska_demux_peek_pull, (gpointer) demux,
|
(GstPeekData) gst_matroska_read_common_peek_pull,
|
||||||
GST_ELEMENT_CAST (demux), demux->common.offset);
|
(gpointer) (&demux->common), GST_ELEMENT_CAST (demux),
|
||||||
|
demux->common.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint64
|
static gint64
|
||||||
|
|
|
@ -384,23 +384,14 @@ gst_matroska_parse_reset (GstElement * element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const guint8 *
|
|
||||||
gst_matroska_parse_peek_pull (GstMatroskaParse * parse, guint peek)
|
|
||||||
{
|
|
||||||
guint8 *data = NULL;
|
|
||||||
|
|
||||||
gst_matroska_read_common_peek_bytes (&parse->common, parse->common.offset,
|
|
||||||
peek, NULL, &data);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_matroska_parse_peek_id_length_pull (GstMatroskaParse * parse, guint32 * _id,
|
gst_matroska_parse_peek_id_length_pull (GstMatroskaParse * parse, guint32 * _id,
|
||||||
guint64 * _length, guint * _needed)
|
guint64 * _length, guint * _needed)
|
||||||
{
|
{
|
||||||
return gst_ebml_peek_id_length (_id, _length, _needed,
|
return gst_ebml_peek_id_length (_id, _length, _needed,
|
||||||
(GstPeekData) gst_matroska_parse_peek_pull, (gpointer) parse,
|
(GstPeekData) gst_matroska_read_common_peek_pull,
|
||||||
GST_ELEMENT_CAST (parse), parse->common.offset);
|
(gpointer) (&parse->common), GST_ELEMENT_CAST (parse),
|
||||||
|
parse->common.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint64
|
static gint64
|
||||||
|
|
|
@ -709,6 +709,16 @@ gst_matroska_read_common_peek_bytes (GstMatroskaReadCommon * common, guint64
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const guint8 *
|
||||||
|
gst_matroska_read_common_peek_pull (GstMatroskaReadCommon * common, guint peek)
|
||||||
|
{
|
||||||
|
guint8 *data = NULL;
|
||||||
|
|
||||||
|
gst_matroska_read_common_peek_bytes (common, common->offset, peek, NULL,
|
||||||
|
&data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
gst_matroska_read_common_read_track_encoding (GstMatroskaReadCommon * common,
|
gst_matroska_read_common_read_track_encoding (GstMatroskaReadCommon * common,
|
||||||
GstEbmlRead * ebml, GstMatroskaTrackContext * context)
|
GstEbmlRead * ebml, GstMatroskaTrackContext * context)
|
||||||
|
|
|
@ -80,6 +80,8 @@ GstFlowReturn gst_matroska_read_common_parse_skip (GstMatroskaReadCommon *
|
||||||
common, GstEbmlRead * ebml, const gchar * parent_name, guint id);
|
common, GstEbmlRead * ebml, const gchar * parent_name, guint id);
|
||||||
GstFlowReturn gst_matroska_read_common_peek_bytes (GstMatroskaReadCommon *
|
GstFlowReturn gst_matroska_read_common_peek_bytes (GstMatroskaReadCommon *
|
||||||
common, guint64 offset, guint size, GstBuffer ** p_buf, guint8 ** bytes);
|
common, guint64 offset, guint size, GstBuffer ** p_buf, guint8 ** bytes);
|
||||||
|
const guint8 * gst_matroska_read_common_peek_pull (GstMatroskaReadCommon *
|
||||||
|
common, guint peek);
|
||||||
gint gst_matroska_read_common_stream_from_num (GstMatroskaReadCommon * common,
|
gint gst_matroska_read_common_stream_from_num (GstMatroskaReadCommon * common,
|
||||||
guint track_num);
|
guint track_num);
|
||||||
GstFlowReturn gst_matroska_read_common_read_track_encoding (
|
GstFlowReturn gst_matroska_read_common_read_track_encoding (
|
||||||
|
|
Loading…
Reference in a new issue