+2007-09-19 Wim Taymans <wim.taymans@gmail.com>
+
+ * gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_handle_buffer):
+ Removed some unused code.
+
+ * gst/rtp/gstrtpamrpay.c: (gst_rtp_amr_pay_handle_buffer):
+ * gst/rtp/gstrtpgsmpay.c: (gst_rtp_gsm_pay_handle_buffer):
+ * gst/rtp/gstrtpmp2tpay.c: (gst_rtp_mp2t_pay_handle_buffer):
+ * gst/rtp/gstrtpspeexpay.c: (gst_rtp_speex_pay_handle_buffer):
+ * gst/rtp/gstrtptheorapay.c: (gst_rtp_theora_pay_init_packet),
+ (gst_rtp_theora_pay_flush_packet):
+ * gst/rtp/gstrtpvorbispay.c: (gst_rtp_vorbis_pay_flush_packet):
+ Try to preserve the incomming buffer duration on the outgoing
+ packets. Fixes #478244.
+
2007-09-18 Tim-Philipp Müller <tim at centricular dot net>
* ext/taglib/gstapev2mux.cc:
GstRtpL16Pay *rtpL16pay;
GstFlowReturn ret = GST_FLOW_OK;
guint payload_len;
- GstClockTime timestamp, duration;
+ GstClockTime timestamp;
guint mtu, avail;
rtpL16pay = GST_RTP_L16_PAY (basepayload);
mtu = GST_BASE_RTP_PAYLOAD_MTU (rtpL16pay);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
- duration = GST_BUFFER_DURATION (buffer);
if (GST_BUFFER_IS_DISCONT (buffer))
gst_adapter_clear (rtpL16pay->adapter);
guint size, payload_len;
GstBuffer *outbuf;
guint8 *payload, *data, *payload_amr;
- GstClockTime timestamp;
+ GstClockTime timestamp, duration;
guint packet_len, mtu;
gint i, num_packets, num_nonempty_packets;
gint amr_len;
size = GST_BUFFER_SIZE (buffer);
data = GST_BUFFER_DATA (buffer);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
+ duration = GST_BUFFER_DURATION (buffer);
/* setup frame size pointer */
if (rtpamrpay->mode == GST_RTP_AMR_P_MODE_NB)
GST_BUFFER_TIMESTAMP (outbuf) = count * 20 * GST_MSECOND;
}
+ if (duration != GST_CLOCK_TIME_NONE)
+ GST_BUFFER_DURATION (outbuf) = duration;
+ else {
+ GST_BUFFER_DURATION (outbuf) = 20 * GST_MSECOND;
+ }
+
/* get payload, this is now writable */
payload = gst_rtp_buffer_get_payload (outbuf);
guint size, payload_len;
GstBuffer *outbuf;
guint8 *payload, *data;
- GstClockTime timestamp;
+ GstClockTime timestamp, duration;
GstFlowReturn ret;
rtpgsmpay = GST_RTP_GSM_PAY (basepayload);
size = GST_BUFFER_SIZE (buffer);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
+ duration = GST_BUFFER_DURATION (buffer);
/* FIXME, only one GSM frame per RTP packet for now */
payload_len = size;
/* FIXME, assert for now */
g_assert (payload_len <= GST_BASE_RTP_PAYLOAD_MTU (rtpgsmpay));
- /* copy timestamp */
+ /* copy timestamp and duration */
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
+ GST_BUFFER_DURATION (outbuf) = duration;
/* get payload */
payload = gst_rtp_buffer_get_payload (outbuf);
guint size, payload_len;
GstBuffer *outbuf;
guint8 *payload, *data;
- GstClockTime timestamp;
+ GstClockTime timestamp, duration;
GstFlowReturn ret;
rtpmp2tpay = GST_RTP_MP2T_PAY (basepayload);
size = GST_BUFFER_SIZE (buffer);
data = GST_BUFFER_DATA (buffer);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
+ duration = GST_BUFFER_DURATION (buffer);
/* FIXME, only one MP2T frame per RTP packet for now */
payload_len = size;
/* copy timestamp */
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
+ GST_BUFFER_DURATION (outbuf) = duration;
/* get payload */
payload = gst_rtp_buffer_get_payload (outbuf);
guint size, payload_len;
GstBuffer *outbuf;
guint8 *payload, *data;
- GstClockTime timestamp;
+ GstClockTime timestamp, duration;
GstFlowReturn ret;
rtpspeexpay = GST_RTP_SPEEX_PAY (basepayload);
}
timestamp = GST_BUFFER_TIMESTAMP (buffer);
+ duration = GST_BUFFER_DURATION (buffer);
/* FIXME, only one SPEEX frame per RTP packet for now */
payload_len = size;
/* FIXME, assert for now */
g_assert (payload_len <= GST_BASE_RTP_PAYLOAD_MTU (rtpspeexpay));
- /* copy timestamp */
+ /* copy timestamp and duration */
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
+ GST_BUFFER_DURATION (outbuf) = duration;
+
/* get payload */
payload = gst_rtp_buffer_get_payload (outbuf);
gst_rtp_buffer_new_allocate_len (GST_BASE_RTP_PAYLOAD_MTU
(rtptheorapay), 0, 0);
gst_rtp_theora_pay_reset_packet (rtptheorapay, TDT);
+
GST_BUFFER_TIMESTAMP (rtptheorapay->packet) = timestamp;
}
hlen = gst_rtp_buffer_calc_header_len (0);
GST_BUFFER_SIZE (rtptheorapay->packet) = hlen + rtptheorapay->payload_pos;
+ GST_BUFFER_DURATION (rtptheorapay->packet) = rtptheorapay->payload_duration;
+
/* push, this gives away our ref to the packet, so clear it. */
ret =
gst_basertppayload_push (GST_BASE_RTP_PAYLOAD (rtptheorapay),
hlen = gst_rtp_buffer_calc_header_len (0);
GST_BUFFER_SIZE (rtpvorbispay->packet) = hlen + rtpvorbispay->payload_pos;
+ GST_BUFFER_DURATION (rtpvorbispay->packet) = rtpvorbispay->payload_duration;
+
/* push, this gives away our ref to the packet, so clear it. */
ret =
gst_basertppayload_push (GST_BASE_RTP_PAYLOAD (rtpvorbispay),