mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 15:36:42 +00:00
dashdemux: don't meddle with the class struct from an instance
Fix some very dubious code. The class methods should always be set, and the instance-specific check should then be done inside the method. For data_received that's there already, for finish_fragment we need to add it. https://bugzilla.gnome.org/show_bug.cgi?id=753937
This commit is contained in:
parent
b392a6e3b9
commit
ef7f5fc4c7
1 changed files with 10 additions and 8 deletions
|
@ -411,6 +411,10 @@ gst_dash_demux_class_init (GstDashDemuxClass * klass)
|
||||||
gst_dash_demux_get_live_seek_range;
|
gst_dash_demux_get_live_seek_range;
|
||||||
gstadaptivedemux_class->get_presentation_offset =
|
gstadaptivedemux_class->get_presentation_offset =
|
||||||
gst_dash_demux_get_presentation_offset;
|
gst_dash_demux_get_presentation_offset;
|
||||||
|
|
||||||
|
gstadaptivedemux_class->finish_fragment =
|
||||||
|
gst_dash_demux_stream_fragment_finished;
|
||||||
|
gstadaptivedemux_class->data_received = gst_dash_demux_data_received;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -702,7 +706,6 @@ done:
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dash_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
|
gst_dash_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstAdaptiveDemuxClass *klass;
|
|
||||||
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (demux);
|
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (demux);
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
gchar *manifest;
|
gchar *manifest;
|
||||||
|
@ -722,13 +725,6 @@ gst_dash_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
|
||||||
if (gst_buffer_map (buf, &mapinfo, GST_MAP_READ)) {
|
if (gst_buffer_map (buf, &mapinfo, GST_MAP_READ)) {
|
||||||
manifest = (gchar *) mapinfo.data;
|
manifest = (gchar *) mapinfo.data;
|
||||||
if (gst_mpd_parse (dashdemux->client, manifest, mapinfo.size)) {
|
if (gst_mpd_parse (dashdemux->client, manifest, mapinfo.size)) {
|
||||||
if (gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client)) {
|
|
||||||
klass = GST_ADAPTIVE_DEMUX_GET_CLASS (dashdemux);
|
|
||||||
|
|
||||||
klass->data_received = gst_dash_demux_data_received;
|
|
||||||
klass->finish_fragment = gst_dash_demux_stream_fragment_finished;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gst_mpd_client_setup_media_presentation (dashdemux->client)) {
|
if (gst_mpd_client_setup_media_presentation (dashdemux->client)) {
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1434,6 +1430,7 @@ gst_dash_demux_stream_fragment_finished (GstAdaptiveDemux * demux,
|
||||||
dashstream->sidx_parser.status == GST_ISOFF_SIDX_PARSER_FINISHED)
|
dashstream->sidx_parser.status == GST_ISOFF_SIDX_PARSER_FINISHED)
|
||||||
/* fragment is advanced on data_received when byte limits are reached */
|
/* fragment is advanced on data_received when byte limits are reached */
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
if (G_UNLIKELY (stream->downloading_header || stream->downloading_index))
|
if (G_UNLIKELY (stream->downloading_header || stream->downloading_index))
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
|
@ -1446,10 +1443,15 @@ gst_dash_demux_data_received (GstAdaptiveDemux * demux,
|
||||||
GstAdaptiveDemuxStream * stream)
|
GstAdaptiveDemuxStream * stream)
|
||||||
{
|
{
|
||||||
GstDashDemuxStream *dash_stream = (GstDashDemuxStream *) stream;
|
GstDashDemuxStream *dash_stream = (GstDashDemuxStream *) stream;
|
||||||
|
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (demux);
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
gsize available;
|
gsize available;
|
||||||
|
|
||||||
|
if (!gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client))
|
||||||
|
return GST_ADAPTIVE_DEMUX_CLASS (parent_class)->data_received (demux,
|
||||||
|
stream);
|
||||||
|
|
||||||
if (stream->downloading_index) {
|
if (stream->downloading_index) {
|
||||||
GstIsoffParserResult res;
|
GstIsoffParserResult res;
|
||||||
guint consumed;
|
guint consumed;
|
||||||
|
|
Loading…
Reference in a new issue