summaryrefslogtreecommitdiffstats
path: root/gst/rtp/gstrtpmp4gpay.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-09-21 13:33:16 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-09-21 13:33:16 +0000
commit3b5584f8d128b57f7c6dcbde21df044511b9fd99 (patch)
tree895e1d644adf234ed2f3730c355d9d5eb903061c /gst/rtp/gstrtpmp4gpay.c
parentedd6b7ec72eb13709101117cfc7e1876762e240f (diff)
gst/rtp/gstrtpmp4gpay.c: Fix profile-level-id parsing and setup.
Original commit message from CVS: * gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_parse_audio_config): Fix profile-level-id parsing and setup.
Diffstat (limited to 'gst/rtp/gstrtpmp4gpay.c')
-rw-r--r--gst/rtp/gstrtpmp4gpay.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c
index 42fae2ef..6657b712 100644
--- a/gst/rtp/gstrtpmp4gpay.c
+++ b/gst/rtp/gstrtpmp4gpay.c
@@ -208,10 +208,10 @@ gst_rtp_mp4g_pay_parse_audio_config (GstRtpMP4GPay * rtpmp4gpay,
if (size < 2)
goto too_short;
- /* only AAC LC for now */
+ /* any object type is fine, we need to copy it to the profile-level-id field. */
objectType = (data[0] & 0xf8) >> 3;
- if (objectType != 2)
- goto unsupported_type;
+ if (objectType == 0)
+ goto invalid_object;
samplingIdx = ((data[0] & 0x07) << 1) | ((data[1] & 0x80) >> 7);
/* only fixed values for now */
@@ -239,11 +239,11 @@ gst_rtp_mp4g_pay_parse_audio_config (GstRtpMP4GPay * rtpmp4gpay,
rtpmp4gpay->params = g_strdup_printf ("%d", channelCfg);
/* audio stream type */
rtpmp4gpay->streamtype = "5";
- /* mode */
+ /* mode only high bitrate for now */
rtpmp4gpay->mode = "AAC-hbr";
- /* profile (should be 1) */
+ /* profile */
g_free (rtpmp4gpay->profile);
- rtpmp4gpay->profile = g_strdup_printf ("%d", objectType - 1);
+ rtpmp4gpay->profile = g_strdup_printf ("%d", objectType);
GST_DEBUG_OBJECT (rtpmp4gpay,
"objectType: %d, samplingIdx: %d (%d), channelCfg: %d", objectType,
@@ -255,13 +255,13 @@ gst_rtp_mp4g_pay_parse_audio_config (GstRtpMP4GPay * rtpmp4gpay,
too_short:
{
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, FORMAT,
- (NULL), ("config string too short"));
+ (NULL), ("config string too short, expected 2 bytes, got %d", size));
return FALSE;
}
-unsupported_type:
+invalid_object:
{
- GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, NOT_IMPLEMENTED,
- (NULL), ("unsupported object type %d", objectType));
+ GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, FORMAT,
+ (NULL), ("invalid object type 0"));
return FALSE;
}
wrong_freq:
@@ -273,7 +273,7 @@ wrong_freq:
wrong_channels:
{
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, NOT_IMPLEMENTED,
- (NULL), ("unsupported number of channels %d", channelCfg));
+ (NULL), ("unsupported number of channels %d, must < 8", channelCfg));
return FALSE;
}
}