summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-11-01 14:56:28 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2010-11-01 15:09:05 +0100
commit706731b331c2aa77b6e3d58d7eb72ebdcdb4ee1b (patch)
treed98d2bc16ee2e1b61d89d54965e00be5e16c0e5f
parente400c8482aa7fce41acdda213e9d0d27bef15b45 (diff)
rtph264depay: only set delta unit on all-non-key units
Only set the delta flag when all of the units in the packet are delta units. Based on patch from Olivier CrĂȘte <olivier.crete@collabora.co.uk> Fixes #632945
-rw-r--r--gst/rtp/gstrtph264depay.c22
-rw-r--r--gst/rtp/gstrtph264depay.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c
index 697d818eb..c63087e07 100644
--- a/gst/rtp/gstrtph264depay.c
+++ b/gst/rtp/gstrtph264depay.c
@@ -413,7 +413,7 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
guint8 *data;
GstBuffer *outbuf = NULL;
GstClockTime out_timestamp;
- gboolean delta, out_delta;
+ gboolean keyframe, out_keyframe;
size = GST_BUFFER_SIZE (nal);
if (G_UNLIKELY (size < 5))
@@ -424,9 +424,9 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
nal_type = data[4] & 0x1f;
GST_DEBUG_OBJECT (rtph264depay, "handle NAL type %d", nal_type);
- delta = !NAL_TYPE_IS_KEY (nal_type);
+ keyframe = NAL_TYPE_IS_KEY (nal_type);
- out_delta = delta;
+ out_keyframe = keyframe;
out_timestamp = in_timestamp;
if (rtph264depay->merge) {
@@ -460,9 +460,9 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
outbuf = gst_adapter_take_buffer (rtph264depay->picture_adapter, outsize);
out_timestamp = rtph264depay->last_ts;
- out_delta = rtph264depay->last_delta;
+ out_keyframe = rtph264depay->last_keyframe;
- rtph264depay->last_delta = FALSE;
+ rtph264depay->last_keyframe = FALSE;
rtph264depay->picture_start = FALSE;
}
@@ -470,7 +470,7 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
GST_DEBUG_OBJECT (depayload, "adding NAL to picture adapter");
gst_adapter_push (rtph264depay->picture_adapter, nal);
rtph264depay->last_ts = in_timestamp;
- rtph264depay->last_delta |= delta;
+ rtph264depay->last_keyframe |= keyframe;
rtph264depay->picture_start |= start;
} else {
/* no merge, output is input nal */
@@ -484,16 +484,16 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
GST_DEBUG_OBJECT (depayload, "prepending codec_data");
outbuf = gst_buffer_join (rtph264depay->codec_data, outbuf);
rtph264depay->codec_data = NULL;
- out_delta = FALSE;
+ out_keyframe = TRUE;
}
outbuf = gst_buffer_make_metadata_writable (outbuf);
GST_BUFFER_TIMESTAMP (outbuf) = out_timestamp;
- if (out_delta)
- GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
- else
+ if (out_keyframe)
GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+ else
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
@@ -782,7 +782,7 @@ gst_rtp_h264_depay_change_state (GstElement * element,
rtph264depay->wait_start = TRUE;
gst_adapter_clear (rtph264depay->picture_adapter);
rtph264depay->picture_start = FALSE;
- rtph264depay->last_delta = FALSE;
+ rtph264depay->last_keyframe = FALSE;
break;
default:
break;
diff --git a/gst/rtp/gstrtph264depay.h b/gst/rtp/gstrtph264depay.h
index 17d001a3c..e801f1fe8 100644
--- a/gst/rtp/gstrtph264depay.h
+++ b/gst/rtp/gstrtph264depay.h
@@ -55,7 +55,7 @@ struct _GstRtpH264Depay
GstAdapter *picture_adapter;
gboolean picture_start;
GstClockTime last_ts;
- gboolean last_delta;
+ gboolean last_keyframe;
};
struct _GstRtpH264DepayClass