mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 17:50:36 +00:00
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.
This commit is contained in:
parent
edd6b7ec72
commit
3b5584f8d1
2 changed files with 16 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-09-21 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_parse_audio_config):
|
||||||
|
Fix profile-level-id parsing and setup.
|
||||||
|
|
||||||
2006-09-21 Wim Taymans <wim@fluendo.com>
|
2006-09-21 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/udp/README:
|
* gst/udp/README:
|
||||||
|
|
|
@ -208,10 +208,10 @@ gst_rtp_mp4g_pay_parse_audio_config (GstRtpMP4GPay * rtpmp4gpay,
|
||||||
if (size < 2)
|
if (size < 2)
|
||||||
goto too_short;
|
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;
|
objectType = (data[0] & 0xf8) >> 3;
|
||||||
if (objectType != 2)
|
if (objectType == 0)
|
||||||
goto unsupported_type;
|
goto invalid_object;
|
||||||
|
|
||||||
samplingIdx = ((data[0] & 0x07) << 1) | ((data[1] & 0x80) >> 7);
|
samplingIdx = ((data[0] & 0x07) << 1) | ((data[1] & 0x80) >> 7);
|
||||||
/* only fixed values for now */
|
/* 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);
|
rtpmp4gpay->params = g_strdup_printf ("%d", channelCfg);
|
||||||
/* audio stream type */
|
/* audio stream type */
|
||||||
rtpmp4gpay->streamtype = "5";
|
rtpmp4gpay->streamtype = "5";
|
||||||
/* mode */
|
/* mode only high bitrate for now */
|
||||||
rtpmp4gpay->mode = "AAC-hbr";
|
rtpmp4gpay->mode = "AAC-hbr";
|
||||||
/* profile (should be 1) */
|
/* profile */
|
||||||
g_free (rtpmp4gpay->profile);
|
g_free (rtpmp4gpay->profile);
|
||||||
rtpmp4gpay->profile = g_strdup_printf ("%d", objectType - 1);
|
rtpmp4gpay->profile = g_strdup_printf ("%d", objectType);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpmp4gpay,
|
GST_DEBUG_OBJECT (rtpmp4gpay,
|
||||||
"objectType: %d, samplingIdx: %d (%d), channelCfg: %d", objectType,
|
"objectType: %d, samplingIdx: %d (%d), channelCfg: %d", objectType,
|
||||||
|
@ -255,13 +255,13 @@ gst_rtp_mp4g_pay_parse_audio_config (GstRtpMP4GPay * rtpmp4gpay,
|
||||||
too_short:
|
too_short:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, FORMAT,
|
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, FORMAT,
|
||||||
(NULL), ("config string too short"));
|
(NULL), ("config string too short, expected 2 bytes, got %d", size));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
unsupported_type:
|
invalid_object:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, NOT_IMPLEMENTED,
|
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, FORMAT,
|
||||||
(NULL), ("unsupported object type %d", objectType));
|
(NULL), ("invalid object type 0"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
wrong_freq:
|
wrong_freq:
|
||||||
|
@ -273,7 +273,7 @@ wrong_freq:
|
||||||
wrong_channels:
|
wrong_channels:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (rtpmp4gpay, STREAM, NOT_IMPLEMENTED,
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue