From c1ae0a2003da6048bc3dc05d0b70eb6767b8bc8c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 2 Sep 2009 13:13:54 +0200 Subject: [PATCH] audiortppay: move function around --- gst-libs/gst/rtp/gstbasertpaudiopayload.c | 86 +++++++++++++++---------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/gst-libs/gst/rtp/gstbasertpaudiopayload.c b/gst-libs/gst/rtp/gstbasertpaudiopayload.c index 0c4699a..a99b478 100644 --- a/gst-libs/gst/rtp/gstbasertpaudiopayload.c +++ b/gst-libs/gst/rtp/gstbasertpaudiopayload.c @@ -293,6 +293,49 @@ gst_base_rtp_audio_payload_set_samplebits_options (GstBaseRTPAudioPayload } /** + * gst_base_rtp_audio_payload_push: + * @baseaudiopayload: a #GstBaseRTPPayload + * @data: data to set as payload + * @payload_len: length of payload + * @timestamp: a #GstClockTime + * + * Create an RTP buffer and store @payload_len bytes of @data as the + * payload. Set the timestamp on the new buffer to @timestamp before pushing + * the buffer downstream. + * + * Returns: a #GstFlowReturn + * + * Since: 0.10.13 + */ +GstFlowReturn +gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload, + const guint8 * data, guint payload_len, GstClockTime timestamp) +{ + GstBaseRTPPayload *basepayload; + GstBuffer *outbuf; + guint8 *payload; + GstFlowReturn ret; + + basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload); + + GST_DEBUG_OBJECT (baseaudiopayload, "Pushing %d bytes ts %" GST_TIME_FORMAT, + payload_len, GST_TIME_ARGS (timestamp)); + + /* create buffer to hold the payload */ + outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0); + + /* copy payload */ + gst_rtp_buffer_set_payload_type (outbuf, basepayload->pt); + payload = gst_rtp_buffer_get_payload (outbuf); + memcpy (payload, data, payload_len); + + GST_BUFFER_TIMESTAMP (outbuf) = timestamp; + ret = gst_basertppayload_push (basepayload, outbuf); + + return ret; +} + +/** * gst_base_rtp_audio_payload_flush: * @baseaudiopayload: a #GstBaseRTPPayload * @payload_len: length of payload @@ -542,49 +585,6 @@ config_error: } } -/** - * gst_base_rtp_audio_payload_push: - * @baseaudiopayload: a #GstBaseRTPPayload - * @data: data to set as payload - * @payload_len: length of payload - * @timestamp: a #GstClockTime - * - * Create an RTP buffer and store @payload_len bytes of @data as the - * payload. Set the timestamp on the new buffer to @timestamp before pushing - * the buffer downstream. - * - * Returns: a #GstFlowReturn - * - * Since: 0.10.13 - */ -GstFlowReturn -gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload, - const guint8 * data, guint payload_len, GstClockTime timestamp) -{ - GstBaseRTPPayload *basepayload; - GstBuffer *outbuf; - guint8 *payload; - GstFlowReturn ret; - - basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload); - - GST_DEBUG_OBJECT (baseaudiopayload, "Pushing %d bytes ts %" GST_TIME_FORMAT, - payload_len, GST_TIME_ARGS (timestamp)); - - /* create buffer to hold the payload */ - outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0); - - /* copy payload */ - gst_rtp_buffer_set_payload_type (outbuf, basepayload->pt); - payload = gst_rtp_buffer_get_payload (outbuf); - memcpy (payload, data, payload_len); - - GST_BUFFER_TIMESTAMP (outbuf) = timestamp; - ret = gst_basertppayload_push (basepayload, outbuf); - - return ret; -} - static GstStateChangeReturn gst_base_rtp_payload_audio_change_state (GstElement * element, GstStateChange transition) -- 2.7.4