mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-08 19:52:09 +00:00
gst/rtp/gstrtpL16pay.c: Removed some unused code.
Original commit message from CVS: * 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.
This commit is contained in:
parent
34974eed13
commit
fe26e8d94c
8 changed files with 41 additions and 8 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
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:
|
||||
|
|
|
@ -238,14 +238,13 @@ gst_rtp_L16_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
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);
|
||||
|
|
|
@ -205,7 +205,7 @@ gst_rtp_amr_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
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;
|
||||
|
@ -217,6 +217,7 @@ gst_rtp_amr_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
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)
|
||||
|
@ -276,6 +277,12 @@ gst_rtp_amr_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
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);
|
||||
|
||||
|
|
|
@ -129,13 +129,14 @@ gst_rtp_gsm_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
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;
|
||||
|
@ -144,8 +145,9 @@ gst_rtp_gsm_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
/* 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);
|
||||
|
|
|
@ -118,7 +118,7 @@ gst_rtp_mp2t_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
guint size, payload_len;
|
||||
GstBuffer *outbuf;
|
||||
guint8 *payload, *data;
|
||||
GstClockTime timestamp;
|
||||
GstClockTime timestamp, duration;
|
||||
GstFlowReturn ret;
|
||||
|
||||
rtpmp2tpay = GST_RTP_MP2T_PAY (basepayload);
|
||||
|
@ -126,6 +126,7 @@ gst_rtp_mp2t_pay_handle_buffer (GstBaseRTPPayload * 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;
|
||||
|
@ -134,6 +135,7 @@ gst_rtp_mp2t_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
|
||||
/* copy timestamp */
|
||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
||||
GST_BUFFER_DURATION (outbuf) = duration;
|
||||
|
||||
/* get payload */
|
||||
payload = gst_rtp_buffer_get_payload (outbuf);
|
||||
|
|
|
@ -209,7 +209,7 @@ gst_rtp_speex_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
guint size, payload_len;
|
||||
GstBuffer *outbuf;
|
||||
guint8 *payload, *data;
|
||||
GstClockTime timestamp;
|
||||
GstClockTime timestamp, duration;
|
||||
GstFlowReturn ret;
|
||||
|
||||
rtpspeexpay = GST_RTP_SPEEX_PAY (basepayload);
|
||||
|
@ -236,6 +236,7 @@ gst_rtp_speex_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
}
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
duration = GST_BUFFER_DURATION (buffer);
|
||||
|
||||
/* FIXME, only one SPEEX frame per RTP packet for now */
|
||||
payload_len = size;
|
||||
|
@ -244,8 +245,10 @@ gst_rtp_speex_pay_handle_buffer (GstBaseRTPPayload * basepayload,
|
|||
/* 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);
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ gst_rtp_theora_pay_init_packet (GstRtpTheoraPay * rtptheorapay, guint8 TDT,
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -203,6 +204,8 @@ gst_rtp_theora_pay_flush_packet (GstRtpTheoraPay * rtptheorapay)
|
|||
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),
|
||||
|
|
|
@ -199,6 +199,8 @@ gst_rtp_vorbis_pay_flush_packet (GstRtpVorbisPay * rtpvorbispay)
|
|||
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),
|
||||
|
|
Loading…
Reference in a new issue