mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
rtp: fix de/payloaders
gst_basertppayload -> gst_base_rtp_payload Add pts/dts support in the depayloader Remove old timestamp code Add a default getcaps function so subclasses can chain up to it instead of relying on the return value of the getcaps function.
This commit is contained in:
parent
57eaf388e0
commit
24347217a5
6 changed files with 123 additions and 171 deletions
|
@ -51,7 +51,7 @@ gst_video_overlay_get_type
|
||||||
#include <gst/rtp/gstbasertpdepayload.h>
|
#include <gst/rtp/gstbasertpdepayload.h>
|
||||||
gst_base_rtp_depayload_get_type
|
gst_base_rtp_depayload_get_type
|
||||||
#include <gst/rtp/gstbasertppayload.h>
|
#include <gst/rtp/gstbasertppayload.h>
|
||||||
gst_basertppayload_get_type
|
gst_base_rtp_payload_get_type
|
||||||
#include <gst/rtp/gstbasertpaudiopayload.h>
|
#include <gst/rtp/gstbasertpaudiopayload.h>
|
||||||
gst_base_rtp_audio_payload_get_type
|
gst_base_rtp_audio_payload_get_type
|
||||||
|
|
||||||
|
|
|
@ -152,10 +152,8 @@ gst_base_rtp_audio_payload_sample_time_to_bytes (GstBaseRTPAudioPayload *
|
||||||
|
|
||||||
static GstFlowReturn gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload
|
static GstFlowReturn gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload
|
||||||
* payload, GstBuffer * buffer);
|
* payload, GstBuffer * buffer);
|
||||||
|
|
||||||
static GstStateChangeReturn gst_base_rtp_payload_audio_change_state (GstElement
|
static GstStateChangeReturn gst_base_rtp_payload_audio_change_state (GstElement
|
||||||
* element, GstStateChange transition);
|
* element, GstStateChange transition);
|
||||||
|
|
||||||
static gboolean gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload
|
static gboolean gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload
|
||||||
* payload, GstEvent * event);
|
* payload, GstEvent * event);
|
||||||
|
|
||||||
|
@ -475,7 +473,7 @@ gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload,
|
||||||
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
|
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
|
||||||
timestamp);
|
timestamp);
|
||||||
|
|
||||||
ret = gst_basertppayload_push (basepayload, outbuf);
|
ret = gst_base_rtp_payload_push (basepayload, outbuf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -526,7 +524,7 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (baseaudiopayload, "Pushing list %p", list);
|
GST_DEBUG_OBJECT (baseaudiopayload, "Pushing list %p", list);
|
||||||
ret = gst_basertppayload_push_list (basepayload, list);
|
ret = gst_base_rtp_payload_push_list (basepayload, list);
|
||||||
} else {
|
} else {
|
||||||
GstRTPBuffer rtp;
|
GstRTPBuffer rtp;
|
||||||
|
|
||||||
|
@ -539,7 +537,7 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (baseaudiopayload, "Pushing buffer %p", outbuf);
|
GST_DEBUG_OBJECT (baseaudiopayload, "Pushing buffer %p", outbuf);
|
||||||
ret = gst_basertppayload_push (basepayload, outbuf);
|
ret = gst_base_rtp_payload_push (basepayload, outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -630,7 +628,7 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
|
||||||
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
|
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
|
||||||
timestamp);
|
timestamp);
|
||||||
|
|
||||||
ret = gst_basertppayload_push (basepayload, outbuf);
|
ret = gst_base_rtp_payload_push (basepayload, outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -41,7 +41,8 @@ struct _GstBaseRTPDepayloadPrivate
|
||||||
gdouble play_scale;
|
gdouble play_scale;
|
||||||
|
|
||||||
gboolean discont;
|
gboolean discont;
|
||||||
GstClockTime timestamp;
|
GstClockTime pts;
|
||||||
|
GstClockTime dts;
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
|
|
||||||
guint32 next_seqnum;
|
guint32 next_seqnum;
|
||||||
|
@ -76,8 +77,6 @@ static gboolean gst_base_rtp_depayload_handle_sink_event (GstPad * pad,
|
||||||
static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement *
|
static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement *
|
||||||
element, GstStateChange transition);
|
element, GstStateChange transition);
|
||||||
|
|
||||||
static void gst_base_rtp_depayload_set_gst_timestamp
|
|
||||||
(GstBaseRTPDepayload * filter, guint32 rtptime, GstBuffer * buf);
|
|
||||||
static gboolean gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload *
|
static gboolean gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload *
|
||||||
filter, GstEvent * event);
|
filter, GstEvent * event);
|
||||||
static gboolean gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload *
|
static gboolean gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload *
|
||||||
|
@ -132,7 +131,6 @@ gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass)
|
||||||
|
|
||||||
gstelement_class->change_state = gst_base_rtp_depayload_change_state;
|
gstelement_class->change_state = gst_base_rtp_depayload_change_state;
|
||||||
|
|
||||||
klass->set_gst_timestamp = gst_base_rtp_depayload_set_gst_timestamp;
|
|
||||||
klass->packet_lost = gst_base_rtp_depayload_packet_lost;
|
klass->packet_lost = gst_base_rtp_depayload_packet_lost;
|
||||||
klass->handle_event = gst_base_rtp_depayload_handle_event;
|
klass->handle_event = gst_base_rtp_depayload_handle_event;
|
||||||
|
|
||||||
|
@ -245,7 +243,7 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
||||||
GstBaseRTPDepayloadClass *bclass;
|
GstBaseRTPDepayloadClass *bclass;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
GstBuffer *out_buf;
|
GstBuffer *out_buf;
|
||||||
GstClockTime timestamp;
|
GstClockTime pts, dts;
|
||||||
guint16 seqnum;
|
guint16 seqnum;
|
||||||
guint32 rtptime;
|
guint32 rtptime;
|
||||||
gboolean discont;
|
gboolean discont;
|
||||||
|
@ -267,12 +265,14 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
||||||
if (!priv->discont)
|
if (!priv->discont)
|
||||||
priv->discont = GST_BUFFER_IS_DISCONT (in);
|
priv->discont = GST_BUFFER_IS_DISCONT (in);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (in);
|
pts = GST_BUFFER_PTS (in);
|
||||||
|
dts = GST_BUFFER_DTS (in);
|
||||||
/* convert to running_time and save the timestamp, this is the timestamp
|
/* convert to running_time and save the timestamp, this is the timestamp
|
||||||
* we put on outgoing buffers. */
|
* we put on outgoing buffers. */
|
||||||
timestamp = gst_segment_to_running_time (&filter->segment, GST_FORMAT_TIME,
|
pts = gst_segment_to_running_time (&filter->segment, GST_FORMAT_TIME, pts);
|
||||||
timestamp);
|
dts = gst_segment_to_running_time (&filter->segment, GST_FORMAT_TIME, dts);
|
||||||
priv->timestamp = timestamp;
|
priv->pts = pts;
|
||||||
|
priv->dts = dts;
|
||||||
priv->duration = GST_BUFFER_DURATION (in);
|
priv->duration = GST_BUFFER_DURATION (in);
|
||||||
|
|
||||||
gst_rtp_buffer_map (in, GST_MAP_READ, &rtp);
|
gst_rtp_buffer_map (in, GST_MAP_READ, &rtp);
|
||||||
|
@ -282,9 +282,9 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
||||||
|
|
||||||
discont = FALSE;
|
discont = FALSE;
|
||||||
|
|
||||||
GST_LOG_OBJECT (filter, "discont %d, seqnum %u, rtptime %u, timestamp %"
|
GST_LOG_OBJECT (filter, "discont %d, seqnum %u, rtptime %u, pts %"
|
||||||
GST_TIME_FORMAT, priv->discont, seqnum, rtptime,
|
GST_TIME_FORMAT ", dts %" GST_TIME_FORMAT, priv->discont, seqnum, rtptime,
|
||||||
GST_TIME_ARGS (timestamp));
|
GST_TIME_ARGS (pts), GST_TIME_ARGS (dts));
|
||||||
|
|
||||||
/* Check seqnum. This is a very simple check that makes sure that the seqnums
|
/* Check seqnum. This is a very simple check that makes sure that the seqnums
|
||||||
* are striclty increasing, dropping anything that is out of the ordinary. We
|
* are striclty increasing, dropping anything that is out of the ordinary. We
|
||||||
|
@ -334,9 +334,7 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
||||||
/* let's send it out to processing */
|
/* let's send it out to processing */
|
||||||
out_buf = bclass->process (filter, in);
|
out_buf = bclass->process (filter, in);
|
||||||
if (out_buf) {
|
if (out_buf) {
|
||||||
/* we pass rtptime as backward compatibility, in reality, the incomming
|
ret = gst_base_rtp_depayload_push (filter, out_buf);
|
||||||
* buffer timestamp is always applied to the outgoing packet. */
|
|
||||||
ret = gst_base_rtp_depayload_push_ts (filter, rtptime, out_buf);
|
|
||||||
}
|
}
|
||||||
gst_buffer_unref (in);
|
gst_buffer_unref (in);
|
||||||
|
|
||||||
|
@ -503,20 +501,29 @@ typedef struct
|
||||||
{
|
{
|
||||||
GstBaseRTPDepayload *depayload;
|
GstBaseRTPDepayload *depayload;
|
||||||
GstBaseRTPDepayloadClass *bclass;
|
GstBaseRTPDepayloadClass *bclass;
|
||||||
gboolean do_ts;
|
|
||||||
gboolean rtptime;
|
|
||||||
} HeaderData;
|
} HeaderData;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
|
set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
|
||||||
{
|
{
|
||||||
GstBaseRTPDepayload *depayload = data->depayload;
|
GstBaseRTPDepayload *depayload = data->depayload;
|
||||||
|
GstBaseRTPDepayloadPrivate *priv = depayload->priv;
|
||||||
|
GstClockTime pts, dts, duration;
|
||||||
|
|
||||||
*buffer = gst_buffer_make_writable (*buffer);
|
*buffer = gst_buffer_make_writable (*buffer);
|
||||||
|
|
||||||
/* set the timestamp if we must and can */
|
pts = GST_BUFFER_PTS (*buffer);
|
||||||
if (data->bclass->set_gst_timestamp && data->do_ts)
|
dts = GST_BUFFER_DTS (*buffer);
|
||||||
data->bclass->set_gst_timestamp (depayload, data->rtptime, *buffer);
|
duration = GST_BUFFER_DURATION (*buffer);
|
||||||
|
|
||||||
|
/* apply last incomming timestamp and duration to outgoing buffer if
|
||||||
|
* not otherwise set. */
|
||||||
|
if (!GST_CLOCK_TIME_IS_VALID (pts))
|
||||||
|
GST_BUFFER_PTS (*buffer) = priv->pts;
|
||||||
|
if (!GST_CLOCK_TIME_IS_VALID (dts))
|
||||||
|
GST_BUFFER_DTS (*buffer) = priv->dts;
|
||||||
|
if (!GST_CLOCK_TIME_IS_VALID (duration))
|
||||||
|
GST_BUFFER_DURATION (*buffer) = priv->duration;
|
||||||
|
|
||||||
if (G_UNLIKELY (depayload->priv->discont)) {
|
if (G_UNLIKELY (depayload->priv->discont)) {
|
||||||
GST_LOG_OBJECT (depayload, "Marking DISCONT on output buffer");
|
GST_LOG_OBJECT (depayload, "Marking DISCONT on output buffer");
|
||||||
|
@ -524,18 +531,21 @@ set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
|
||||||
depayload->priv->discont = FALSE;
|
depayload->priv->discont = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* make sure we only set the timestamp on the first packet */
|
||||||
|
priv->pts = GST_CLOCK_TIME_NONE;
|
||||||
|
priv->dts = GST_CLOCK_TIME_NONE;
|
||||||
|
priv->duration = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
|
gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
|
||||||
gboolean do_ts, guint32 rtptime, gboolean is_list, gpointer obj)
|
gboolean is_list, gpointer obj)
|
||||||
{
|
{
|
||||||
HeaderData data;
|
HeaderData data;
|
||||||
|
|
||||||
data.depayload = filter;
|
data.depayload = filter;
|
||||||
data.rtptime = rtptime;
|
|
||||||
data.do_ts = do_ts;
|
|
||||||
data.bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
data.bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
||||||
|
|
||||||
if (is_list) {
|
if (is_list) {
|
||||||
|
@ -561,40 +571,6 @@ gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gst_base_rtp_depayload_push_ts:
|
|
||||||
* @filter: a #GstBaseRTPDepayload
|
|
||||||
* @timestamp: an RTP timestamp to apply
|
|
||||||
* @out_buf: a #GstBuffer
|
|
||||||
*
|
|
||||||
* Push @out_buf to the peer of @filter. This function takes ownership of
|
|
||||||
* @out_buf.
|
|
||||||
*
|
|
||||||
* Unlike gst_base_rtp_depayload_push(), this function will by default apply
|
|
||||||
* the last incomming timestamp on the outgoing buffer when it didn't have a
|
|
||||||
* timestamp already. The set_get_timestamp vmethod can be overwritten to change
|
|
||||||
* this behaviour (and take, for example, @timestamp into account).
|
|
||||||
*
|
|
||||||
* Returns: a #GstFlowReturn.
|
|
||||||
*/
|
|
||||||
GstFlowReturn
|
|
||||||
gst_base_rtp_depayload_push_ts (GstBaseRTPDepayload * filter, guint32 timestamp,
|
|
||||||
GstBuffer * out_buf)
|
|
||||||
{
|
|
||||||
GstFlowReturn res;
|
|
||||||
|
|
||||||
res =
|
|
||||||
gst_base_rtp_depayload_prepare_push (filter, TRUE, timestamp, FALSE,
|
|
||||||
&out_buf);
|
|
||||||
|
|
||||||
if (G_LIKELY (res == GST_FLOW_OK))
|
|
||||||
res = gst_pad_push (filter->srcpad, out_buf);
|
|
||||||
else
|
|
||||||
gst_buffer_unref (out_buf);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_base_rtp_depayload_push:
|
* gst_base_rtp_depayload_push:
|
||||||
* @filter: a #GstBaseRTPDepayload
|
* @filter: a #GstBaseRTPDepayload
|
||||||
|
@ -603,9 +579,8 @@ gst_base_rtp_depayload_push_ts (GstBaseRTPDepayload * filter, guint32 timestamp,
|
||||||
* Push @out_buf to the peer of @filter. This function takes ownership of
|
* Push @out_buf to the peer of @filter. This function takes ownership of
|
||||||
* @out_buf.
|
* @out_buf.
|
||||||
*
|
*
|
||||||
* Unlike gst_base_rtp_depayload_push_ts(), this function will not apply
|
* This function will by default apply the last incomming timestamp on
|
||||||
* any timestamp on the outgoing buffer. Subclasses should therefore timestamp
|
* the outgoing buffer when it didn't have a timestamp already.
|
||||||
* outgoing buffers themselves.
|
|
||||||
*
|
*
|
||||||
* Returns: a #GstFlowReturn.
|
* Returns: a #GstFlowReturn.
|
||||||
*/
|
*/
|
||||||
|
@ -614,7 +589,7 @@ gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * out_buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
|
|
||||||
res = gst_base_rtp_depayload_prepare_push (filter, FALSE, 0, FALSE, &out_buf);
|
res = gst_base_rtp_depayload_prepare_push (filter, FALSE, &out_buf);
|
||||||
|
|
||||||
if (G_LIKELY (res == GST_FLOW_OK))
|
if (G_LIKELY (res == GST_FLOW_OK))
|
||||||
res = gst_pad_push (filter->srcpad, out_buf);
|
res = gst_pad_push (filter->srcpad, out_buf);
|
||||||
|
@ -642,7 +617,7 @@ gst_base_rtp_depayload_push_list (GstBaseRTPDepayload * filter,
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
|
|
||||||
res = gst_base_rtp_depayload_prepare_push (filter, TRUE, 0, TRUE, &out_list);
|
res = gst_base_rtp_depayload_prepare_push (filter, TRUE, &out_list);
|
||||||
|
|
||||||
if (G_LIKELY (res == GST_FLOW_OK))
|
if (G_LIKELY (res == GST_FLOW_OK))
|
||||||
res = gst_pad_push_list (filter->srcpad, out_list);
|
res = gst_pad_push_list (filter->srcpad, out_list);
|
||||||
|
@ -681,26 +656,6 @@ gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter,
|
||||||
return gst_pad_push_event (filter->srcpad, sevent);
|
return gst_pad_push_event (filter->srcpad, sevent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter,
|
|
||||||
guint32 rtptime, GstBuffer * buf)
|
|
||||||
{
|
|
||||||
GstBaseRTPDepayloadPrivate *priv;
|
|
||||||
GstClockTime timestamp, duration;
|
|
||||||
|
|
||||||
priv = filter->priv;
|
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
|
||||||
duration = GST_BUFFER_DURATION (buf);
|
|
||||||
|
|
||||||
/* apply last incomming timestamp and duration to outgoing buffer if
|
|
||||||
* not otherwise set. */
|
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (timestamp))
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = priv->timestamp;
|
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (duration))
|
|
||||||
GST_BUFFER_DURATION (buf) = priv->duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_base_rtp_depayload_change_state (GstElement * element,
|
gst_base_rtp_depayload_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
|
|
|
@ -88,10 +88,6 @@ struct _GstBaseRTPDepayloadClass
|
||||||
* pushed. */
|
* pushed. */
|
||||||
GstBuffer * (*process) (GstBaseRTPDepayload *base, GstBuffer *in);
|
GstBuffer * (*process) (GstBaseRTPDepayload *base, GstBuffer *in);
|
||||||
|
|
||||||
/* non-pure function used to convert from RTP timestamp to GST timestamp
|
|
||||||
* this function is used by the child class before gst_pad_pushing */
|
|
||||||
void (*set_gst_timestamp) (GstBaseRTPDepayload *filter, guint32 timestamp, GstBuffer *buf);
|
|
||||||
|
|
||||||
/* non-pure function used to to signal the depayloader about packet loss. the
|
/* non-pure function used to to signal the depayloader about packet loss. the
|
||||||
* timestamp and duration are the estimated values of the lost packet.
|
* timestamp and duration are the estimated values of the lost packet.
|
||||||
* The default implementation of this message pushes a segment update. */
|
* The default implementation of this message pushes a segment update. */
|
||||||
|
@ -108,10 +104,8 @@ struct _GstBaseRTPDepayloadClass
|
||||||
|
|
||||||
GType gst_base_rtp_depayload_get_type (void);
|
GType gst_base_rtp_depayload_get_type (void);
|
||||||
|
|
||||||
GstFlowReturn gst_base_rtp_depayload_push (GstBaseRTPDepayload *filter, GstBuffer *out_buf);
|
GstFlowReturn gst_base_rtp_depayload_push (GstBaseRTPDepayload *filter, GstBuffer *out_buf);
|
||||||
GstFlowReturn gst_base_rtp_depayload_push_ts (GstBaseRTPDepayload *filter,
|
GstFlowReturn gst_base_rtp_depayload_push_list (GstBaseRTPDepayload *filter, GstBufferList *out_list);
|
||||||
guint32 timestamp, GstBuffer *out_buf);
|
|
||||||
GstFlowReturn gst_base_rtp_depayload_push_list (GstBaseRTPDepayload *filter, GstBufferList *out_list);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -91,26 +91,27 @@ enum
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gst_basertppayload_class_init (GstBaseRTPPayloadClass * klass);
|
static void gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass);
|
||||||
static void gst_basertppayload_base_init (GstBaseRTPPayloadClass * klass);
|
static void gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload,
|
||||||
static void gst_basertppayload_init (GstBaseRTPPayload * basertppayload,
|
|
||||||
gpointer g_class);
|
gpointer g_class);
|
||||||
static void gst_basertppayload_finalize (GObject * object);
|
static void gst_base_rtp_payload_finalize (GObject * object);
|
||||||
|
|
||||||
static GstCaps *gst_basertppayload_sink_getcaps (GstPad * pad,
|
static GstCaps *gst_base_rtp_payload_sink_getcaps (GstPad * pad,
|
||||||
GstCaps * filter);
|
GstCaps * filter);
|
||||||
static gboolean gst_basertppayload_event_default (GstBaseRTPPayload *
|
static gboolean gst_base_rtp_payload_event_default (GstBaseRTPPayload *
|
||||||
basertppayload, GstEvent * event);
|
basertppayload, GstEvent * event);
|
||||||
static gboolean gst_basertppayload_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_base_rtp_payload_event (GstPad * pad, GstEvent * event);
|
||||||
static GstFlowReturn gst_basertppayload_chain (GstPad * pad,
|
static GstFlowReturn gst_base_rtp_payload_chain (GstPad * pad,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
|
static GstCaps *gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload *
|
||||||
|
basertppayload, GstPad * pad, GstCaps * filter);
|
||||||
|
|
||||||
static void gst_basertppayload_set_property (GObject * object, guint prop_id,
|
static void gst_base_rtp_payload_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_basertppayload_get_property (GObject * object, guint prop_id,
|
static void gst_base_rtp_payload_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
|
||||||
static GstStateChangeReturn gst_basertppayload_change_state (GstElement *
|
static GstStateChangeReturn gst_base_rtp_payload_change_state (GstElement *
|
||||||
element, GstStateChange transition);
|
element, GstStateChange transition);
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
|
@ -118,21 +119,21 @@ static GstElementClass *parent_class = NULL;
|
||||||
/* FIXME 0.11: API should be changed to gst_base_typ_payload_xyz */
|
/* FIXME 0.11: API should be changed to gst_base_typ_payload_xyz */
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gst_basertppayload_get_type (void)
|
gst_base_rtp_payload_get_type (void)
|
||||||
{
|
{
|
||||||
static GType basertppayload_type = 0;
|
static GType basertppayload_type = 0;
|
||||||
|
|
||||||
if (g_once_init_enter ((gsize *) & basertppayload_type)) {
|
if (g_once_init_enter ((gsize *) & basertppayload_type)) {
|
||||||
static const GTypeInfo basertppayload_info = {
|
static const GTypeInfo basertppayload_info = {
|
||||||
sizeof (GstBaseRTPPayloadClass),
|
sizeof (GstBaseRTPPayloadClass),
|
||||||
(GBaseInitFunc) gst_basertppayload_base_init,
|
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc) gst_basertppayload_class_init,
|
NULL,
|
||||||
|
(GClassInitFunc) gst_base_rtp_payload_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
sizeof (GstBaseRTPPayload),
|
sizeof (GstBaseRTPPayload),
|
||||||
0,
|
0,
|
||||||
(GInstanceInitFunc) gst_basertppayload_init,
|
(GInstanceInitFunc) gst_base_rtp_payload_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
g_once_init_leave ((gsize *) & basertppayload_type,
|
g_once_init_leave ((gsize *) & basertppayload_type,
|
||||||
|
@ -143,12 +144,7 @@ gst_basertppayload_get_type (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_basertppayload_base_init (GstBaseRTPPayloadClass * klass)
|
gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gst_basertppayload_class_init (GstBaseRTPPayloadClass * klass)
|
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
|
@ -160,10 +156,10 @@ gst_basertppayload_class_init (GstBaseRTPPayloadClass * klass)
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
gobject_class->finalize = gst_basertppayload_finalize;
|
gobject_class->finalize = gst_base_rtp_payload_finalize;
|
||||||
|
|
||||||
gobject_class->set_property = gst_basertppayload_set_property;
|
gobject_class->set_property = gst_base_rtp_payload_set_property;
|
||||||
gobject_class->get_property = gst_basertppayload_get_property;
|
gobject_class->get_property = gst_base_rtp_payload_get_property;
|
||||||
|
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MTU,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MTU,
|
||||||
g_param_spec_uint ("mtu", "MTU",
|
g_param_spec_uint ("mtu", "MTU",
|
||||||
|
@ -242,16 +238,17 @@ gst_basertppayload_class_init (GstBaseRTPPayloadClass * klass)
|
||||||
0, G_MAXINT64, DEFAULT_PTIME_MULTIPLE,
|
0, G_MAXINT64, DEFAULT_PTIME_MULTIPLE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gstelement_class->change_state = gst_basertppayload_change_state;
|
gstelement_class->change_state = gst_base_rtp_payload_change_state;
|
||||||
|
|
||||||
klass->handle_event = gst_basertppayload_event_default;
|
klass->get_caps = gst_base_rtp_payload_getcaps_default;
|
||||||
|
klass->handle_event = gst_base_rtp_payload_event_default;
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (basertppayload_debug, "basertppayload", 0,
|
GST_DEBUG_CATEGORY_INIT (basertppayload_debug, "basertppayload", 0,
|
||||||
"Base class for RTP Payloaders");
|
"Base class for RTP Payloaders");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_basertppayload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
||||||
{
|
{
|
||||||
GstPadTemplate *templ;
|
GstPadTemplate *templ;
|
||||||
GstBaseRTPPayloadPrivate *priv;
|
GstBaseRTPPayloadPrivate *priv;
|
||||||
|
@ -272,11 +269,11 @@ gst_basertppayload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
||||||
|
|
||||||
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
||||||
gst_pad_set_getcaps_function (basertppayload->sinkpad,
|
gst_pad_set_getcaps_function (basertppayload->sinkpad,
|
||||||
gst_basertppayload_sink_getcaps);
|
gst_base_rtp_payload_sink_getcaps);
|
||||||
gst_pad_set_event_function (basertppayload->sinkpad,
|
gst_pad_set_event_function (basertppayload->sinkpad,
|
||||||
gst_basertppayload_event);
|
gst_base_rtp_payload_event);
|
||||||
gst_pad_set_chain_function (basertppayload->sinkpad,
|
gst_pad_set_chain_function (basertppayload->sinkpad,
|
||||||
gst_basertppayload_chain);
|
gst_base_rtp_payload_chain);
|
||||||
gst_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->sinkpad);
|
||||||
|
|
||||||
basertppayload->mtu = DEFAULT_MTU;
|
basertppayload->mtu = DEFAULT_MTU;
|
||||||
|
@ -305,7 +302,7 @@ gst_basertppayload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_basertppayload_finalize (GObject * object)
|
gst_base_rtp_payload_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
|
|
||||||
|
@ -320,7 +317,26 @@ gst_basertppayload_finalize (GObject * object)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_basertppayload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * basertppayload,
|
||||||
|
GstPad * pad, GstCaps * filter)
|
||||||
|
{
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
|
caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
|
||||||
|
GST_DEBUG_OBJECT (pad,
|
||||||
|
"using pad template %p with caps %p %" GST_PTR_FORMAT,
|
||||||
|
GST_PAD_PAD_TEMPLATE (pad), caps, caps);
|
||||||
|
|
||||||
|
if (filter)
|
||||||
|
caps = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
||||||
|
else
|
||||||
|
caps = gst_caps_ref (caps);
|
||||||
|
|
||||||
|
return caps;
|
||||||
|
}
|
||||||
|
|
||||||
|
static GstCaps *
|
||||||
|
gst_base_rtp_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
GstBaseRTPPayloadClass *basertppayload_class;
|
GstBaseRTPPayloadClass *basertppayload_class;
|
||||||
|
@ -334,25 +350,13 @@ gst_basertppayload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
if (basertppayload_class->get_caps)
|
if (basertppayload_class->get_caps)
|
||||||
caps = basertppayload_class->get_caps (basertppayload, pad, filter);
|
caps = basertppayload_class->get_caps (basertppayload, pad, filter);
|
||||||
|
|
||||||
if (!caps) {
|
|
||||||
caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
|
|
||||||
GST_DEBUG_OBJECT (pad,
|
|
||||||
"using pad template %p with caps %p %" GST_PTR_FORMAT,
|
|
||||||
GST_PAD_PAD_TEMPLATE (pad), caps, caps);
|
|
||||||
|
|
||||||
if (filter)
|
|
||||||
caps = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
|
||||||
else
|
|
||||||
caps = gst_caps_ref (caps);
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_object_unref (basertppayload);
|
gst_object_unref (basertppayload);
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_basertppayload_event_default (GstBaseRTPPayload * basertppayload,
|
gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
|
||||||
GstEvent * event)
|
GstEvent * event)
|
||||||
{
|
{
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
|
@ -402,7 +406,7 @@ gst_basertppayload_event_default (GstBaseRTPPayload * basertppayload,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_basertppayload_event (GstPad * pad, GstEvent * event)
|
gst_base_rtp_payload_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
GstBaseRTPPayloadClass *basertppayload_class;
|
GstBaseRTPPayloadClass *basertppayload_class;
|
||||||
|
@ -428,7 +432,7 @@ gst_basertppayload_event (GstPad * pad, GstEvent * event)
|
||||||
|
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_basertppayload_chain (GstPad * pad, GstBuffer * buffer)
|
gst_base_rtp_payload_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
GstBaseRTPPayloadClass *basertppayload_class;
|
GstBaseRTPPayloadClass *basertppayload_class;
|
||||||
|
@ -458,7 +462,7 @@ no_function:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_basertppayload_set_options:
|
* gst_base_rtp_payload_set_options:
|
||||||
* @payload: a #GstBaseRTPPayload
|
* @payload: a #GstBaseRTPPayload
|
||||||
* @media: the media type (typically "audio" or "video")
|
* @media: the media type (typically "audio" or "video")
|
||||||
* @dynamic: if the payload type is dynamic
|
* @dynamic: if the payload type is dynamic
|
||||||
|
@ -467,10 +471,10 @@ no_function:
|
||||||
*
|
*
|
||||||
* Set the rtp options of the payloader. These options will be set in the caps
|
* Set the rtp options of the payloader. These options will be set in the caps
|
||||||
* of the payloader. Subclasses must call this method before calling
|
* of the payloader. Subclasses must call this method before calling
|
||||||
* gst_basertppayload_push() or gst_basertppayload_set_outcaps().
|
* gst_base_rtp_payload_push() or gst_base_rtp_payload_set_outcaps().
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_basertppayload_set_options (GstBaseRTPPayload * payload,
|
gst_base_rtp_payload_set_options (GstBaseRTPPayload * payload,
|
||||||
const gchar * media, gboolean dynamic, const gchar * encoding_name,
|
const gchar * media, gboolean dynamic, const gchar * encoding_name,
|
||||||
guint32 clock_rate)
|
guint32 clock_rate)
|
||||||
{
|
{
|
||||||
|
@ -510,7 +514,7 @@ update_max_ptime (GstBaseRTPPayload * basertppayload)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_basertppayload_set_outcaps:
|
* gst_base_rtp_payload_set_outcaps:
|
||||||
* @payload: a #GstBaseRTPPayload
|
* @payload: a #GstBaseRTPPayload
|
||||||
* @fieldname: the first field name or %NULL
|
* @fieldname: the first field name or %NULL
|
||||||
* @...: field values
|
* @...: field values
|
||||||
|
@ -523,7 +527,7 @@ update_max_ptime (GstBaseRTPPayload * basertppayload)
|
||||||
* Returns: %TRUE if the caps could be set.
|
* Returns: %TRUE if the caps could be set.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_basertppayload_set_outcaps (GstBaseRTPPayload * payload,
|
gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
|
||||||
const gchar * fieldname, ...)
|
const gchar * fieldname, ...)
|
||||||
{
|
{
|
||||||
GstCaps *srccaps, *peercaps;
|
GstCaps *srccaps, *peercaps;
|
||||||
|
@ -667,7 +671,7 @@ gst_basertppayload_set_outcaps (GstBaseRTPPayload * payload,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_basertppayload_is_filled:
|
* gst_base_rtp_payload_is_filled:
|
||||||
* @payload: a #GstBaseRTPPayload
|
* @payload: a #GstBaseRTPPayload
|
||||||
* @size: the size of the packet
|
* @size: the size of the packet
|
||||||
* @duration: the duration of the packet
|
* @duration: the duration of the packet
|
||||||
|
@ -679,7 +683,7 @@ gst_basertppayload_set_outcaps (GstBaseRTPPayload * payload,
|
||||||
* configured MTU or max_ptime.
|
* configured MTU or max_ptime.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_basertppayload_is_filled (GstBaseRTPPayload * payload,
|
gst_base_rtp_payload_is_filled (GstBaseRTPPayload * payload,
|
||||||
guint size, GstClockTime duration)
|
guint size, GstClockTime duration)
|
||||||
{
|
{
|
||||||
if (size > payload->mtu)
|
if (size > payload->mtu)
|
||||||
|
@ -737,7 +741,7 @@ set_headers (GstBuffer ** buffer, guint group, guint idx, HeaderData * data)
|
||||||
/* Updates the SSRC, payload type, seqnum and timestamp of the RTP buffer
|
/* Updates the SSRC, payload type, seqnum and timestamp of the RTP buffer
|
||||||
* before the buffer is pushed. */
|
* before the buffer is pushed. */
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_basertppayload_prepare_push (GstBaseRTPPayload * payload,
|
gst_base_rtp_payload_prepare_push (GstBaseRTPPayload * payload,
|
||||||
gpointer obj, gboolean is_list)
|
gpointer obj, gboolean is_list)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayloadPrivate *priv;
|
GstBaseRTPPayloadPrivate *priv;
|
||||||
|
@ -822,8 +826,8 @@ gst_basertppayload_prepare_push (GstBaseRTPPayload * payload,
|
||||||
(is_list) ? -1 : gst_buffer_get_size (GST_BUFFER (obj)),
|
(is_list) ? -1 : gst_buffer_get_size (GST_BUFFER (obj)),
|
||||||
payload->seqnum, data.rtptime, GST_TIME_ARGS (data.timestamp));
|
payload->seqnum, data.rtptime, GST_TIME_ARGS (data.timestamp));
|
||||||
|
|
||||||
if (g_atomic_int_compare_and_exchange (&payload->
|
if (g_atomic_int_compare_and_exchange (&payload->priv->
|
||||||
priv->notified_first_timestamp, 1, 0)) {
|
notified_first_timestamp, 1, 0)) {
|
||||||
g_object_notify (G_OBJECT (payload), "timestamp");
|
g_object_notify (G_OBJECT (payload), "timestamp");
|
||||||
g_object_notify (G_OBJECT (payload), "seqnum");
|
g_object_notify (G_OBJECT (payload), "seqnum");
|
||||||
}
|
}
|
||||||
|
@ -840,7 +844,7 @@ no_rate:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_basertppayload_push_list:
|
* gst_base_rtp_payload_push_list:
|
||||||
* @payload: a #GstBaseRTPPayload
|
* @payload: a #GstBaseRTPPayload
|
||||||
* @list: a #GstBufferList
|
* @list: a #GstBufferList
|
||||||
*
|
*
|
||||||
|
@ -854,11 +858,12 @@ no_rate:
|
||||||
* Since: 0.10.24
|
* Since: 0.10.24
|
||||||
*/
|
*/
|
||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
gst_basertppayload_push_list (GstBaseRTPPayload * payload, GstBufferList * list)
|
gst_base_rtp_payload_push_list (GstBaseRTPPayload * payload,
|
||||||
|
GstBufferList * list)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
|
|
||||||
res = gst_basertppayload_prepare_push (payload, list, TRUE);
|
res = gst_base_rtp_payload_prepare_push (payload, list, TRUE);
|
||||||
|
|
||||||
if (G_LIKELY (res == GST_FLOW_OK))
|
if (G_LIKELY (res == GST_FLOW_OK))
|
||||||
res = gst_pad_push_list (payload->srcpad, list);
|
res = gst_pad_push_list (payload->srcpad, list);
|
||||||
|
@ -869,7 +874,7 @@ gst_basertppayload_push_list (GstBaseRTPPayload * payload, GstBufferList * list)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_basertppayload_push:
|
* gst_base_rtp_payload_push:
|
||||||
* @payload: a #GstBaseRTPPayload
|
* @payload: a #GstBaseRTPPayload
|
||||||
* @buffer: a #GstBuffer
|
* @buffer: a #GstBuffer
|
||||||
*
|
*
|
||||||
|
@ -881,11 +886,11 @@ gst_basertppayload_push_list (GstBaseRTPPayload * payload, GstBufferList * list)
|
||||||
* Returns: a #GstFlowReturn.
|
* Returns: a #GstFlowReturn.
|
||||||
*/
|
*/
|
||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
gst_basertppayload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
|
gst_base_rtp_payload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
|
|
||||||
res = gst_basertppayload_prepare_push (payload, buffer, FALSE);
|
res = gst_base_rtp_payload_prepare_push (payload, buffer, FALSE);
|
||||||
|
|
||||||
if (G_LIKELY (res == GST_FLOW_OK))
|
if (G_LIKELY (res == GST_FLOW_OK))
|
||||||
res = gst_pad_push (payload->srcpad, buffer);
|
res = gst_pad_push (payload->srcpad, buffer);
|
||||||
|
@ -896,7 +901,7 @@ gst_basertppayload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_basertppayload_set_property (GObject * object, guint prop_id,
|
gst_base_rtp_payload_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
|
@ -950,7 +955,7 @@ gst_basertppayload_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_basertppayload_get_property (GObject * object, guint prop_id,
|
gst_base_rtp_payload_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec)
|
GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
|
@ -1009,7 +1014,7 @@ gst_basertppayload_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_basertppayload_change_state (GstElement * element,
|
gst_base_rtp_payload_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstBaseRTPPayload *basertppayload;
|
GstBaseRTPPayload *basertppayload;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_TYPE_BASE_RTP_PAYLOAD \
|
#define GST_TYPE_BASE_RTP_PAYLOAD \
|
||||||
(gst_basertppayload_get_type())
|
(gst_base_rtp_payload_get_type())
|
||||||
#define GST_BASE_RTP_PAYLOAD(obj) \
|
#define GST_BASE_RTP_PAYLOAD(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayload))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayload))
|
||||||
#define GST_BASE_RTP_PAYLOAD_CLASS(klass) \
|
#define GST_BASE_RTP_PAYLOAD_CLASS(klass) \
|
||||||
|
@ -134,7 +134,7 @@ struct _GstBaseRTPPayloadClass
|
||||||
/* receive caps on the sink pad, configure the payloader. */
|
/* receive caps on the sink pad, configure the payloader. */
|
||||||
gboolean (*set_caps) (GstBaseRTPPayload *payload, GstCaps *caps);
|
gboolean (*set_caps) (GstBaseRTPPayload *payload, GstCaps *caps);
|
||||||
|
|
||||||
/* handle a buffer, perform 0 or more gst_basertppayload_push() on
|
/* handle a buffer, perform 0 or more gst_base_rtp_payload_push() on
|
||||||
* the RTP buffers. This function takes ownership of the buffer. */
|
* the RTP buffers. This function takes ownership of the buffer. */
|
||||||
GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
|
GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
|
||||||
GstBuffer *buffer);
|
GstBuffer *buffer);
|
||||||
|
@ -144,24 +144,24 @@ struct _GstBaseRTPPayloadClass
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
gpointer _gst_reserved[GST_PADDING];
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_basertppayload_get_type (void);
|
GType gst_base_rtp_payload_get_type (void);
|
||||||
|
|
||||||
void gst_basertppayload_set_options (GstBaseRTPPayload *payload,
|
void gst_base_rtp_payload_set_options (GstBaseRTPPayload *payload,
|
||||||
const gchar *media,
|
const gchar *media,
|
||||||
gboolean dynamic,
|
gboolean dynamic,
|
||||||
const gchar *encoding_name,
|
const gchar *encoding_name,
|
||||||
guint32 clock_rate);
|
guint32 clock_rate);
|
||||||
|
|
||||||
gboolean gst_basertppayload_set_outcaps (GstBaseRTPPayload *payload,
|
gboolean gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload *payload,
|
||||||
const gchar *fieldname, ...);
|
const gchar *fieldname, ...);
|
||||||
|
|
||||||
gboolean gst_basertppayload_is_filled (GstBaseRTPPayload *payload,
|
gboolean gst_base_rtp_payload_is_filled (GstBaseRTPPayload *payload,
|
||||||
guint size, GstClockTime duration);
|
guint size, GstClockTime duration);
|
||||||
|
|
||||||
GstFlowReturn gst_basertppayload_push (GstBaseRTPPayload *payload,
|
GstFlowReturn gst_base_rtp_payload_push (GstBaseRTPPayload *payload,
|
||||||
GstBuffer *buffer);
|
GstBuffer *buffer);
|
||||||
|
|
||||||
GstFlowReturn gst_basertppayload_push_list (GstBaseRTPPayload *payload,
|
GstFlowReturn gst_base_rtp_payload_push_list (GstBaseRTPPayload *payload,
|
||||||
GstBufferList *list);
|
GstBufferList *list);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
Loading…
Reference in a new issue