summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-03 09:51:04 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-15 16:28:42 +0200
commit0b0255ed124a4865f3ae0d672ce3ef54b2677bde (patch)
tree0db020eeeee45d25cb5055c4c43a85f5b93d76be
parent9f7ed3f180ee33a4ff71e1f8f448b24b53038880 (diff)
Merge structures into caps instead of appending them
-rw-r--r--sys/androidmedia/gstamcaudiodec.c20
-rw-r--r--sys/androidmedia/gstamcvideodec.c20
2 files changed, 20 insertions, 20 deletions
diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c
index 72c845d28..2b861be45 100644
--- a/sys/androidmedia/gstamcaudiodec.c
+++ b/sys/androidmedia/gstamcaudiodec.c
@@ -95,21 +95,21 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/3gpp") == 0) {
GstStructure *tmp;
tmp = gst_structure_new ("audio/AMR",
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/amr-wb") == 0) {
GstStructure *tmp;
tmp = gst_structure_new ("audio/AMR-WB",
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/mp4a-latm") == 0) {
gint j;
GstStructure *tmp, *tmp2;
@@ -147,13 +147,13 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
tmp2 = gst_structure_copy (tmp);
gst_structure_set (tmp2, "profile", G_TYPE_STRING, profile, NULL);
- gst_caps_append_structure (ret, tmp2);
+ gst_caps_merge_structure (ret, tmp2);
have_profile = TRUE;
}
if (!have_profile) {
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else {
gst_structure_free (tmp);
}
@@ -163,21 +163,21 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
tmp = gst_structure_new ("audio/x-alaw",
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/g711-mlaw") == 0) {
GstStructure *tmp;
tmp = gst_structure_new ("audio/x-mulaw",
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/vorbis") == 0) {
GstStructure *tmp;
tmp = gst_structure_new ("audio/x-vorbis",
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/flac") == 0) {
GstStructure *tmp;
@@ -185,7 +185,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"framed", G_TYPE_BOOLEAN, TRUE, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "audio/mpeg-L2") == 0) {
GstStructure *tmp;
@@ -195,7 +195,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
"rate", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"channels", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else {
GST_WARNING ("Unsupported mimetype '%s'", type->mime);
}
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 1421c48b4..fc07e019e 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -156,12 +156,12 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
gst_structure_set_value (tmp2, "level", &va);
g_value_unset (&va);
g_value_unset (&v);
- gst_caps_append_structure (ret, tmp2);
+ gst_caps_merge_structure (ret, tmp2);
have_profile_level = TRUE;
}
if (!have_profile_level) {
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else {
gst_structure_free (tmp);
}
@@ -210,12 +210,12 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
gst_structure_set_value (tmp2, "level", &va);
g_value_unset (&va);
g_value_unset (&v);
- gst_caps_append_structure (ret, tmp2);
+ gst_caps_merge_structure (ret, tmp2);
have_profile_level = TRUE;
}
if (!have_profile_level) {
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else {
gst_structure_free (tmp);
}
@@ -267,20 +267,20 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
if (!alternative)
g_value_unset (&va);
g_value_unset (&v);
- gst_caps_append_structure (ret, tmp2);
+ gst_caps_merge_structure (ret, tmp2);
if (alternative) {
tmp2 = gst_structure_copy (tmp);
gst_structure_set (tmp2, "profile", G_TYPE_STRING, alternative, NULL);
gst_structure_set_value (tmp2, "level", &va);
g_value_unset (&va);
- gst_caps_append_structure (ret, tmp2);
+ gst_caps_merge_structure (ret, tmp2);
}
have_profile_level = TRUE;
}
if (!have_profile_level) {
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else {
gst_structure_free (tmp);
}
@@ -292,7 +292,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
"height", GST_TYPE_INT_RANGE, 16, 4096,
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else if (strcmp (type->mime, "video/mpeg2") == 0) {
GstStructure *tmp;
@@ -305,7 +305,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
"systemstream", G_TYPE_BOOLEAN, FALSE,
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
- gst_caps_append_structure (ret, tmp);
+ gst_caps_merge_structure (ret, tmp);
} else {
GST_WARNING ("Unsupported mimetype '%s'", type->mime);
}
@@ -369,7 +369,7 @@ create_src_caps (const GstAmcCodecInfo * codec_info)
continue;
}
tmp = gst_video_format_new_template_caps (format);
- gst_caps_append (ret, tmp);
+ gst_caps_merge (ret, tmp);
}
}