mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
aacparse: Add stream-format to output caps
Adds stream-format field to output caps
This commit is contained in:
parent
5b8b363310
commit
7cfe3643db
1 changed files with 17 additions and 0 deletions
|
@ -210,6 +210,7 @@ gst_aacparse_set_src_caps (GstAacParse * aacparse, GstCaps * sink_caps)
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
GstCaps *src_caps = NULL;
|
GstCaps *src_caps = NULL;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
|
const gchar *stream_format;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (aacparse, "sink caps: %" GST_PTR_FORMAT, sink_caps);
|
GST_DEBUG_OBJECT (aacparse, "sink caps: %" GST_PTR_FORMAT, sink_caps);
|
||||||
if (sink_caps)
|
if (sink_caps)
|
||||||
|
@ -220,11 +221,27 @@ gst_aacparse_set_src_caps (GstAacParse * aacparse, GstCaps * sink_caps)
|
||||||
gst_caps_set_simple (src_caps, "framed", G_TYPE_BOOLEAN, TRUE,
|
gst_caps_set_simple (src_caps, "framed", G_TYPE_BOOLEAN, TRUE,
|
||||||
"mpegversion", G_TYPE_INT, aacparse->mpegversion, NULL);
|
"mpegversion", G_TYPE_INT, aacparse->mpegversion, NULL);
|
||||||
|
|
||||||
|
switch (aacparse->header_type) {
|
||||||
|
case DSPAAC_HEADER_NONE:
|
||||||
|
stream_format = "none";
|
||||||
|
break;
|
||||||
|
case DSPAAC_HEADER_ADTS:
|
||||||
|
stream_format = "adts";
|
||||||
|
break;
|
||||||
|
case DSPAAC_HEADER_ADIF:
|
||||||
|
stream_format = "adif";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
stream_format = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
s = gst_caps_get_structure (src_caps, 0);
|
s = gst_caps_get_structure (src_caps, 0);
|
||||||
if (!gst_structure_has_field (s, "rate") && aacparse->sample_rate > 0)
|
if (!gst_structure_has_field (s, "rate") && aacparse->sample_rate > 0)
|
||||||
gst_structure_set (s, "rate", G_TYPE_INT, aacparse->sample_rate, NULL);
|
gst_structure_set (s, "rate", G_TYPE_INT, aacparse->sample_rate, NULL);
|
||||||
if (!gst_structure_has_field (s, "channels") && aacparse->channels > 0)
|
if (!gst_structure_has_field (s, "channels") && aacparse->channels > 0)
|
||||||
gst_structure_set (s, "channels", G_TYPE_INT, aacparse->channels, NULL);
|
gst_structure_set (s, "channels", G_TYPE_INT, aacparse->channels, NULL);
|
||||||
|
if (!gst_structure_has_field (s, "stream-format") && stream_format)
|
||||||
|
gst_structure_set (s, "stream-format", G_TYPE_STRING, stream_format, NULL);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (aacparse, "setting src caps: %" GST_PTR_FORMAT, src_caps);
|
GST_DEBUG_OBJECT (aacparse, "setting src caps: %" GST_PTR_FORMAT, src_caps);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue