mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-09 05:38:58 +00:00
dashdemux: Suggestion for setting the framerate information.
Dashdemux has set the width and height information from MPD manifest. Some embedded devices which are not insufficient H/W resources need more information such as framerate to assign H/W resources. So I suggested that dashdemux also needs to set the framerate information from MDP manifest. https://bugzilla.gnome.org/show_bug.cgi?id=758515
This commit is contained in:
parent
6d8dd482c4
commit
6cbaec7593
3 changed files with 50 additions and 0 deletions
|
@ -866,6 +866,8 @@ gst_dash_demux_get_video_input_caps (GstDashDemux * demux,
|
||||||
GstActiveStream * stream)
|
GstActiveStream * stream)
|
||||||
{
|
{
|
||||||
guint width = 0, height = 0;
|
guint width = 0, height = 0;
|
||||||
|
gint fps_num = 0, fps_den = 1;
|
||||||
|
gboolean have_fps = FALSE;
|
||||||
GstCaps *caps = NULL;
|
GstCaps *caps = NULL;
|
||||||
|
|
||||||
if (stream == NULL)
|
if (stream == NULL)
|
||||||
|
@ -875,6 +877,8 @@ gst_dash_demux_get_video_input_caps (GstDashDemux * demux,
|
||||||
if (!gst_mpd_client_get_bitstream_switching_flag (stream)) {
|
if (!gst_mpd_client_get_bitstream_switching_flag (stream)) {
|
||||||
width = gst_mpd_client_get_video_stream_width (stream);
|
width = gst_mpd_client_get_video_stream_width (stream);
|
||||||
height = gst_mpd_client_get_video_stream_height (stream);
|
height = gst_mpd_client_get_video_stream_height (stream);
|
||||||
|
have_fps =
|
||||||
|
gst_mpd_client_get_video_stream_framerate (stream, &fps_num, &fps_den);
|
||||||
}
|
}
|
||||||
caps = gst_mpd_client_get_stream_caps (stream);
|
caps = gst_mpd_client_get_stream_caps (stream);
|
||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
|
@ -885,6 +889,11 @@ gst_dash_demux_get_video_input_caps (GstDashDemux * demux,
|
||||||
G_TYPE_INT, height, NULL);
|
G_TYPE_INT, height, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (have_fps) {
|
||||||
|
gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, fps_num,
|
||||||
|
fps_den, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5635,6 +5635,46 @@ gst_mpd_client_get_video_stream_height (GstActiveStream * stream)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_mpd_client_get_video_stream_framerate (GstActiveStream * stream,
|
||||||
|
gint * fps_num, gint * fps_den)
|
||||||
|
{
|
||||||
|
if (stream == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (stream->cur_adapt_set &&
|
||||||
|
stream->cur_adapt_set->RepresentationBase->frameRate != NULL) {
|
||||||
|
*fps_num = stream->cur_adapt_set->RepresentationBase->frameRate->num;
|
||||||
|
*fps_den = stream->cur_adapt_set->RepresentationBase->frameRate->den;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stream->cur_adapt_set &&
|
||||||
|
stream->cur_adapt_set->RepresentationBase->maxFrameRate != NULL) {
|
||||||
|
*fps_num = stream->cur_adapt_set->RepresentationBase->maxFrameRate->num;
|
||||||
|
*fps_den = stream->cur_adapt_set->RepresentationBase->maxFrameRate->den;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stream->cur_representation &&
|
||||||
|
stream->cur_representation->RepresentationBase->frameRate != NULL) {
|
||||||
|
*fps_num = stream->cur_representation->RepresentationBase->frameRate->num;
|
||||||
|
*fps_den = stream->cur_representation->RepresentationBase->frameRate->den;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stream->cur_representation &&
|
||||||
|
stream->cur_representation->RepresentationBase->maxFrameRate != NULL) {
|
||||||
|
*fps_num =
|
||||||
|
stream->cur_representation->RepresentationBase->maxFrameRate->num;
|
||||||
|
*fps_den =
|
||||||
|
stream->cur_representation->RepresentationBase->maxFrameRate->den;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
guint
|
guint
|
||||||
gst_mpd_client_get_audio_stream_rate (GstActiveStream * stream)
|
gst_mpd_client_get_audio_stream_rate (GstActiveStream * stream)
|
||||||
{
|
{
|
||||||
|
|
|
@ -586,6 +586,7 @@ GstCaps * gst_mpd_client_get_stream_caps (GstActiveStream * stream);
|
||||||
gboolean gst_mpd_client_get_bitstream_switching_flag (GstActiveStream * stream);
|
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_width (GstActiveStream * stream);
|
||||||
guint gst_mpd_client_get_video_stream_height (GstActiveStream * stream);
|
guint gst_mpd_client_get_video_stream_height (GstActiveStream * stream);
|
||||||
|
gboolean gst_mpd_client_get_video_stream_framerate (GstActiveStream * stream, gint * fps_num, gint * fps_den);
|
||||||
guint gst_mpd_client_get_audio_stream_rate (GstActiveStream * stream);
|
guint gst_mpd_client_get_audio_stream_rate (GstActiveStream * stream);
|
||||||
guint gst_mpd_client_get_audio_stream_num_channels (GstActiveStream * stream);
|
guint gst_mpd_client_get_audio_stream_num_channels (GstActiveStream * stream);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue