summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-09-12 13:21:37 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-12 13:27:24 +0200
commit3cbf8da1ca13e85fa6cbd76f63e2d07cf57de453 (patch)
treeb845e53c86896aba2192b838df86a5b6b56cae85
parent591c257c5e012d4a98ef98dd64256c72888f3a3f (diff)
downloadgstreamer-plugins-bad-3cbf8da1ca13e85fa6cbd76f63e2d07cf57de453.tar.gz
amcvideodec: Don't put the level restrictions on the sinkpad caps
They tend to be inaccurate and having them in the sinkpad caps prevents playback of files that would otherwise play fine.
-rw-r--r--sys/androidmedia/gstamcvideodec.c64
1 files changed, 3 insertions, 61 deletions
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 58ab58ec9..8df6b3dcc 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -162,13 +162,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
if (type->n_profile_levels) {
for (j = type->n_profile_levels - 1; j >= 0; j--) {
- const gchar *profile, *level;
- gint k;
- GValue va = { 0, };
- GValue v = { 0, };
-
- g_value_init (&va, GST_TYPE_LIST);
- g_value_init (&v, G_TYPE_STRING);
+ const gchar *profile;
profile =
gst_amc_mpeg4_profile_to_string (type->profile_levels[j].profile);
@@ -178,21 +172,8 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
continue;
}
- for (k = 1; k <= type->profile_levels[j].level && k != 0; k <<= 1) {
- level = gst_amc_mpeg4_level_to_string (k);
- if (!level)
- continue;
-
- g_value_set_string (&v, level);
- gst_value_list_append_value (&va, &v);
- g_value_reset (&v);
- }
-
tmp2 = gst_structure_copy (tmp);
gst_structure_set (tmp2, "profile", G_TYPE_STRING, profile, NULL);
- gst_structure_set_value (tmp2, "level", &va);
- g_value_unset (&va);
- g_value_unset (&v);
ret = gst_caps_merge_structure (ret, tmp2);
have_profile_level = TRUE;
}
@@ -218,13 +199,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
if (type->n_profile_levels) {
for (j = type->n_profile_levels - 1; j >= 0; j--) {
- gint profile, level;
- gint k;
- GValue va = { 0, };
- GValue v = { 0, };
-
- g_value_init (&va, GST_TYPE_LIST);
- g_value_init (&v, G_TYPE_UINT);
+ gint profile;
profile =
gst_amc_h263_profile_to_gst_id (type->profile_levels[j].profile);
@@ -235,20 +210,8 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
continue;
}
- for (k = 1; k <= type->profile_levels[j].level && k != 0; k <<= 1) {
- level = gst_amc_h263_level_to_gst_id (k);
- if (level == -1)
- continue;
-
- g_value_set_uint (&v, level);
- gst_value_list_append_value (&va, &v);
- g_value_reset (&v);
- }
tmp2 = gst_structure_copy (tmp);
gst_structure_set (tmp2, "profile", G_TYPE_UINT, profile, NULL);
- gst_structure_set_value (tmp2, "level", &va);
- g_value_unset (&va);
- g_value_unset (&v);
ret = gst_caps_merge_structure (ret, tmp2);
have_profile_level = TRUE;
}
@@ -275,13 +238,7 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
if (type->n_profile_levels) {
for (j = type->n_profile_levels - 1; j >= 0; j--) {
- const gchar *profile, *alternative = NULL, *level;
- gint k;
- GValue va = { 0, };
- GValue v = { 0, };
-
- g_value_init (&va, GST_TYPE_LIST);
- g_value_init (&v, G_TYPE_STRING);
+ const gchar *profile, *alternative = NULL;
profile =
gst_amc_avc_profile_to_string (type->profile_levels[j].profile,
@@ -293,29 +250,14 @@ create_sink_caps (const GstAmcCodecInfo * codec_info)
continue;
}
- for (k = 1; k <= type->profile_levels[j].level && k != 0; k <<= 1) {
- level = gst_amc_avc_level_to_string (k);
- if (!level)
- continue;
-
- g_value_set_string (&v, level);
- gst_value_list_append_value (&va, &v);
- g_value_reset (&v);
- }
tmp2 = gst_structure_copy (tmp);
gst_structure_set (tmp2, "profile", G_TYPE_STRING, profile, NULL);
- gst_structure_set_value (tmp2, "level", &va);
- if (!alternative)
- g_value_unset (&va);
- g_value_unset (&v);
ret = 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);
ret = gst_caps_merge_structure (ret, tmp2);
}
have_profile_level = TRUE;