summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-10-01 14:52:15 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-10-01 15:29:36 +0100
commit719a9f573977fbff75db053b771b2c3a0c6e4281 (patch)
treea08ea962a6572b4ed7035bc9751342b12bc6e612
parentbcf7a7341ea906d200ce903cd22bc96d4a486c2f (diff)
codec utils: populate mpeg4 caps "level" field with level, not profile
Call the right function to get the level. Also add some more debug logging.
-rw-r--r--gst-libs/gst/pbutils/codec-utils.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gst-libs/gst/pbutils/codec-utils.c b/gst-libs/gst/pbutils/codec-utils.c
index f8210eb51..112d240fc 100644
--- a/gst-libs/gst/pbutils/codec-utils.c
+++ b/gst-libs/gst/pbutils/codec-utils.c
@@ -111,6 +111,8 @@ gst_codec_utils_aac_get_profile (const guint8 * audio_config, guint len)
if (len < 1)
return NULL;
+ GST_MEMDUMP ("audio config", audio_config, len);
+
profile = audio_config[0] >> 3;
switch (profile) {
case 1:
@@ -181,6 +183,8 @@ gst_codec_utils_aac_get_level (const guint8 * audio_config, guint len)
if (len < 2)
return NULL;
+ GST_MEMDUMP ("audio config", audio_config, len);
+
profile = audio_config[0] >> 3;
/* FIXME: add support for sr_idx = 0xf */
sr_idx = ((audio_config[0] & 0x7) << 1) | ((audio_config[1] & 0x80) >> 7);
@@ -365,6 +369,9 @@ gst_codec_utils_aac_caps_set_level_and_profile (GstCaps * caps,
}
}
+ GST_LOG ("profile : %s", (profile) ? profile : "---");
+ GST_LOG ("level : %s", (level) ? level : "---");
+
return (level != NULL && profile != NULL);
}
@@ -403,6 +410,8 @@ gst_codec_utils_h264_get_profile (const guint8 * sps, guint len)
if (len < 2)
return NULL;
+ GST_MEMDUMP ("SPS", sps, len);
+
csf1 = (sps[1] & 0x40) >> 6;
csf3 = (sps[1] & 0x10) >> 4;
@@ -473,6 +482,8 @@ gst_codec_utils_h264_get_level (const guint8 * sps, guint len)
if (len < 3)
return NULL;
+ GST_MEMDUMP ("SPS", sps, len);
+
csf3 = (sps[1] & 0x10) >> 4;
if (sps[2] == 11 && csf3)
@@ -542,6 +553,9 @@ gst_codec_utils_h264_caps_set_level_and_profile (GstCaps * caps,
if (profile != NULL)
gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile, NULL);
+ GST_LOG ("profile : %s", (profile) ? profile : "---");
+ GST_LOG ("level : %s", (level) ? level : "---");
+
return (level != NULL && profile != NULL);
}
@@ -580,9 +594,13 @@ gst_codec_utils_mpeg4video_get_profile (const guint8 * vis_obj_seq, guint len)
if (len < 1)
return NULL;
+ GST_MEMDUMP ("VOS", vis_obj_seq, len);
+
profile_id = vis_obj_seq[0] >> 4;
level_id = vis_obj_seq[0] & 0xf;
+ GST_LOG ("profile_id = %d, level_id = %d", profile_id, level_id);
+
if (profile_id != 6 && profile_id < 0xe)
return profiles[profile_id];
@@ -648,9 +666,13 @@ gst_codec_utils_mpeg4video_get_level (const guint8 * vis_obj_seq, guint len)
if (len < 1)
return NULL;
+ GST_MEMDUMP ("VOS", vis_obj_seq, len);
+
profile_id = vis_obj_seq[0] >> 4;
level_id = vis_obj_seq[0] & 0xf;
+ GST_LOG ("profile_id = %d, level_id = %d", profile_id, level_id);
+
if (profile_id != 0xf && level_id == 0)
return NULL;
@@ -725,10 +747,13 @@ gst_codec_utils_mpeg4video_caps_set_level_and_profile (GstCaps * caps,
if (profile != NULL)
gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile, NULL);
- level = gst_codec_utils_mpeg4video_get_profile (vis_obj_seq, len);
+ level = gst_codec_utils_mpeg4video_get_level (vis_obj_seq, len);
if (level != NULL)
gst_caps_set_simple (caps, "level", G_TYPE_STRING, level, NULL);
+ GST_LOG ("profile : %s", (profile) ? profile : "---");
+ GST_LOG ("level : %s", (level) ? level : "---");
+
return (profile != NULL && level != NULL);
}