summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-03-02 12:41:37 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2010-03-02 12:41:37 +0100
commit932c692c50d3622ed83eb1e49209e513a4290e40 (patch)
treedcbe2ad9e54a1542edd033aa80dd44a186dbbe7d
parent3519455c4e465ca5772b6b2eaf148bb90dc387b1 (diff)
h264pay: try to mark keyframe buffersh264pay-keyframes
-rw-r--r--gst/rtp/gstrtph264depay.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c
index 0d86ddfcb..505206118 100644
--- a/gst/rtp/gstrtph264depay.c
+++ b/gst/rtp/gstrtph264depay.c
@@ -474,6 +474,7 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
guint8 *outdata;
guint outsize, nalu_size;
GstClockTime ts;
+ gboolean keyframe;
/* baseclass already did this, would be nice not to have to redo ... */
ts = GST_BUFFER_TIMESTAMP (buf);
@@ -495,6 +496,8 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
nal_ref_idc = (payload[0] & 0x60) >> 5;
nal_unit_type = payload[0] & 0x1f;
+ keyframe = TRUE; //(nal_unit_type == 5 && nal_ref_idc > 0);
+
/* at least one byte header with type */
header_len = 1;
@@ -563,7 +566,9 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
outbuf = gst_rtp_h264_depay_push_nal (rtph264depay, outbuf, ts);
if (outbuf) {
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
- gst_base_rtp_depayload_push_ts (depayload, ts, outbuf);
+ if (!keyframe)
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+ gst_base_rtp_depayload_push (depayload, outbuf);
}
}
@@ -574,7 +579,11 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
if (!rtph264depay->merge) {
outsize = gst_adapter_available (rtph264depay->adapter);
outbuf = gst_adapter_take_buffer (rtph264depay->adapter, outsize);
+
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
+ if (!keyframe)
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+
return outbuf;
}
}
@@ -685,6 +694,9 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
}
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
+ if (!keyframe)
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+
return outbuf;
}
break;
@@ -724,6 +736,9 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
}
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
+ if (!keyframe)
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+
return outbuf;
}
}