From 470c860ffafcc56cb3a529a15a27dcaa96d3b235 Mon Sep 17 00:00:00 2001 From: Gianluca Gennari Date: Mon, 17 Dec 2012 15:39:10 +0100 Subject: [PATCH] mpdparser: do not switch pads when bitstreamSwitching = true --- ext/dash/gstdashdemux.c | 18 ++++++++++++------ ext/dash/gstmpdparser.c | 8 ++++++++ ext/dash/gstmpdparser.h | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index c98faf41e0..ca82167889 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1502,15 +1502,18 @@ static GstCaps * gst_dash_demux_get_video_input_caps (GstDashDemux * demux, GstActiveStream * stream) { - guint width, height; + guint width = 0, height = 0; const gchar *mimeType = NULL; GstCaps *caps = NULL; if (stream == NULL) return NULL; - width = gst_mpd_client_get_video_stream_width (stream); - height = gst_mpd_client_get_video_stream_height (stream); + /* if bitstreamSwitching is true we dont need to swich pads on resolution change */ + if (!gst_mpd_client_get_bitstream_switching_flag (stream)) { + width = gst_mpd_client_get_video_stream_width (stream); + height = gst_mpd_client_get_video_stream_height (stream); + } mimeType = gst_mpd_client_get_stream_mimeType (stream); if (mimeType == NULL) return NULL; @@ -1528,15 +1531,18 @@ static GstCaps * gst_dash_demux_get_audio_input_caps (GstDashDemux * demux, GstActiveStream * stream) { - guint rate, channels; + guint rate = 0, channels = 0; const gchar *mimeType; GstCaps *caps = NULL; if (stream == NULL) return NULL; - channels = gst_mpd_client_get_audio_stream_num_channels (stream); - rate = gst_mpd_client_get_audio_stream_rate (stream); + /* if bitstreamSwitching is true we dont need to swich pads on rate/channels change */ + if (!gst_mpd_client_get_bitstream_switching_flag (stream)) { + channels = gst_mpd_client_get_audio_stream_num_channels (stream); + rate = gst_mpd_client_get_audio_stream_rate (stream); + } mimeType = gst_mpd_client_get_stream_mimeType (stream); if (mimeType == NULL) return NULL; diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 5d0a844d19..a165d3eb0f 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -3196,6 +3196,14 @@ const gchar *gst_mpd_client_get_stream_mimeType (GstActiveStream * stream) return gst_mpdparser_mimetype_to_caps (mimeType); } +const gboolean gst_mpd_client_get_bitstream_switching_flag (GstActiveStream * stream) +{ + if (stream == NULL || stream->cur_adapt_set == NULL) + return FALSE; + + return stream->cur_adapt_set->bitstreamSwitching; +} + guint gst_mpd_client_get_video_stream_width (GstActiveStream * stream) { guint width; diff --git a/ext/dash/gstmpdparser.h b/ext/dash/gstmpdparser.h index d6132986ba..a0845432ed 100644 --- a/ext/dash/gstmpdparser.h +++ b/ext/dash/gstmpdparser.h @@ -498,6 +498,7 @@ guint gst_mpd_client_get_segment_index (GstActiveStream * stream); /* Get audio/video stream parameters (mimeType, width, height, rate, number of channels) */ const gchar *gst_mpd_client_get_stream_mimeType (GstActiveStream * stream); +const gboolean gst_mpd_client_get_bitstream_switching_flag (GstActiveStream * stream); guint gst_mpd_client_get_video_stream_width (GstActiveStream * stream); guint gst_mpd_client_get_video_stream_height (GstActiveStream * stream); guint gst_mpd_client_get_audio_stream_rate (GstActiveStream * stream);