mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
rtpmp4vpay: Add support for more formats
Hack around short header mpeg4 video files and put the short header as the config string. Fixes #572551.
This commit is contained in:
parent
81f25317e6
commit
8b6c8b934a
1 changed files with 20 additions and 9 deletions
|
@ -351,20 +351,23 @@ gst_rtp_mp4v_pay_depay_data (GstRtpMP4VPay * enc, guint8 * data, guint size,
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case VOS_STARTCODE:
|
case VOS_STARTCODE:
|
||||||
|
case 0x00000101:
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
guint8 profile;
|
guint8 profile;
|
||||||
gboolean newprofile = FALSE;
|
gboolean newprofile = FALSE;
|
||||||
gboolean equal;
|
gboolean equal;
|
||||||
|
|
||||||
/* profile_and_level_indication */
|
if (code == VOS_STARTCODE) {
|
||||||
profile = data[4];
|
/* 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) {
|
if (profile != enc->profile) {
|
||||||
newprofile = TRUE;
|
newprofile = TRUE;
|
||||||
enc->profile = profile;
|
enc->profile = profile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* up to the next GOP_STARTCODE or VOP_STARTCODE is
|
/* 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;
|
result = FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_DEBUG_OBJECT (enc, "other startcode");
|
if (code >= 0x20 && code <= 0x2f) {
|
||||||
/* all other startcodes need a flush */
|
GST_DEBUG_OBJECT (enc, "short header");
|
||||||
result = TRUE;
|
result = FALSE;
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (enc, "other startcode");
|
||||||
|
/* all other startcodes need a flush */
|
||||||
|
result = TRUE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -452,6 +460,9 @@ gst_rtp_mp4v_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
||||||
if (!rtpmp4vpay->send_config) {
|
if (!rtpmp4vpay->send_config) {
|
||||||
GstBuffer *subbuf;
|
GstBuffer *subbuf;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (rtpmp4vpay, "stripping config at %d, size %d", strip,
|
||||||
|
size - strip);
|
||||||
|
|
||||||
/* strip off header */
|
/* strip off header */
|
||||||
subbuf = gst_buffer_create_sub (buffer, strip, size - strip);
|
subbuf = gst_buffer_create_sub (buffer, strip, size - strip);
|
||||||
GST_BUFFER_TIMESTAMP (subbuf) = timestamp;
|
GST_BUFFER_TIMESTAMP (subbuf) = timestamp;
|
||||||
|
|
Loading…
Reference in a new issue