mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
mssdemux: add bitrate info to audio streams
bitrate info is always present on the QualityLevel xml node as part of the adaptive selection processing, put it into caps as some decoders require it (avdec_wmav2 for example) https://bugzilla.gnome.org/show_bug.cgi?id=699924
This commit is contained in:
parent
62860f4fa9
commit
f74f9cd3ab
1 changed files with 9 additions and 4 deletions
|
@ -451,8 +451,9 @@ _gst_mss_stream_add_h264_codec_data (GstCaps * caps, const gchar * codecdatastr)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
_gst_mss_stream_video_caps_from_qualitylevel_xml (xmlNodePtr node)
|
_gst_mss_stream_video_caps_from_qualitylevel_xml (GstMssStreamQuality * q)
|
||||||
{
|
{
|
||||||
|
xmlNodePtr node = q->xmlnode;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gchar *fourcc = (gchar *) xmlGetProp (node, (xmlChar *) "FourCC");
|
gchar *fourcc = (gchar *) xmlGetProp (node, (xmlChar *) "FourCC");
|
||||||
|
@ -556,8 +557,9 @@ _make_aacl_codec_data (guint64 sampling_rate, guint64 channels)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
_gst_mss_stream_audio_caps_from_qualitylevel_xml (xmlNodePtr node)
|
_gst_mss_stream_audio_caps_from_qualitylevel_xml (GstMssStreamQuality * q)
|
||||||
{
|
{
|
||||||
|
xmlNodePtr node = q->xmlnode;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gchar *fourcc = (gchar *) xmlGetProp (node, (xmlChar *) "FourCC");
|
gchar *fourcc = (gchar *) xmlGetProp (node, (xmlChar *) "FourCC");
|
||||||
|
@ -584,6 +586,9 @@ _gst_mss_stream_audio_caps_from_qualitylevel_xml (xmlNodePtr node)
|
||||||
gst_structure_set (structure, "rate", G_TYPE_INT,
|
gst_structure_set (structure, "rate", G_TYPE_INT,
|
||||||
(int) g_ascii_strtoull (rate, NULL, 10), NULL);
|
(int) g_ascii_strtoull (rate, NULL, 10), NULL);
|
||||||
}
|
}
|
||||||
|
if (q->bitrate) {
|
||||||
|
gst_structure_set (structure, "bitrate", G_TYPE_INT, q->bitrate, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (codec_data && strlen (codec_data)) {
|
if (codec_data && strlen (codec_data)) {
|
||||||
GstBuffer *buffer = gst_buffer_from_hex_string ((gchar *) codec_data);
|
GstBuffer *buffer = gst_buffer_from_hex_string ((gchar *) codec_data);
|
||||||
|
@ -697,11 +702,11 @@ gst_mss_stream_get_caps (GstMssStream * stream)
|
||||||
if (streamtype == MSS_STREAM_TYPE_VIDEO)
|
if (streamtype == MSS_STREAM_TYPE_VIDEO)
|
||||||
caps =
|
caps =
|
||||||
_gst_mss_stream_video_caps_from_qualitylevel_xml
|
_gst_mss_stream_video_caps_from_qualitylevel_xml
|
||||||
(qualitylevel->xmlnode);
|
(qualitylevel);
|
||||||
else if (streamtype == MSS_STREAM_TYPE_AUDIO)
|
else if (streamtype == MSS_STREAM_TYPE_AUDIO)
|
||||||
caps =
|
caps =
|
||||||
_gst_mss_stream_audio_caps_from_qualitylevel_xml
|
_gst_mss_stream_audio_caps_from_qualitylevel_xml
|
||||||
(qualitylevel->xmlnode);
|
(qualitylevel);
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue