summaryrefslogtreecommitdiffstats
path: root/gst/rtp/gstrtpmp4vpay.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-03-02 17:18:55 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2009-03-02 17:18:55 +0100
commit8b6c8b934ac0065218a273b42381106c862c6d19 (patch)
tree4eacbdb8a8ac9aa014666ab8742522f8ab20b810 /gst/rtp/gstrtpmp4vpay.c
parent81f25317e669efac0907aaef0b28ac470e7cb482 (diff)
rtpmp4vpay: Add support for more formats
Hack around short header mpeg4 video files and put the short header as the config string. Fixes #572551.
Diffstat (limited to 'gst/rtp/gstrtpmp4vpay.c')
-rw-r--r--gst/rtp/gstrtpmp4vpay.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/gst/rtp/gstrtpmp4vpay.c b/gst/rtp/gstrtpmp4vpay.c
index afff75d5..fb684a7c 100644
--- a/gst/rtp/gstrtpmp4vpay.c
+++ b/gst/rtp/gstrtpmp4vpay.c
@@ -351,20 +351,23 @@ gst_rtp_mp4v_pay_depay_data (GstRtpMP4VPay * enc, guint8 * data, guint size,
switch (code) {
case VOS_STARTCODE:
+ case 0x00000101:
{
gint i;
guint8 profile;
gboolean newprofile = FALSE;
gboolean equal;
- /* profile_and_level_indication */
- profile = data[4];
+ if (code == VOS_STARTCODE) {
+ /* profile_and_level_indication */
+ profile = data[4];
- GST_DEBUG_OBJECT (enc, "VOS profile 0x%08x", profile);
+ GST_DEBUG_OBJECT (enc, "VOS profile 0x%08x", profile);
- if (profile != enc->profile) {
- newprofile = TRUE;
- enc->profile = profile;
+ if (profile != enc->profile) {
+ newprofile = TRUE;
+ enc->profile = profile;
+ }
}
/* up to the next GOP_STARTCODE or VOP_STARTCODE is
@@ -402,9 +405,14 @@ gst_rtp_mp4v_pay_depay_data (GstRtpMP4VPay * enc, guint8 * data, guint size,
result = FALSE;
break;
default:
- GST_DEBUG_OBJECT (enc, "other startcode");
- /* all other startcodes need a flush */
- result = TRUE;
+ if (code >= 0x20 && code <= 0x2f) {
+ GST_DEBUG_OBJECT (enc, "short header");
+ result = FALSE;
+ } else {
+ GST_DEBUG_OBJECT (enc, "other startcode");
+ /* all other startcodes need a flush */
+ result = TRUE;
+ }
break;
}
return result;
@@ -452,6 +460,9 @@ gst_rtp_mp4v_pay_handle_buffer (GstBaseRTPPayload * basepayload,
if (!rtpmp4vpay->send_config) {
GstBuffer *subbuf;
+ GST_LOG_OBJECT (rtpmp4vpay, "stripping config at %d, size %d", strip,
+ size - strip);
+
/* strip off header */
subbuf = gst_buffer_create_sub (buffer, strip, size - strip);
GST_BUFFER_TIMESTAMP (subbuf) = timestamp;