summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-04-16 15:21:50 (GMT)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-04-30 11:50:00 (GMT)
commit0206b67b1dad066472e6557f6ada167a91c8ea6f (patch)
treea930a84d3186f6339d687f4681a3cc0842e07ea5
parentfe9e6d82ee3ccbce130b14e39e7b60bc4369015f (diff)
rtph263depay: extra keyframe info from PTYPE header
... as opposed to taking it from h263 payload header, which need not be so reliable. Fixes #610172.
-rw-r--r--gst/rtp/gstrtph263depay.c10
-rw-r--r--gst/rtp/gstrtph263depay.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/gst/rtp/gstrtph263depay.c b/gst/rtp/gstrtph263depay.c
index adb7ded..8ae5a28 100644
--- a/gst/rtp/gstrtph263depay.c
+++ b/gst/rtp/gstrtph263depay.c
@@ -206,7 +206,6 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
I = (payload[1] & 0x10) == 0x10;
-
} else {
if (P == 0) {
/* F == 1 and P == 0
@@ -257,12 +256,21 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
if (!F && payload_len > 4 && (GST_READ_UINT32_BE (payload) >> 10 == 0x20)) {
GST_DEBUG ("Mode A with PSC => frame start");
rtph263depay->start = TRUE;
+ if (!!(payload[4] & 0x02) != I) {
+ GST_DEBUG ("Wrong Picture Coding Type Flag in rtp header");
+ I = !I;
+ }
+ rtph263depay->psc_I = I;
} else {
GST_DEBUG ("no frame start yet, skipping payload");
goto skip;
}
}
+ /* only trust I info from Mode A starting packet
+ * from buggy payloaders or hw */
+ I = rtph263depay->psc_I;
+
if (SBIT) {
/* take the leftover and merge it at the beginning, FIXME make the buffer
* data writable. */
diff --git a/gst/rtp/gstrtph263depay.h b/gst/rtp/gstrtph263depay.h
index e161477..9cecb09 100644
--- a/gst/rtp/gstrtph263depay.h
+++ b/gst/rtp/gstrtph263depay.h
@@ -46,6 +46,7 @@ struct _GstRtpH263Depay
guint8 offset; /* offset to apply to next payload */
guint8 leftover; /* leftover from previous payload (if offset != 0) */
+ gboolean psc_I; /* Picture-Coding-Type == I from Picture Start Code packet */
GstAdapter *adapter;
gboolean start;
};