rename BaseRTP -> RTPBase

This commit is contained in:
Wim Taymans 2011-11-11 12:24:08 +01:00
parent a3416bc11f
commit ccf511a5d4
10 changed files with 482 additions and 485 deletions

View file

@ -1125,52 +1125,51 @@ gst_riff_strh
<SECTION> <SECTION>
<FILE>gstbasertpaudiopayload</FILE> <FILE>gstbasertpaudiopayload</FILE>
<INCLUDE>gst/rtp/gstbasertpaudiopayload.h</INCLUDE> <INCLUDE>gst/rtp/gstbasertpaudiopayload.h</INCLUDE>
GstBaseRTPAudioPayload GstRTPBaseAudioPayload
GstBaseRTPAudioPayloadClass GstRTPBaseAudioPayloadClass
gst_base_rtp_audio_payload_set_frame_based gst_rtp_base_audio_payload_set_frame_based
gst_base_rtp_audio_payload_set_frame_options gst_rtp_base_audio_payload_set_frame_options
gst_base_rtp_audio_payload_set_sample_based gst_rtp_base_audio_payload_set_sample_based
gst_base_rtp_audio_payload_set_sample_options gst_rtp_base_audio_payload_set_sample_options
gst_base_rtp_audio_payload_get_adapter gst_rtp_base_audio_payload_get_adapter
gst_base_rtp_audio_payload_push gst_rtp_base_audio_payload_push
gst_base_rtp_audio_payload_flush gst_rtp_base_audio_payload_flush
gst_base_rtp_audio_payload_set_samplebits_options gst_rtp_base_audio_payload_set_samplebits_options
<SUBSECTION Standard> <SUBSECTION Standard>
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD GST_TYPE_RTP_BASE_AUDIO_PAYLOAD
GST_BASE_RTP_AUDIO_PAYLOAD GST_RTP_BASE_AUDIO_PAYLOAD
GST_BASE_RTP_AUDIO_PAYLOAD_CLASS GST_RTP_BASE_AUDIO_PAYLOAD_CLASS
GST_IS_BASE_RTP_AUDIO_PAYLOAD GST_IS_RTP_BASE_AUDIO_PAYLOAD
GST_IS_BASE_RTP_AUDIO_PAYLOAD_CLASS GST_IS_RTP_BASE_AUDIO_PAYLOAD_CLASS
GST_BASE_RTP_AUDIO_PAYLOAD_CAST GST_RTP_BASE_AUDIO_PAYLOAD_CAST
gst_base_rtp_audio_payload_get_type gst_rtp_base_audio_payload_get_type
GstBaseRTPAudioPayloadPrivate GstRTPBaseAudioPayloadPrivate
</SECTION> </SECTION>
<SECTION> <SECTION>
<FILE>gstbasertpdepayload</FILE> <FILE>gstbasertpdepayload</FILE>
<INCLUDE>gst/rtp/gstbasertpdepayload.h</INCLUDE> <INCLUDE>gst/rtp/gstbasertpdepayload.h</INCLUDE>
GstBaseRTPDepayload GstRTPBaseDepayload
GstBaseRTPDepayloadClass GstRTPBaseDepayloadClass
GST_BASE_RTP_DEPAYLOAD_SINKPAD GST_RTP_BASE_DEPAYLOAD_SINKPAD
GST_BASE_RTP_DEPAYLOAD_SRCPAD GST_RTP_BASE_DEPAYLOAD_SRCPAD
gst_base_rtp_depayload_push gst_rtp_base_depayload_push
gst_base_rtp_depayload_push_ts gst_rtp_base_depayload_push_list
gst_base_rtp_depayload_push_list
<SUBSECTION Standard> <SUBSECTION Standard>
GstBaseRTPDepayloadPrivate GstRTPBaseDepayloadPrivate
GST_TYPE_BASE_RTP_DEPAYLOAD GST_TYPE_RTP_BASE_DEPAYLOAD
GST_BASE_RTP_DEPAYLOAD GST_RTP_BASE_DEPAYLOAD
GST_BASE_RTP_DEPAYLOAD_CLASS GST_RTP_BASE_DEPAYLOAD_CLASS
GST_BASE_RTP_DEPAYLOAD_GET_CLASS GST_RTP_BASE_DEPAYLOAD_GET_CLASS
GST_IS_BASE_RTP_DEPAYLOAD GST_IS_RTP_BASE_DEPAYLOAD
GST_IS_BASE_RTP_DEPAYLOAD_CLASS GST_IS_RTP_BASE_DEPAYLOAD_CLASS
GST_BASE_RTP_PAYLOAD_CAST GST_RTP_BASE_PAYLOAD_CAST
gst_base_rtp_depayload_get_type gst_rtp_base_depayload_get_type
GstBaseRTPPayloadPrivate GstRTPBasePayloadPrivate
<SUBSECTION Private> <SUBSECTION Private>
QUEUE_LOCK_INIT QUEUE_LOCK_INIT
@ -1182,27 +1181,27 @@ QUEUE_UNLOCK
<SECTION> <SECTION>
<FILE>gstbasertppayload</FILE> <FILE>gstbasertppayload</FILE>
<INCLUDE>gst/rtp/gstbasertppayload.h</INCLUDE> <INCLUDE>gst/rtp/gstbasertppayload.h</INCLUDE>
GstBaseRTPPayload GstRTPBasePayload
GstBaseRTPPayloadClass GstRTPBasePayloadClass
GST_BASE_RTP_PAYLOAD_MTU GST_RTP_BASE_PAYLOAD_MTU
GST_BASE_RTP_PAYLOAD_PT GST_RTP_BASE_PAYLOAD_PT
GST_BASE_RTP_PAYLOAD_SINKPAD GST_RTP_BASE_PAYLOAD_SINKPAD
GST_BASE_RTP_PAYLOAD_SRCPAD GST_RTP_BASE_PAYLOAD_SRCPAD
gst_basertppayload_is_filled gst_rtp_base_payload_is_filled
gst_basertppayload_push gst_rtp_base_payload_push
gst_basertppayload_push_list gst_rtp_base_payload_push_list
gst_basertppayload_set_options gst_rtp_base_payload_set_options
gst_basertppayload_set_outcaps gst_rtp_base_payload_set_outcaps
<SUBSECTION Standard> <SUBSECTION Standard>
GST_TYPE_BASE_RTP_PAYLOAD GST_TYPE_RTP_BASE_PAYLOAD
GST_BASE_RTP_PAYLOAD GST_RTP_BASE_PAYLOAD
GST_BASE_RTP_PAYLOAD_CLASS GST_RTP_BASE_PAYLOAD_CLASS
GST_BASE_RTP_PAYLOAD_GET_CLASS GST_RTP_BASE_PAYLOAD_GET_CLASS
GST_IS_BASE_RTP_PAYLOAD GST_IS_RTP_BASE_PAYLOAD
GST_IS_BASE_RTP_PAYLOAD_CLASS GST_IS_RTP_BASE_PAYLOAD_CLASS
gst_basertppayload_get_type gst_rtp_base_payload_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>

View file

@ -49,11 +49,11 @@ gst_video_overlay_get_type
#include <gst/rtp/gstbasertpdepayload.h> #include <gst/rtp/gstbasertpdepayload.h>
gst_base_rtp_depayload_get_type gst_rtp_base_depayload_get_type
#include <gst/rtp/gstbasertppayload.h> #include <gst/rtp/gstbasertppayload.h>
gst_base_rtp_payload_get_type gst_rtp_base_payload_get_type
#include <gst/rtp/gstbasertpaudiopayload.h> #include <gst/rtp/gstbasertpaudiopayload.h>
gst_base_rtp_audio_payload_get_type gst_rtp_base_audio_payload_get_type
#include <gst/video/gstvideofilter.h> #include <gst/video/gstvideofilter.h>

View file

@ -24,7 +24,7 @@
* Provides a base class for audio RTP payloaders for frame or sample based * Provides a base class for audio RTP payloaders for frame or sample based
* audio codecs (constant bitrate) * audio codecs (constant bitrate)
* *
* This class derives from GstBaseRTPPayload. It can be used for payloading * This class derives from GstRTPBasePayload. It can be used for payloading
* audio codecs. It will only work with constant bitrate codecs. It supports * audio codecs. It will only work with constant bitrate codecs. It supports
* both frame based and sample based codecs. It takes care of packing up the * both frame based and sample based codecs. It takes care of packing up the
* audio data into RTP packets and filling up the headers accordingly. The * audio data into RTP packets and filling up the headers accordingly. The
@ -40,16 +40,16 @@
* <title>Usage</title> * <title>Usage</title>
* <para> * <para>
* To use this base class, your child element needs to call either * To use this base class, your child element needs to call either
* gst_base_rtp_audio_payload_set_frame_based() or * gst_rtp_base_audio_payload_set_frame_based() or
* gst_base_rtp_audio_payload_set_sample_based(). This is usually done in the * gst_rtp_base_audio_payload_set_sample_based(). This is usually done in the
* element's _init() function. Then, the child element must call either * element's _init() function. Then, the child element must call either
* gst_base_rtp_audio_payload_set_frame_options(), * gst_rtp_base_audio_payload_set_frame_options(),
* gst_base_rtp_audio_payload_set_sample_options() or * gst_rtp_base_audio_payload_set_sample_options() or
* gst_base_rtp_audio_payload_set_samplebits_options. Since * gst_rtp_base_audio_payload_set_samplebits_options. Since
* GstBaseRTPAudioPayload derives from GstBaseRTPPayload, the child element * GstRTPBaseAudioPayload derives from GstRTPBasePayload, the child element
* must set any variables or call/override any functions required by that base * must set any variables or call/override any functions required by that base
* class. The child element does not need to override any other functions * class. The child element does not need to override any other functions
* specific to GstBaseRTPAudioPayload. * specific to GstRTPBaseAudioPayload.
* </para> * </para>
* </refsect2> * </refsect2>
*/ */
@ -78,16 +78,16 @@ enum
}; };
/* function to convert bytes to a time */ /* function to convert bytes to a time */
typedef GstClockTime (*GetBytesToTimeFunc) (GstBaseRTPAudioPayload * payload, typedef GstClockTime (*GetBytesToTimeFunc) (GstRTPBaseAudioPayload * payload,
guint64 bytes); guint64 bytes);
/* function to convert bytes to a RTP time */ /* function to convert bytes to a RTP time */
typedef guint32 (*GetBytesToRTPTimeFunc) (GstBaseRTPAudioPayload * payload, typedef guint32 (*GetBytesToRTPTimeFunc) (GstRTPBaseAudioPayload * payload,
guint64 bytes); guint64 bytes);
/* function to convert time to bytes */ /* function to convert time to bytes */
typedef guint64 (*GetTimeToBytesFunc) (GstBaseRTPAudioPayload * payload, typedef guint64 (*GetTimeToBytesFunc) (GstRTPBaseAudioPayload * payload,
GstClockTime time); GstClockTime time);
struct _GstBaseRTPAudioPayloadPrivate struct _GstRTPBaseAudioPayloadPrivate
{ {
GetBytesToTimeFunc bytes_to_time; GetBytesToTimeFunc bytes_to_time;
GetBytesToRTPTimeFunc bytes_to_rtptime; GetBytesToRTPTimeFunc bytes_to_rtptime;
@ -115,68 +115,68 @@ struct _GstBaseRTPAudioPayloadPrivate
}; };
#define GST_BASE_RTP_AUDIO_PAYLOAD_GET_PRIVATE(o) \ #define GST_RTP_BASE_AUDIO_PAYLOAD_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_BASE_RTP_AUDIO_PAYLOAD, \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_RTP_BASE_AUDIO_PAYLOAD, \
GstBaseRTPAudioPayloadPrivate)) GstRTPBaseAudioPayloadPrivate))
static void gst_base_rtp_audio_payload_finalize (GObject * object); static void gst_rtp_base_audio_payload_finalize (GObject * object);
static void gst_base_rtp_audio_payload_set_property (GObject * object, static void gst_rtp_base_audio_payload_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_base_rtp_audio_payload_get_property (GObject * object, static void gst_rtp_base_audio_payload_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); guint prop_id, GValue * value, GParamSpec * pspec);
/* bytes to time functions */ /* bytes to time functions */
static GstClockTime static GstClockTime
gst_base_rtp_audio_payload_frame_bytes_to_time (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_frame_bytes_to_time (GstRTPBaseAudioPayload *
payload, guint64 bytes); payload, guint64 bytes);
static GstClockTime static GstClockTime
gst_base_rtp_audio_payload_sample_bytes_to_time (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_sample_bytes_to_time (GstRTPBaseAudioPayload *
payload, guint64 bytes); payload, guint64 bytes);
/* bytes to RTP time functions */ /* bytes to RTP time functions */
static guint32 static guint32
gst_base_rtp_audio_payload_frame_bytes_to_rtptime (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_frame_bytes_to_rtptime (GstRTPBaseAudioPayload *
payload, guint64 bytes); payload, guint64 bytes);
static guint32 static guint32
gst_base_rtp_audio_payload_sample_bytes_to_rtptime (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_sample_bytes_to_rtptime (GstRTPBaseAudioPayload *
payload, guint64 bytes); payload, guint64 bytes);
/* time to bytes functions */ /* time to bytes functions */
static guint64 static guint64
gst_base_rtp_audio_payload_frame_time_to_bytes (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_frame_time_to_bytes (GstRTPBaseAudioPayload *
payload, GstClockTime time); payload, GstClockTime time);
static guint64 static guint64
gst_base_rtp_audio_payload_sample_time_to_bytes (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_sample_time_to_bytes (GstRTPBaseAudioPayload *
payload, GstClockTime time); payload, GstClockTime time);
static GstFlowReturn gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload static GstFlowReturn gst_rtp_base_audio_payload_handle_buffer (GstRTPBasePayload
* payload, GstBuffer * buffer); * payload, GstBuffer * buffer);
static GstStateChangeReturn gst_base_rtp_payload_audio_change_state (GstElement static GstStateChangeReturn gst_rtp_base_payload_audio_change_state (GstElement
* element, GstStateChange transition); * element, GstStateChange transition);
static gboolean gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload static gboolean gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload
* payload, GstEvent * event); * payload, GstEvent * event);
#define gst_base_rtp_audio_payload_parent_class parent_class #define gst_rtp_base_audio_payload_parent_class parent_class
G_DEFINE_TYPE (GstBaseRTPAudioPayload, gst_base_rtp_audio_payload, G_DEFINE_TYPE (GstRTPBaseAudioPayload, gst_rtp_base_audio_payload,
GST_TYPE_BASE_RTP_PAYLOAD); GST_TYPE_RTP_BASE_PAYLOAD);
static void static void
gst_base_rtp_audio_payload_class_init (GstBaseRTPAudioPayloadClass * klass) gst_rtp_base_audio_payload_class_init (GstRTPBaseAudioPayloadClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class; GstRTPBasePayloadClass *gstbasertppayload_class;
g_type_class_add_private (klass, sizeof (GstBaseRTPAudioPayloadPrivate)); g_type_class_add_private (klass, sizeof (GstRTPBaseAudioPayloadPrivate));
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; gstbasertppayload_class = (GstRTPBasePayloadClass *) klass;
gobject_class->finalize = gst_base_rtp_audio_payload_finalize; gobject_class->finalize = gst_rtp_base_audio_payload_finalize;
gobject_class->set_property = gst_base_rtp_audio_payload_set_property; gobject_class->set_property = gst_rtp_base_audio_payload_set_property;
gobject_class->get_property = gst_base_rtp_audio_payload_get_property; gobject_class->get_property = gst_rtp_base_audio_payload_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_LIST, g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_LIST,
g_param_spec_boolean ("buffer-list", "Buffer List", g_param_spec_boolean ("buffer-list", "Buffer List",
@ -184,21 +184,21 @@ gst_base_rtp_audio_payload_class_init (GstBaseRTPAudioPayloadClass * klass)
DEFAULT_BUFFER_LIST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_BUFFER_LIST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstelement_class->change_state = gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_base_rtp_payload_audio_change_state); GST_DEBUG_FUNCPTR (gst_rtp_base_payload_audio_change_state);
gstbasertppayload_class->handle_buffer = gstbasertppayload_class->handle_buffer =
GST_DEBUG_FUNCPTR (gst_base_rtp_audio_payload_handle_buffer); GST_DEBUG_FUNCPTR (gst_rtp_base_audio_payload_handle_buffer);
gstbasertppayload_class->handle_event = gstbasertppayload_class->handle_event =
GST_DEBUG_FUNCPTR (gst_base_rtp_payload_audio_handle_event); GST_DEBUG_FUNCPTR (gst_rtp_base_payload_audio_handle_event);
GST_DEBUG_CATEGORY_INIT (basertpaudiopayload_debug, "basertpaudiopayload", 0, GST_DEBUG_CATEGORY_INIT (basertpaudiopayload_debug, "basertpaudiopayload", 0,
"base audio RTP payloader"); "base audio RTP payloader");
} }
static void static void
gst_base_rtp_audio_payload_init (GstBaseRTPAudioPayload * payload) gst_rtp_base_audio_payload_init (GstRTPBaseAudioPayload * payload)
{ {
payload->priv = GST_BASE_RTP_AUDIO_PAYLOAD_GET_PRIVATE (payload); payload->priv = GST_RTP_BASE_AUDIO_PAYLOAD_GET_PRIVATE (payload);
/* these need to be set by child object if frame based */ /* these need to be set by child object if frame based */
payload->frame_size = 0; payload->frame_size = 0;
@ -213,11 +213,11 @@ gst_base_rtp_audio_payload_init (GstBaseRTPAudioPayload * payload)
} }
static void static void
gst_base_rtp_audio_payload_finalize (GObject * object) gst_rtp_base_audio_payload_finalize (GObject * object)
{ {
GstBaseRTPAudioPayload *payload; GstRTPBaseAudioPayload *payload;
payload = GST_BASE_RTP_AUDIO_PAYLOAD (object); payload = GST_RTP_BASE_AUDIO_PAYLOAD (object);
g_object_unref (payload->priv->adapter); g_object_unref (payload->priv->adapter);
@ -225,12 +225,12 @@ gst_base_rtp_audio_payload_finalize (GObject * object)
} }
static void static void
gst_base_rtp_audio_payload_set_property (GObject * object, gst_rtp_base_audio_payload_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec) guint prop_id, const GValue * value, GParamSpec * pspec)
{ {
GstBaseRTPAudioPayload *payload; GstRTPBaseAudioPayload *payload;
payload = GST_BASE_RTP_AUDIO_PAYLOAD (object); payload = GST_RTP_BASE_AUDIO_PAYLOAD (object);
switch (prop_id) { switch (prop_id) {
case PROP_BUFFER_LIST: case PROP_BUFFER_LIST:
@ -243,12 +243,12 @@ gst_base_rtp_audio_payload_set_property (GObject * object,
} }
static void static void
gst_base_rtp_audio_payload_get_property (GObject * object, gst_rtp_base_audio_payload_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec) guint prop_id, GValue * value, GParamSpec * pspec)
{ {
GstBaseRTPAudioPayload *payload; GstRTPBaseAudioPayload *payload;
payload = GST_BASE_RTP_AUDIO_PAYLOAD (object); payload = GST_RTP_BASE_AUDIO_PAYLOAD (object);
switch (prop_id) { switch (prop_id) {
case PROP_BUFFER_LIST: case PROP_BUFFER_LIST:
@ -261,14 +261,14 @@ gst_base_rtp_audio_payload_get_property (GObject * object,
} }
/** /**
* gst_base_rtp_audio_payload_set_frame_based: * gst_rtp_base_audio_payload_set_frame_based:
* @basertpaudiopayload: a pointer to the element. * @basertpaudiopayload: a pointer to the element.
* *
* Tells #GstBaseRTPAudioPayload that the child element is for a frame based * Tells #GstRTPBaseAudioPayload that the child element is for a frame based
* audio codec * audio codec
*/ */
void void
gst_base_rtp_audio_payload_set_frame_based (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *
basertpaudiopayload) basertpaudiopayload)
{ {
g_return_if_fail (basertpaudiopayload != NULL); g_return_if_fail (basertpaudiopayload != NULL);
@ -277,22 +277,22 @@ gst_base_rtp_audio_payload_set_frame_based (GstBaseRTPAudioPayload *
g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == NULL); g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == NULL);
basertpaudiopayload->priv->bytes_to_time = basertpaudiopayload->priv->bytes_to_time =
gst_base_rtp_audio_payload_frame_bytes_to_time; gst_rtp_base_audio_payload_frame_bytes_to_time;
basertpaudiopayload->priv->bytes_to_rtptime = basertpaudiopayload->priv->bytes_to_rtptime =
gst_base_rtp_audio_payload_frame_bytes_to_rtptime; gst_rtp_base_audio_payload_frame_bytes_to_rtptime;
basertpaudiopayload->priv->time_to_bytes = basertpaudiopayload->priv->time_to_bytes =
gst_base_rtp_audio_payload_frame_time_to_bytes; gst_rtp_base_audio_payload_frame_time_to_bytes;
} }
/** /**
* gst_base_rtp_audio_payload_set_sample_based: * gst_rtp_base_audio_payload_set_sample_based:
* @basertpaudiopayload: a pointer to the element. * @basertpaudiopayload: a pointer to the element.
* *
* Tells #GstBaseRTPAudioPayload that the child element is for a sample based * Tells #GstRTPBaseAudioPayload that the child element is for a sample based
* audio codec * audio codec
*/ */
void void
gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
basertpaudiopayload) basertpaudiopayload)
{ {
g_return_if_fail (basertpaudiopayload != NULL); g_return_if_fail (basertpaudiopayload != NULL);
@ -301,15 +301,15 @@ gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload *
g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == NULL); g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == NULL);
basertpaudiopayload->priv->bytes_to_time = basertpaudiopayload->priv->bytes_to_time =
gst_base_rtp_audio_payload_sample_bytes_to_time; gst_rtp_base_audio_payload_sample_bytes_to_time;
basertpaudiopayload->priv->bytes_to_rtptime = basertpaudiopayload->priv->bytes_to_rtptime =
gst_base_rtp_audio_payload_sample_bytes_to_rtptime; gst_rtp_base_audio_payload_sample_bytes_to_rtptime;
basertpaudiopayload->priv->time_to_bytes = basertpaudiopayload->priv->time_to_bytes =
gst_base_rtp_audio_payload_sample_time_to_bytes; gst_rtp_base_audio_payload_sample_time_to_bytes;
} }
/** /**
* gst_base_rtp_audio_payload_set_frame_options: * gst_rtp_base_audio_payload_set_frame_options:
* @basertpaudiopayload: a pointer to the element. * @basertpaudiopayload: a pointer to the element.
* @frame_duration: The duraction of an audio frame in milliseconds. * @frame_duration: The duraction of an audio frame in milliseconds.
* @frame_size: The size of an audio frame in bytes. * @frame_size: The size of an audio frame in bytes.
@ -318,10 +318,10 @@ gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload *
* *
*/ */
void void
gst_base_rtp_audio_payload_set_frame_options (GstBaseRTPAudioPayload gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload
* basertpaudiopayload, gint frame_duration, gint frame_size) * basertpaudiopayload, gint frame_duration, gint frame_size)
{ {
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
g_return_if_fail (basertpaudiopayload != NULL); g_return_if_fail (basertpaudiopayload != NULL);
@ -339,25 +339,25 @@ gst_base_rtp_audio_payload_set_frame_options (GstBaseRTPAudioPayload
} }
/** /**
* gst_base_rtp_audio_payload_set_sample_options: * gst_rtp_base_audio_payload_set_sample_options:
* @basertpaudiopayload: a pointer to the element. * @basertpaudiopayload: a pointer to the element.
* @sample_size: Size per sample in bytes. * @sample_size: Size per sample in bytes.
* *
* Sets the options for sample based audio codecs. * Sets the options for sample based audio codecs.
*/ */
void void
gst_base_rtp_audio_payload_set_sample_options (GstBaseRTPAudioPayload gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload
* basertpaudiopayload, gint sample_size) * basertpaudiopayload, gint sample_size)
{ {
g_return_if_fail (basertpaudiopayload != NULL); g_return_if_fail (basertpaudiopayload != NULL);
/* sample_size is in bits internally */ /* sample_size is in bits internally */
gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload, gst_rtp_base_audio_payload_set_samplebits_options (basertpaudiopayload,
sample_size * 8); sample_size * 8);
} }
/** /**
* gst_base_rtp_audio_payload_set_samplebits_options: * gst_rtp_base_audio_payload_set_samplebits_options:
* @basertpaudiopayload: a pointer to the element. * @basertpaudiopayload: a pointer to the element.
* @sample_size: Size per sample in bits. * @sample_size: Size per sample in bits.
* *
@ -366,11 +366,11 @@ gst_base_rtp_audio_payload_set_sample_options (GstBaseRTPAudioPayload
* Since: 0.10.18 * Since: 0.10.18
*/ */
void void
gst_base_rtp_audio_payload_set_samplebits_options (GstBaseRTPAudioPayload gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
* basertpaudiopayload, gint sample_size) * basertpaudiopayload, gint sample_size)
{ {
guint fragment_size; guint fragment_size;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
g_return_if_fail (basertpaudiopayload != NULL); g_return_if_fail (basertpaudiopayload != NULL);
@ -392,14 +392,14 @@ gst_base_rtp_audio_payload_set_samplebits_options (GstBaseRTPAudioPayload
} }
static void static void
gst_base_rtp_audio_payload_set_meta (GstBaseRTPAudioPayload * payload, gst_rtp_base_audio_payload_set_meta (GstRTPBaseAudioPayload * payload,
GstBuffer * buffer, guint payload_len, GstClockTime timestamp) GstBuffer * buffer, guint payload_len, GstClockTime timestamp)
{ {
GstBaseRTPPayload *basepayload; GstRTPBasePayload *basepayload;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
GstRTPBuffer rtp; GstRTPBuffer rtp;
basepayload = GST_BASE_RTP_PAYLOAD_CAST (payload); basepayload = GST_RTP_BASE_PAYLOAD_CAST (payload);
priv = payload->priv; priv = payload->priv;
/* set payload type */ /* set payload type */
@ -431,8 +431,8 @@ gst_base_rtp_audio_payload_set_meta (GstBaseRTPAudioPayload * payload,
} }
/** /**
* gst_base_rtp_audio_payload_push: * gst_rtp_base_audio_payload_push:
* @baseaudiopayload: a #GstBaseRTPPayload * @baseaudiopayload: a #GstRTPBasePayload
* @data: data to set as payload * @data: data to set as payload
* @payload_len: length of payload * @payload_len: length of payload
* @timestamp: a #GstClockTime * @timestamp: a #GstClockTime
@ -446,16 +446,16 @@ gst_base_rtp_audio_payload_set_meta (GstBaseRTPAudioPayload * payload,
* Since: 0.10.13 * Since: 0.10.13
*/ */
GstFlowReturn GstFlowReturn
gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload, gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,
const guint8 * data, guint payload_len, GstClockTime timestamp) const guint8 * data, guint payload_len, GstClockTime timestamp)
{ {
GstBaseRTPPayload *basepayload; GstRTPBasePayload *basepayload;
GstBuffer *outbuf; GstBuffer *outbuf;
guint8 *payload; guint8 *payload;
GstFlowReturn ret; GstFlowReturn ret;
GstRTPBuffer rtp; GstRTPBuffer rtp;
basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload); basepayload = GST_RTP_BASE_PAYLOAD (baseaudiopayload);
GST_DEBUG_OBJECT (baseaudiopayload, "Pushing %d bytes ts %" GST_TIME_FORMAT, GST_DEBUG_OBJECT (baseaudiopayload, "Pushing %d bytes ts %" GST_TIME_FORMAT,
payload_len, GST_TIME_ARGS (timestamp)); payload_len, GST_TIME_ARGS (timestamp));
@ -470,27 +470,27 @@ gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload,
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
/* set metadata */ /* set metadata */
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len, gst_rtp_base_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
timestamp); timestamp);
ret = gst_base_rtp_payload_push (basepayload, outbuf); ret = gst_rtp_base_payload_push (basepayload, outbuf);
return ret; return ret;
} }
static GstFlowReturn static GstFlowReturn
gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_push_buffer (GstRTPBaseAudioPayload *
baseaudiopayload, GstBuffer * buffer, GstClockTime timestamp) baseaudiopayload, GstBuffer * buffer, GstClockTime timestamp)
{ {
GstBaseRTPPayload *basepayload; GstRTPBasePayload *basepayload;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
GstBuffer *outbuf; GstBuffer *outbuf;
guint8 *payload; guint8 *payload;
guint payload_len; guint payload_len;
GstFlowReturn ret; GstFlowReturn ret;
priv = baseaudiopayload->priv; priv = baseaudiopayload->priv;
basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload); basepayload = GST_RTP_BASE_PAYLOAD (baseaudiopayload);
payload_len = gst_buffer_get_size (buffer); payload_len = gst_buffer_get_size (buffer);
@ -506,7 +506,7 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
} }
/* set metadata */ /* set metadata */
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len, gst_rtp_base_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
timestamp); timestamp);
if (priv->buffer_list) { if (priv->buffer_list) {
@ -524,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_base_rtp_payload_push_list (basepayload, list); ret = gst_rtp_base_payload_push_list (basepayload, list);
} else { } else {
GstRTPBuffer rtp; GstRTPBuffer rtp;
@ -537,15 +537,15 @@ 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_base_rtp_payload_push (basepayload, outbuf); ret = gst_rtp_base_payload_push (basepayload, outbuf);
} }
return ret; return ret;
} }
/** /**
* gst_base_rtp_audio_payload_flush: * gst_rtp_base_audio_payload_flush:
* @baseaudiopayload: a #GstBaseRTPPayload * @baseaudiopayload: a #GstRTPBasePayload
* @payload_len: length of payload * @payload_len: length of payload
* @timestamp: a #GstClockTime * @timestamp: a #GstClockTime
* *
@ -561,11 +561,11 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
* Since: 0.10.25 * Since: 0.10.25
*/ */
GstFlowReturn GstFlowReturn
gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload, gst_rtp_base_audio_payload_flush (GstRTPBaseAudioPayload * baseaudiopayload,
guint payload_len, GstClockTime timestamp) guint payload_len, GstClockTime timestamp)
{ {
GstBaseRTPPayload *basepayload; GstRTPBasePayload *basepayload;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
GstBuffer *outbuf; GstBuffer *outbuf;
guint8 *payload; guint8 *payload;
GstFlowReturn ret; GstFlowReturn ret;
@ -575,7 +575,7 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
priv = baseaudiopayload->priv; priv = baseaudiopayload->priv;
adapter = priv->adapter; adapter = priv->adapter;
basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload); basepayload = GST_RTP_BASE_PAYLOAD (baseaudiopayload);
if (payload_len == -1) if (payload_len == -1)
payload_len = gst_adapter_available (adapter); payload_len = gst_adapter_available (adapter);
@ -609,7 +609,7 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
buffer = gst_adapter_take_buffer (adapter, payload_len); buffer = gst_adapter_take_buffer (adapter, payload_len);
ret = ret =
gst_base_rtp_audio_payload_push_buffer (baseaudiopayload, buffer, gst_rtp_base_audio_payload_push_buffer (baseaudiopayload, buffer,
timestamp); timestamp);
} else { } else {
GstRTPBuffer rtp; GstRTPBuffer rtp;
@ -625,10 +625,10 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
gst_rtp_buffer_unmap (&rtp); gst_rtp_buffer_unmap (&rtp);
/* set metadata */ /* set metadata */
gst_base_rtp_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len, gst_rtp_base_audio_payload_set_meta (baseaudiopayload, outbuf, payload_len,
timestamp); timestamp);
ret = gst_base_rtp_payload_push (basepayload, outbuf); ret = gst_rtp_base_payload_push (basepayload, outbuf);
} }
return ret; return ret;
@ -640,24 +640,24 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
* mtu and min/max_ptime values. We cache those so that we don't have to redo * mtu and min/max_ptime values. We cache those so that we don't have to redo
* all the calculations */ * all the calculations */
static gboolean static gboolean
gst_base_rtp_audio_payload_get_lengths (GstBaseRTPPayload * gst_rtp_base_audio_payload_get_lengths (GstRTPBasePayload *
basepayload, guint * min_payload_len, guint * max_payload_len, basepayload, guint * min_payload_len, guint * max_payload_len,
guint * align) guint * align)
{ {
GstBaseRTPAudioPayload *payload; GstRTPBaseAudioPayload *payload;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
guint max_mtu, mtu; guint max_mtu, mtu;
guint maxptime_octets; guint maxptime_octets;
guint minptime_octets; guint minptime_octets;
guint ptime_mult_octets; guint ptime_mult_octets;
payload = GST_BASE_RTP_AUDIO_PAYLOAD_CAST (basepayload); payload = GST_RTP_BASE_AUDIO_PAYLOAD_CAST (basepayload);
priv = payload->priv; priv = payload->priv;
if (priv->align == 0) if (priv->align == 0)
return FALSE; return FALSE;
mtu = GST_BASE_RTP_PAYLOAD_MTU (payload); mtu = GST_RTP_BASE_PAYLOAD_MTU (payload);
/* check cached values */ /* check cached values */
if (G_LIKELY (priv->cached_mtu == mtu if (G_LIKELY (priv->cached_mtu == mtu
@ -726,7 +726,7 @@ gst_base_rtp_audio_payload_get_lengths (GstBaseRTPPayload *
/* frame conversions functions */ /* frame conversions functions */
static GstClockTime static GstClockTime
gst_base_rtp_audio_payload_frame_bytes_to_time (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_frame_bytes_to_time (GstRTPBaseAudioPayload *
payload, guint64 bytes) payload, guint64 bytes)
{ {
guint64 framecount; guint64 framecount;
@ -739,7 +739,7 @@ gst_base_rtp_audio_payload_frame_bytes_to_time (GstBaseRTPAudioPayload *
} }
static guint32 static guint32
gst_base_rtp_audio_payload_frame_bytes_to_rtptime (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_frame_bytes_to_rtptime (GstRTPBaseAudioPayload *
payload, guint64 bytes) payload, guint64 bytes)
{ {
guint64 framecount; guint64 framecount;
@ -752,11 +752,11 @@ gst_base_rtp_audio_payload_frame_bytes_to_rtptime (GstBaseRTPAudioPayload *
time = framecount * payload->priv->frame_duration_ns; time = framecount * payload->priv->frame_duration_ns;
return gst_util_uint64_scale_int (time, return gst_util_uint64_scale_int (time,
GST_BASE_RTP_PAYLOAD (payload)->clock_rate, GST_SECOND); GST_RTP_BASE_PAYLOAD (payload)->clock_rate, GST_SECOND);
} }
static guint64 static guint64
gst_base_rtp_audio_payload_frame_time_to_bytes (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_frame_time_to_bytes (GstRTPBaseAudioPayload *
payload, GstClockTime time) payload, GstClockTime time)
{ {
return gst_util_uint64_scale (time, payload->frame_size, return gst_util_uint64_scale (time, payload->frame_size,
@ -765,7 +765,7 @@ gst_base_rtp_audio_payload_frame_time_to_bytes (GstBaseRTPAudioPayload *
/* sample conversion functions */ /* sample conversion functions */
static GstClockTime static GstClockTime
gst_base_rtp_audio_payload_sample_bytes_to_time (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_sample_bytes_to_time (GstRTPBaseAudioPayload *
payload, guint64 bytes) payload, guint64 bytes)
{ {
guint64 rtptime; guint64 rtptime;
@ -777,11 +777,11 @@ gst_base_rtp_audio_payload_sample_bytes_to_time (GstBaseRTPAudioPayload *
rtptime = bytes; rtptime = bytes;
return gst_util_uint64_scale_int (rtptime, GST_SECOND, return gst_util_uint64_scale_int (rtptime, GST_SECOND,
GST_BASE_RTP_PAYLOAD (payload)->clock_rate); GST_RTP_BASE_PAYLOAD (payload)->clock_rate);
} }
static guint32 static guint32
gst_base_rtp_audio_payload_sample_bytes_to_rtptime (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_sample_bytes_to_rtptime (GstRTPBaseAudioPayload *
payload, guint64 bytes) payload, guint64 bytes)
{ {
/* avoid division when we can */ /* avoid division when we can */
@ -792,13 +792,13 @@ gst_base_rtp_audio_payload_sample_bytes_to_rtptime (GstBaseRTPAudioPayload *
} }
static guint64 static guint64
gst_base_rtp_audio_payload_sample_time_to_bytes (GstBaseRTPAudioPayload * gst_rtp_base_audio_payload_sample_time_to_bytes (GstRTPBaseAudioPayload *
payload, guint64 time) payload, guint64 time)
{ {
guint64 samples; guint64 samples;
samples = gst_util_uint64_scale_int (time, samples = gst_util_uint64_scale_int (time,
GST_BASE_RTP_PAYLOAD (payload)->clock_rate, GST_SECOND); GST_RTP_BASE_PAYLOAD (payload)->clock_rate, GST_SECOND);
/* avoid multiplication when we can */ /* avoid multiplication when we can */
if (G_LIKELY (payload->sample_size != 8)) if (G_LIKELY (payload->sample_size != 8))
@ -808,11 +808,11 @@ gst_base_rtp_audio_payload_sample_time_to_bytes (GstBaseRTPAudioPayload *
} }
static GstFlowReturn static GstFlowReturn
gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload * gst_rtp_base_audio_payload_handle_buffer (GstRTPBasePayload *
basepayload, GstBuffer * buffer) basepayload, GstBuffer * buffer)
{ {
GstBaseRTPAudioPayload *payload; GstRTPBaseAudioPayload *payload;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
guint payload_len; guint payload_len;
GstFlowReturn ret; GstFlowReturn ret;
guint available; guint available;
@ -825,7 +825,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
ret = GST_FLOW_OK; ret = GST_FLOW_OK;
payload = GST_BASE_RTP_AUDIO_PAYLOAD_CAST (basepayload); payload = GST_RTP_BASE_AUDIO_PAYLOAD_CAST (basepayload);
priv = payload->priv; priv = payload->priv;
timestamp = GST_BUFFER_TIMESTAMP (buffer); timestamp = GST_BUFFER_TIMESTAMP (buffer);
@ -834,7 +834,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
GST_DEBUG_OBJECT (payload, "Got DISCONT"); GST_DEBUG_OBJECT (payload, "Got DISCONT");
/* flush everything out of the adapter, mark DISCONT */ /* flush everything out of the adapter, mark DISCONT */
ret = gst_base_rtp_audio_payload_flush (payload, -1, -1); ret = gst_rtp_base_audio_payload_flush (payload, -1, -1);
priv->discont = TRUE; priv->discont = TRUE;
/* get the distance between the timestamp gap and produce the same gap in /* get the distance between the timestamp gap and produce the same gap in
@ -862,7 +862,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
} }
} }
if (!gst_base_rtp_audio_payload_get_lengths (basepayload, &min_payload_len, if (!gst_rtp_base_audio_payload_get_lengths (basepayload, &min_payload_len,
&max_payload_len, &align)) &max_payload_len, &align))
goto config_error; goto config_error;
@ -884,7 +884,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
/* If buffer fits on an RTP packet, let's just push it through /* If buffer fits on an RTP packet, let's just push it through
* this will check against max_ptime and max_mtu */ * this will check against max_ptime and max_mtu */
GST_DEBUG_OBJECT (payload, "Fast packet push"); GST_DEBUG_OBJECT (payload, "Fast packet push");
ret = gst_base_rtp_audio_payload_push_buffer (payload, buffer, timestamp); ret = gst_rtp_base_audio_payload_push_buffer (payload, buffer, timestamp);
} else { } else {
/* push the buffer in the adapter */ /* push the buffer in the adapter */
gst_adapter_push (priv->adapter, buffer); gst_adapter_push (priv->adapter, buffer);
@ -900,7 +900,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
/* and flush out the bytes from the adapter, automatically set the /* and flush out the bytes from the adapter, automatically set the
* timestamp. */ * timestamp. */
ret = gst_base_rtp_audio_payload_flush (payload, payload_len, -1); ret = gst_rtp_base_audio_payload_flush (payload, payload_len, -1);
available -= payload_len; available -= payload_len;
GST_DEBUG_OBJECT (payload, "available after push %u", available); GST_DEBUG_OBJECT (payload, "available after push %u", available);
@ -919,13 +919,13 @@ config_error:
} }
static GstStateChangeReturn static GstStateChangeReturn
gst_base_rtp_payload_audio_change_state (GstElement * element, gst_rtp_base_payload_audio_change_state (GstElement * element,
GstStateChange transition) GstStateChange transition)
{ {
GstBaseRTPAudioPayload *basertppayload; GstRTPBaseAudioPayload *basertppayload;
GstStateChangeReturn ret; GstStateChangeReturn ret;
basertppayload = GST_BASE_RTP_AUDIO_PAYLOAD (element); basertppayload = GST_RTP_BASE_AUDIO_PAYLOAD (element);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
@ -951,18 +951,18 @@ gst_base_rtp_payload_audio_change_state (GstElement * element,
} }
static gboolean static gboolean
gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload * basep, gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload * basep,
GstEvent * event) GstEvent * event)
{ {
GstBaseRTPAudioPayload *payload; GstRTPBaseAudioPayload *payload;
gboolean res = FALSE; gboolean res = FALSE;
payload = GST_BASE_RTP_AUDIO_PAYLOAD (basep); payload = GST_RTP_BASE_AUDIO_PAYLOAD (basep);
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS: case GST_EVENT_EOS:
/* flush remaining bytes in the adapter */ /* flush remaining bytes in the adapter */
gst_base_rtp_audio_payload_flush (payload, -1, -1); gst_rtp_base_audio_payload_flush (payload, -1, -1);
break; break;
case GST_EVENT_FLUSH_STOP: case GST_EVENT_FLUSH_STOP:
gst_adapter_clear (payload->priv->adapter); gst_adapter_clear (payload->priv->adapter);
@ -972,14 +972,14 @@ gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload * basep,
} }
/* let parent handle the remainder of the event */ /* let parent handle the remainder of the event */
res = GST_BASE_RTP_PAYLOAD_CLASS (parent_class)->handle_event (basep, event); res = GST_RTP_BASE_PAYLOAD_CLASS (parent_class)->handle_event (basep, event);
return res; return res;
} }
/** /**
* gst_base_rtp_audio_payload_get_adapter: * gst_rtp_base_audio_payload_get_adapter:
* @basertpaudiopayload: a #GstBaseRTPAudioPayload * @basertpaudiopayload: a #GstRTPBaseAudioPayload
* *
* Gets the internal adapter used by the depayloader. * Gets the internal adapter used by the depayloader.
* *
@ -988,7 +988,7 @@ gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload * basep,
* Since: 0.10.13 * Since: 0.10.13
*/ */
GstAdapter * GstAdapter *
gst_base_rtp_audio_payload_get_adapter (GstBaseRTPAudioPayload gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload
* basertpaudiopayload) * basertpaudiopayload)
{ {
GstAdapter *adapter; GstAdapter *adapter;

View file

@ -17,8 +17,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_BASE_RTP_AUDIO_PAYLOAD_H__ #ifndef __GST_RTP_BASE_AUDIO_PAYLOAD_H__
#define __GST_BASE_RTP_AUDIO_PAYLOAD_H__ #define __GST_RTP_BASE_AUDIO_PAYLOAD_H__
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/rtp/gstbasertppayload.h> #include <gst/rtp/gstbasertppayload.h>
@ -26,31 +26,31 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GstBaseRTPAudioPayload GstBaseRTPAudioPayload; typedef struct _GstRTPBaseAudioPayload GstRTPBaseAudioPayload;
typedef struct _GstBaseRTPAudioPayloadClass GstBaseRTPAudioPayloadClass; typedef struct _GstRTPBaseAudioPayloadClass GstRTPBaseAudioPayloadClass;
typedef struct _GstBaseRTPAudioPayloadPrivate GstBaseRTPAudioPayloadPrivate; typedef struct _GstRTPBaseAudioPayloadPrivate GstRTPBaseAudioPayloadPrivate;
#define GST_TYPE_BASE_RTP_AUDIO_PAYLOAD \ #define GST_TYPE_RTP_BASE_AUDIO_PAYLOAD \
(gst_base_rtp_audio_payload_get_type()) (gst_rtp_base_audio_payload_get_type())
#define GST_BASE_RTP_AUDIO_PAYLOAD(obj) \ #define GST_RTP_BASE_AUDIO_PAYLOAD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD,GstBaseRTPAudioPayload)) GST_TYPE_RTP_BASE_AUDIO_PAYLOAD,GstRTPBaseAudioPayload))
#define GST_BASE_RTP_AUDIO_PAYLOAD_CLASS(klass) \ #define GST_RTP_BASE_AUDIO_PAYLOAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \ (G_TYPE_CHECK_CLASS_CAST((klass), \
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD,GstBaseRTPAudioPayloadClass)) GST_TYPE_RTP_BASE_AUDIO_PAYLOAD,GstRTPBaseAudioPayloadClass))
#define GST_IS_BASE_RTP_AUDIO_PAYLOAD(obj) \ #define GST_IS_RTP_BASE_AUDIO_PAYLOAD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_AUDIO_PAYLOAD)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_AUDIO_PAYLOAD))
#define GST_IS_BASE_RTP_AUDIO_PAYLOAD_CLASS(klass) \ #define GST_IS_RTP_BASE_AUDIO_PAYLOAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_AUDIO_PAYLOAD)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_AUDIO_PAYLOAD))
#define GST_BASE_RTP_AUDIO_PAYLOAD_CAST(obj) \ #define GST_RTP_BASE_AUDIO_PAYLOAD_CAST(obj) \
((GstBaseRTPAudioPayload *) (obj)) ((GstRTPBaseAudioPayload *) (obj))
struct _GstBaseRTPAudioPayload struct _GstRTPBaseAudioPayload
{ {
GstBaseRTPPayload payload; GstRTPBasePayload payload;
GstBaseRTPAudioPayloadPrivate *priv; GstRTPBaseAudioPayloadPrivate *priv;
GstClockTime base_ts; GstClockTime base_ts;
gint frame_size; gint frame_size;
@ -62,44 +62,44 @@ struct _GstBaseRTPAudioPayload
}; };
/** /**
* GstBaseRTPAudioPayloadClass: * GstRTPBaseAudioPayloadClass:
* @parent_class: the parent class * @parent_class: the parent class
* *
* Base class for audio RTP payloader. * Base class for audio RTP payloader.
*/ */
struct _GstBaseRTPAudioPayloadClass struct _GstRTPBaseAudioPayloadClass
{ {
GstBaseRTPPayloadClass parent_class; GstRTPBasePayloadClass parent_class;
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_base_rtp_audio_payload_get_type (void); GType gst_rtp_base_audio_payload_get_type (void);
/* configure frame based */ /* configure frame based */
void gst_base_rtp_audio_payload_set_frame_based (GstBaseRTPAudioPayload *basertpaudiopayload); void gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *basertpaudiopayload);
void gst_base_rtp_audio_payload_set_frame_options (GstBaseRTPAudioPayload *basertpaudiopayload, void gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload *basertpaudiopayload,
gint frame_duration, gint frame_size); gint frame_duration, gint frame_size);
/* configure sample based */ /* configure sample based */
void gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload *basertpaudiopayload); void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *basertpaudiopayload);
void gst_base_rtp_audio_payload_set_sample_options (GstBaseRTPAudioPayload *basertpaudiopayload, void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *basertpaudiopayload,
gint sample_size); gint sample_size);
void gst_base_rtp_audio_payload_set_samplebits_options (GstBaseRTPAudioPayload *basertpaudiopayload, void gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload *basertpaudiopayload,
gint sample_size); gint sample_size);
/* get the internal adapter */ /* get the internal adapter */
GstAdapter* gst_base_rtp_audio_payload_get_adapter (GstBaseRTPAudioPayload *basertpaudiopayload); GstAdapter* gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload *basertpaudiopayload);
/* push and flushing data */ /* push and flushing data */
GstFlowReturn gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload, GstFlowReturn gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,
const guint8 * data, guint payload_len, const guint8 * data, guint payload_len,
GstClockTime timestamp); GstClockTime timestamp);
GstFlowReturn gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload, GstFlowReturn gst_rtp_base_audio_payload_flush (GstRTPBaseAudioPayload * baseaudiopayload,
guint payload_len, GstClockTime timestamp); guint payload_len, GstClockTime timestamp);
G_END_DECLS G_END_DECLS
#endif /* __GST_BASE_RTP_AUDIO_PAYLOAD_H__ */ #endif /* __GST_RTP_BASE_AUDIO_PAYLOAD_H__ */

View file

@ -30,10 +30,10 @@
GST_DEBUG_CATEGORY_STATIC (basertpdepayload_debug); GST_DEBUG_CATEGORY_STATIC (basertpdepayload_debug);
#define GST_CAT_DEFAULT (basertpdepayload_debug) #define GST_CAT_DEFAULT (basertpdepayload_debug)
#define GST_BASE_RTP_DEPAYLOAD_GET_PRIVATE(obj) \ #define GST_RTP_BASE_DEPAYLOAD_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_RTP_DEPAYLOAD, GstBaseRTPDepayloadPrivate)) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_DEPAYLOAD, GstRTPBaseDepayloadPrivate))
struct _GstBaseRTPDepayloadPrivate struct _GstRTPBaseDepayloadPrivate
{ {
GstClockTime npt_start; GstClockTime npt_start;
GstClockTime npt_stop; GstClockTime npt_stop;
@ -63,58 +63,58 @@ enum
PROP_LAST PROP_LAST
}; };
static void gst_base_rtp_depayload_finalize (GObject * object); static void gst_rtp_base_depayload_finalize (GObject * object);
static void gst_base_rtp_depayload_set_property (GObject * object, static void gst_rtp_base_depayload_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_base_rtp_depayload_get_property (GObject * object, static void gst_rtp_base_depayload_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); guint prop_id, GValue * value, GParamSpec * pspec);
static GstFlowReturn gst_base_rtp_depayload_chain (GstPad * pad, static GstFlowReturn gst_rtp_base_depayload_chain (GstPad * pad,
GstBuffer * in); GstBuffer * in);
static gboolean gst_base_rtp_depayload_handle_sink_event (GstPad * pad, static gboolean gst_rtp_base_depayload_handle_sink_event (GstPad * pad,
GstEvent * event); GstEvent * event);
static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement * static GstStateChangeReturn gst_rtp_base_depayload_change_state (GstElement *
element, GstStateChange transition); element, GstStateChange transition);
static gboolean gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * static gboolean gst_rtp_base_depayload_packet_lost (GstRTPBaseDepayload *
filter, GstEvent * event); filter, GstEvent * event);
static gboolean gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * static gboolean gst_rtp_base_depayload_handle_event (GstRTPBaseDepayload *
filter, GstEvent * event); filter, GstEvent * event);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
static void gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * static void gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass *
klass); klass);
static void gst_base_rtp_depayload_init (GstBaseRTPDepayload * basertppayload, static void gst_rtp_base_depayload_init (GstRTPBaseDepayload * basertppayload,
GstBaseRTPDepayloadClass * klass); GstRTPBaseDepayloadClass * klass);
GType GType
gst_base_rtp_depayload_get_type (void) gst_rtp_base_depayload_get_type (void)
{ {
static GType base_rtp_depayload_type = 0; static GType rtp_base_depayload_type = 0;
if (g_once_init_enter ((gsize *) & base_rtp_depayload_type)) { if (g_once_init_enter ((gsize *) & rtp_base_depayload_type)) {
static const GTypeInfo base_rtp_depayload_info = { static const GTypeInfo rtp_base_depayload_info = {
sizeof (GstBaseRTPDepayloadClass), sizeof (GstRTPBaseDepayloadClass),
NULL, NULL,
NULL, NULL,
(GClassInitFunc) gst_base_rtp_depayload_class_init, (GClassInitFunc) gst_rtp_base_depayload_class_init,
NULL, NULL,
NULL, NULL,
sizeof (GstBaseRTPDepayload), sizeof (GstRTPBaseDepayload),
0, 0,
(GInstanceInitFunc) gst_base_rtp_depayload_init, (GInstanceInitFunc) gst_rtp_base_depayload_init,
}; };
g_once_init_leave ((gsize *) & base_rtp_depayload_type, g_once_init_leave ((gsize *) & rtp_base_depayload_type,
g_type_register_static (GST_TYPE_ELEMENT, "GstBaseRTPDepayload", g_type_register_static (GST_TYPE_ELEMENT, "GstRTPBaseDepayload",
&base_rtp_depayload_info, G_TYPE_FLAG_ABSTRACT)); &rtp_base_depayload_info, G_TYPE_FLAG_ABSTRACT));
} }
return base_rtp_depayload_type; return rtp_base_depayload_type;
} }
static void static void
gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass) gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -123,29 +123,29 @@ gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass)
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (GstBaseRTPDepayloadPrivate)); g_type_class_add_private (klass, sizeof (GstRTPBaseDepayloadPrivate));
gobject_class->finalize = gst_base_rtp_depayload_finalize; gobject_class->finalize = gst_rtp_base_depayload_finalize;
gobject_class->set_property = gst_base_rtp_depayload_set_property; gobject_class->set_property = gst_rtp_base_depayload_set_property;
gobject_class->get_property = gst_base_rtp_depayload_get_property; gobject_class->get_property = gst_rtp_base_depayload_get_property;
gstelement_class->change_state = gst_base_rtp_depayload_change_state; gstelement_class->change_state = gst_rtp_base_depayload_change_state;
klass->packet_lost = gst_base_rtp_depayload_packet_lost; klass->packet_lost = gst_rtp_base_depayload_packet_lost;
klass->handle_event = gst_base_rtp_depayload_handle_event; klass->handle_event = gst_rtp_base_depayload_handle_event;
GST_DEBUG_CATEGORY_INIT (basertpdepayload_debug, "basertpdepayload", 0, GST_DEBUG_CATEGORY_INIT (basertpdepayload_debug, "basertpdepayload", 0,
"Base class for RTP Depayloaders"); "Base class for RTP Depayloaders");
} }
static void static void
gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter, gst_rtp_base_depayload_init (GstRTPBaseDepayload * filter,
GstBaseRTPDepayloadClass * klass) GstRTPBaseDepayloadClass * klass)
{ {
GstPadTemplate *pad_template; GstPadTemplate *pad_template;
GstBaseRTPDepayloadPrivate *priv; GstRTPBaseDepayloadPrivate *priv;
priv = GST_BASE_RTP_DEPAYLOAD_GET_PRIVATE (filter); priv = GST_RTP_BASE_DEPAYLOAD_GET_PRIVATE (filter);
filter->priv = priv; filter->priv = priv;
GST_DEBUG_OBJECT (filter, "init"); GST_DEBUG_OBJECT (filter, "init");
@ -154,9 +154,9 @@ gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter,
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (klass), "sink"); gst_element_class_get_pad_template (GST_ELEMENT_CLASS (klass), "sink");
g_return_if_fail (pad_template != NULL); g_return_if_fail (pad_template != NULL);
filter->sinkpad = gst_pad_new_from_template (pad_template, "sink"); filter->sinkpad = gst_pad_new_from_template (pad_template, "sink");
gst_pad_set_chain_function (filter->sinkpad, gst_base_rtp_depayload_chain); gst_pad_set_chain_function (filter->sinkpad, gst_rtp_base_depayload_chain);
gst_pad_set_event_function (filter->sinkpad, gst_pad_set_event_function (filter->sinkpad,
gst_base_rtp_depayload_handle_sink_event); gst_rtp_base_depayload_handle_sink_event);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
pad_template = pad_template =
@ -170,23 +170,23 @@ gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter,
} }
static void static void
gst_base_rtp_depayload_finalize (GObject * object) gst_rtp_base_depayload_finalize (GObject * object)
{ {
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }
static gboolean static gboolean
gst_base_rtp_depayload_setcaps (GstBaseRTPDepayload * filter, GstCaps * caps) gst_rtp_base_depayload_setcaps (GstRTPBaseDepayload * filter, GstCaps * caps)
{ {
GstBaseRTPDepayloadClass *bclass; GstRTPBaseDepayloadClass *bclass;
GstBaseRTPDepayloadPrivate *priv; GstRTPBaseDepayloadPrivate *priv;
gboolean res; gboolean res;
GstStructure *caps_struct; GstStructure *caps_struct;
const GValue *value; const GValue *value;
priv = filter->priv; priv = filter->priv;
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
GST_DEBUG_OBJECT (filter, "Set caps"); GST_DEBUG_OBJECT (filter, "Set caps");
@ -236,11 +236,11 @@ gst_base_rtp_depayload_setcaps (GstBaseRTPDepayload * filter, GstCaps * caps)
} }
static GstFlowReturn static GstFlowReturn
gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in) gst_rtp_base_depayload_chain (GstPad * pad, GstBuffer * in)
{ {
GstBaseRTPDepayload *filter; GstRTPBaseDepayload *filter;
GstBaseRTPDepayloadPrivate *priv; GstRTPBaseDepayloadPrivate *priv;
GstBaseRTPDepayloadClass *bclass; GstRTPBaseDepayloadClass *bclass;
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *out_buf; GstBuffer *out_buf;
GstClockTime pts, dts; GstClockTime pts, dts;
@ -250,7 +250,7 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
gint gap; gint gap;
GstRTPBuffer rtp; GstRTPBuffer rtp;
filter = GST_BASE_RTP_DEPAYLOAD (GST_OBJECT_PARENT (pad)); filter = GST_RTP_BASE_DEPAYLOAD (GST_OBJECT_PARENT (pad));
priv = filter->priv; priv = filter->priv;
/* we must have a setcaps first */ /* we must have a setcaps first */
@ -326,7 +326,7 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
GST_BUFFER_FLAG_SET (in, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_SET (in, GST_BUFFER_FLAG_DISCONT);
} }
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
if (G_UNLIKELY (bclass->process == NULL)) if (G_UNLIKELY (bclass->process == NULL))
goto no_process; goto no_process;
@ -334,7 +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) {
ret = gst_base_rtp_depayload_push (filter, out_buf); ret = gst_rtp_base_depayload_push (filter, out_buf);
} }
gst_buffer_unref (in); gst_buffer_unref (in);
@ -380,7 +380,7 @@ no_process:
} }
static gboolean static gboolean
gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter, gst_rtp_base_depayload_handle_event (GstRTPBaseDepayload * filter,
GstEvent * event) GstEvent * event)
{ {
gboolean res = TRUE; gboolean res = TRUE;
@ -398,7 +398,7 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
gst_event_parse_caps (event, &caps); gst_event_parse_caps (event, &caps);
res = gst_base_rtp_depayload_setcaps (filter, caps); res = gst_rtp_base_depayload_setcaps (filter, caps);
forward = FALSE; forward = FALSE;
break; break;
} }
@ -412,9 +412,9 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
} }
case GST_EVENT_CUSTOM_DOWNSTREAM: case GST_EVENT_CUSTOM_DOWNSTREAM:
{ {
GstBaseRTPDepayloadClass *bclass; GstRTPBaseDepayloadClass *bclass;
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
if (gst_event_has_name (event, "GstRTPPacketLost")) { if (gst_event_has_name (event, "GstRTPPacketLost")) {
/* we get this event from the jitterbuffer when it considers a packet as /* we get this event from the jitterbuffer when it considers a packet as
@ -446,19 +446,19 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
} }
static gboolean static gboolean
gst_base_rtp_depayload_handle_sink_event (GstPad * pad, GstEvent * event) gst_rtp_base_depayload_handle_sink_event (GstPad * pad, GstEvent * event)
{ {
gboolean res = FALSE; gboolean res = FALSE;
GstBaseRTPDepayload *filter; GstRTPBaseDepayload *filter;
GstBaseRTPDepayloadClass *bclass; GstRTPBaseDepayloadClass *bclass;
filter = GST_BASE_RTP_DEPAYLOAD (gst_pad_get_parent (pad)); filter = GST_RTP_BASE_DEPAYLOAD (gst_pad_get_parent (pad));
if (G_UNLIKELY (filter == NULL)) { if (G_UNLIKELY (filter == NULL)) {
gst_event_unref (event); gst_event_unref (event);
return FALSE; return FALSE;
} }
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
if (bclass->handle_event) if (bclass->handle_event)
res = bclass->handle_event (filter, event); res = bclass->handle_event (filter, event);
else else
@ -469,12 +469,12 @@ gst_base_rtp_depayload_handle_sink_event (GstPad * pad, GstEvent * event)
} }
static GstEvent * static GstEvent *
create_segment_event (GstBaseRTPDepayload * filter, gboolean update, create_segment_event (GstRTPBaseDepayload * filter, gboolean update,
GstClockTime position) GstClockTime position)
{ {
GstEvent *event; GstEvent *event;
GstClockTime stop; GstClockTime stop;
GstBaseRTPDepayloadPrivate *priv; GstRTPBaseDepayloadPrivate *priv;
GstSegment segment; GstSegment segment;
priv = filter->priv; priv = filter->priv;
@ -499,15 +499,15 @@ create_segment_event (GstBaseRTPDepayload * filter, gboolean update,
typedef struct typedef struct
{ {
GstBaseRTPDepayload *depayload; GstRTPBaseDepayload *depayload;
GstBaseRTPDepayloadClass *bclass; GstRTPBaseDepayloadClass *bclass;
} 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; GstRTPBaseDepayload *depayload = data->depayload;
GstBaseRTPDepayloadPrivate *priv = depayload->priv; GstRTPBaseDepayloadPrivate *priv = depayload->priv;
GstClockTime pts, dts, duration; GstClockTime pts, dts, duration;
*buffer = gst_buffer_make_writable (*buffer); *buffer = gst_buffer_make_writable (*buffer);
@ -540,13 +540,13 @@ set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
} }
static GstFlowReturn static GstFlowReturn
gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter, gst_rtp_base_depayload_prepare_push (GstRTPBaseDepayload * filter,
gboolean is_list, gpointer obj) gboolean is_list, gpointer obj)
{ {
HeaderData data; HeaderData data;
data.depayload = filter; data.depayload = filter;
data.bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter); data.bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
if (is_list) { if (is_list) {
GstBufferList **blist = obj; GstBufferList **blist = obj;
@ -572,8 +572,8 @@ gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
} }
/** /**
* gst_base_rtp_depayload_push: * gst_rtp_base_depayload_push:
* @filter: a #GstBaseRTPDepayload * @filter: a #GstRTPBaseDepayload
* @out_buf: a #GstBuffer * @out_buf: a #GstBuffer
* *
* 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
@ -585,11 +585,11 @@ gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
* Returns: a #GstFlowReturn. * Returns: a #GstFlowReturn.
*/ */
GstFlowReturn GstFlowReturn
gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * out_buf) gst_rtp_base_depayload_push (GstRTPBaseDepayload * filter, GstBuffer * out_buf)
{ {
GstFlowReturn res; GstFlowReturn res;
res = gst_base_rtp_depayload_prepare_push (filter, FALSE, &out_buf); res = gst_rtp_base_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);
@ -600,8 +600,8 @@ gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * out_buf)
} }
/** /**
* gst_base_rtp_depayload_push_list: * gst_rtp_base_depayload_push_list:
* @filter: a #GstBaseRTPDepayload * @filter: a #GstRTPBaseDepayload
* @out_list: a #GstBufferList * @out_list: a #GstBufferList
* *
* Push @out_list to the peer of @filter. This function takes ownership of * Push @out_list to the peer of @filter. This function takes ownership of
@ -612,12 +612,12 @@ gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * out_buf)
* Since: 0.10.32 * Since: 0.10.32
*/ */
GstFlowReturn GstFlowReturn
gst_base_rtp_depayload_push_list (GstBaseRTPDepayload * filter, gst_rtp_base_depayload_push_list (GstRTPBaseDepayload * filter,
GstBufferList * out_list) GstBufferList * out_list)
{ {
GstFlowReturn res; GstFlowReturn res;
res = gst_base_rtp_depayload_prepare_push (filter, TRUE, &out_list); res = gst_rtp_base_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);
@ -630,7 +630,7 @@ gst_base_rtp_depayload_push_list (GstBaseRTPDepayload * filter,
/* convert the PacketLost event form a jitterbuffer to a segment update. /* convert the PacketLost event form a jitterbuffer to a segment update.
* subclasses can override this. */ * subclasses can override this. */
static gboolean static gboolean
gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter, gst_rtp_base_depayload_packet_lost (GstRTPBaseDepayload * filter,
GstEvent * event) GstEvent * event)
{ {
GstClockTime timestamp, duration, position; GstClockTime timestamp, duration, position;
@ -657,14 +657,14 @@ gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter,
} }
static GstStateChangeReturn static GstStateChangeReturn
gst_base_rtp_depayload_change_state (GstElement * element, gst_rtp_base_depayload_change_state (GstElement * element,
GstStateChange transition) GstStateChange transition)
{ {
GstBaseRTPDepayload *filter; GstRTPBaseDepayload *filter;
GstBaseRTPDepayloadPrivate *priv; GstRTPBaseDepayloadPrivate *priv;
GstStateChangeReturn ret; GstStateChangeReturn ret;
filter = GST_BASE_RTP_DEPAYLOAD (element); filter = GST_RTP_BASE_DEPAYLOAD (element);
priv = filter->priv; priv = filter->priv;
switch (transition) { switch (transition) {
@ -702,7 +702,7 @@ gst_base_rtp_depayload_change_state (GstElement * element,
} }
static void static void
gst_base_rtp_depayload_set_property (GObject * object, guint prop_id, gst_rtp_base_depayload_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
switch (prop_id) { switch (prop_id) {
@ -713,7 +713,7 @@ gst_base_rtp_depayload_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_base_rtp_depayload_get_property (GObject * object, guint prop_id, gst_rtp_base_depayload_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
switch (prop_id) { switch (prop_id) {

View file

@ -17,34 +17,34 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_BASE_RTP_DEPAYLOAD_H__ #ifndef __GST_RTP_BASE_DEPAYLOAD_H__
#define __GST_BASE_RTP_DEPAYLOAD_H__ #define __GST_RTP_BASE_DEPAYLOAD_H__
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/rtp/gstrtpbuffer.h> #include <gst/rtp/gstrtpbuffer.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_BASE_RTP_DEPAYLOAD (gst_base_rtp_depayload_get_type()) #define GST_TYPE_RTP_BASE_DEPAYLOAD (gst_rtp_base_depayload_get_type())
#define GST_BASE_RTP_DEPAYLOAD(obj) \ #define GST_RTP_BASE_DEPAYLOAD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_DEPAYLOAD,GstBaseRTPDepayload)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayload))
#define GST_BASE_RTP_DEPAYLOAD_CLASS(klass) \ #define GST_RTP_BASE_DEPAYLOAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_RTP_DEPAYLOAD,GstBaseRTPDepayloadClass)) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayloadClass))
#define GST_BASE_RTP_DEPAYLOAD_GET_CLASS(obj) \ #define GST_RTP_BASE_DEPAYLOAD_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_BASE_RTP_DEPAYLOAD,GstBaseRTPDepayloadClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayloadClass))
#define GST_IS_BASE_RTP_DEPAYLOAD(obj) \ #define GST_IS_RTP_BASE_DEPAYLOAD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_DEPAYLOAD)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_DEPAYLOAD))
#define GST_IS_BASE_RTP_DEPAYLOAD_CLASS(klass) \ #define GST_IS_RTP_BASE_DEPAYLOAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_DEPAYLOAD)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_DEPAYLOAD))
#define GST_BASE_RTP_DEPAYLOAD_SINKPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->sinkpad) #define GST_RTP_BASE_DEPAYLOAD_SINKPAD(depayload) (GST_RTP_BASE_DEPAYLOAD (depayload)->sinkpad)
#define GST_BASE_RTP_DEPAYLOAD_SRCPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->srcpad) #define GST_RTP_BASE_DEPAYLOAD_SRCPAD(depayload) (GST_RTP_BASE_DEPAYLOAD (depayload)->srcpad)
typedef struct _GstBaseRTPDepayload GstBaseRTPDepayload; typedef struct _GstRTPBaseDepayload GstRTPBaseDepayload;
typedef struct _GstBaseRTPDepayloadClass GstBaseRTPDepayloadClass; typedef struct _GstRTPBaseDepayloadClass GstRTPBaseDepayloadClass;
typedef struct _GstBaseRTPDepayloadPrivate GstBaseRTPDepayloadPrivate; typedef struct _GstRTPBaseDepayloadPrivate GstRTPBaseDepayloadPrivate;
struct _GstBaseRTPDepayload struct _GstRTPBaseDepayload
{ {
GstElement parent; GstElement parent;
@ -57,57 +57,55 @@ struct _GstBaseRTPDepayload
gboolean need_newsegment; gboolean need_newsegment;
/*< private >*/ /*< private >*/
GstBaseRTPDepayloadPrivate *priv; GstRTPBaseDepayloadPrivate *priv;
gpointer _gst_reserved[GST_PADDING-1]; gpointer _gst_reserved[GST_PADDING-1];
}; };
/** /**
* GstBaseRTPDepayloadClass: * GstRTPBaseDepayloadClass:
* @parent_class: the parent class * @parent_class: the parent class
* @set_caps: configure the depayloader * @set_caps: configure the depayloader
* @add_to_queue: (deprecated)
* @process: process incoming rtp packets * @process: process incoming rtp packets
* @set_gst_timestamp: convert from RTP timestamp to GST timestamp
* @packet_lost: signal the depayloader about packet loss * @packet_lost: signal the depayloader about packet loss
* @handle_event: custom event handling * @handle_event: custom event handling
* *
* Base class for audio RTP payloader. * Base class for audio RTP payloader.
*/ */
struct _GstBaseRTPDepayloadClass struct _GstRTPBaseDepayloadClass
{ {
GstElementClass parent_class; GstElementClass parent_class;
/* virtuals, inform the subclass of the caps. */ /* virtuals, inform the subclass of the caps. */
gboolean (*set_caps) (GstBaseRTPDepayload *filter, GstCaps *caps); gboolean (*set_caps) (GstRTPBaseDepayload *filter, GstCaps *caps);
/* pure virtual function, child must use this to process incoming /* pure virtual function, child must use this to process incoming
* rtp packets. If the child returns a buffer without a valid timestamp, * rtp packets. If the child returns a buffer without a valid timestamp,
* the timestamp of @in will be applied to the result buffer and the * the timestamp of @in will be applied to the result buffer and the
* buffer will be pushed. If this function returns %NULL, nothing is * buffer will be pushed. If this function returns %NULL, nothing is
* pushed. */ * pushed. */
GstBuffer * (*process) (GstBaseRTPDepayload *base, GstBuffer *in); GstBuffer * (*process) (GstRTPBaseDepayload *base, GstBuffer *in);
/* 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. */
gboolean (*packet_lost) (GstBaseRTPDepayload *filter, GstEvent *event); gboolean (*packet_lost) (GstRTPBaseDepayload *filter, GstEvent *event);
/* the default implementation does the default actions for events but /* the default implementation does the default actions for events but
* implementation can override. * implementation can override.
* Since: 0.10.32 */ * Since: 0.10.32 */
gboolean (*handle_event) (GstBaseRTPDepayload * filter, GstEvent * event); gboolean (*handle_event) (GstRTPBaseDepayload * filter, GstEvent * event);
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING-2]; gpointer _gst_reserved[GST_PADDING-2];
}; };
GType gst_base_rtp_depayload_get_type (void); GType gst_rtp_base_depayload_get_type (void);
GstFlowReturn gst_base_rtp_depayload_push (GstBaseRTPDepayload *filter, GstBuffer *out_buf); GstFlowReturn gst_rtp_base_depayload_push (GstRTPBaseDepayload *filter, GstBuffer *out_buf);
GstFlowReturn gst_base_rtp_depayload_push_list (GstBaseRTPDepayload *filter, GstBufferList *out_list); GstFlowReturn gst_rtp_base_depayload_push_list (GstRTPBaseDepayload *filter, GstBufferList *out_list);
G_END_DECLS G_END_DECLS
#endif /* __GST_BASE_RTP_DEPAYLOAD_H__ */ #endif /* __GST_RTP_BASE_DEPAYLOAD_H__ */

View file

@ -32,10 +32,10 @@
GST_DEBUG_CATEGORY_STATIC (basertppayload_debug); GST_DEBUG_CATEGORY_STATIC (basertppayload_debug);
#define GST_CAT_DEFAULT (basertppayload_debug) #define GST_CAT_DEFAULT (basertppayload_debug)
#define GST_BASE_RTP_PAYLOAD_GET_PRIVATE(obj) \ #define GST_RTP_BASE_PAYLOAD_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_RTP_PAYLOAD, GstBaseRTPPayloadPrivate)) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_PAYLOAD, GstRTPBasePayloadPrivate))
struct _GstBaseRTPPayloadPrivate struct _GstRTPBasePayloadPrivate
{ {
gboolean ts_offset_random; gboolean ts_offset_random;
gboolean seqnum_offset_random; gboolean seqnum_offset_random;
@ -51,7 +51,7 @@ struct _GstBaseRTPPayloadPrivate
gint64 caps_max_ptime; gint64 caps_max_ptime;
}; };
/* BaseRTPPayload signals and args */ /* RTPBasePayload signals and args */
enum enum
{ {
/* FILL ME */ /* FILL ME */
@ -91,27 +91,27 @@ enum
PROP_LAST PROP_LAST
}; };
static void gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass); static void gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass);
static void gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, static void gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload,
gpointer g_class); gpointer g_class);
static void gst_base_rtp_payload_finalize (GObject * object); static void gst_rtp_base_payload_finalize (GObject * object);
static GstCaps *gst_base_rtp_payload_sink_getcaps (GstPad * pad, static GstCaps *gst_rtp_base_payload_sink_getcaps (GstPad * pad,
GstCaps * filter); GstCaps * filter);
static gboolean gst_base_rtp_payload_event_default (GstBaseRTPPayload * static gboolean gst_rtp_base_payload_event_default (GstRTPBasePayload *
basertppayload, GstEvent * event); basertppayload, GstEvent * event);
static gboolean gst_base_rtp_payload_event (GstPad * pad, GstEvent * event); static gboolean gst_rtp_base_payload_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_base_rtp_payload_chain (GstPad * pad, static GstFlowReturn gst_rtp_base_payload_chain (GstPad * pad,
GstBuffer * buffer); GstBuffer * buffer);
static GstCaps *gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * static GstCaps *gst_rtp_base_payload_getcaps_default (GstRTPBasePayload *
basertppayload, GstPad * pad, GstCaps * filter); basertppayload, GstPad * pad, GstCaps * filter);
static void gst_base_rtp_payload_set_property (GObject * object, guint prop_id, static void gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_base_rtp_payload_get_property (GObject * object, guint prop_id, static void gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static GstStateChangeReturn gst_base_rtp_payload_change_state (GstElement * static GstStateChangeReturn gst_rtp_base_payload_change_state (GstElement *
element, GstStateChange transition); element, GstStateChange transition);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
@ -119,32 +119,32 @@ 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_base_rtp_payload_get_type (void) gst_rtp_base_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 (GstRTPBasePayloadClass),
NULL, NULL,
NULL, NULL,
(GClassInitFunc) gst_base_rtp_payload_class_init, (GClassInitFunc) gst_rtp_base_payload_class_init,
NULL, NULL,
NULL, NULL,
sizeof (GstBaseRTPPayload), sizeof (GstRTPBasePayload),
0, 0,
(GInstanceInitFunc) gst_base_rtp_payload_init, (GInstanceInitFunc) gst_rtp_base_payload_init,
}; };
g_once_init_leave ((gsize *) & basertppayload_type, g_once_init_leave ((gsize *) & basertppayload_type,
g_type_register_static (GST_TYPE_ELEMENT, "GstBaseRTPPayload", g_type_register_static (GST_TYPE_ELEMENT, "GstRTPBasePayload",
&basertppayload_info, G_TYPE_FLAG_ABSTRACT)); &basertppayload_info, G_TYPE_FLAG_ABSTRACT));
} }
return basertppayload_type; return basertppayload_type;
} }
static void static void
gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass) gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -152,14 +152,14 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
g_type_class_add_private (klass, sizeof (GstBaseRTPPayloadPrivate)); g_type_class_add_private (klass, sizeof (GstRTPBasePayloadPrivate));
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gst_base_rtp_payload_finalize; gobject_class->finalize = gst_rtp_base_payload_finalize;
gobject_class->set_property = gst_base_rtp_payload_set_property; gobject_class->set_property = gst_rtp_base_payload_set_property;
gobject_class->get_property = gst_base_rtp_payload_get_property; gobject_class->get_property = gst_rtp_base_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",
@ -190,7 +190,7 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
-1, G_MAXINT64, DEFAULT_MAX_PTIME, -1, G_MAXINT64, DEFAULT_MAX_PTIME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/** /**
* GstBaseRTPAudioPayload:min-ptime: * GstRTPBaseAudioPayload:min-ptime:
* *
* Minimum duration of the packet data in ns (can't go above MTU) * Minimum duration of the packet data in ns (can't go above MTU)
* *
@ -212,7 +212,7 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
0, G_MAXUINT16, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); 0, G_MAXUINT16, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/** /**
* GstBaseRTPAudioPayload:perfect-rtptime: * GstRTPBaseAudioPayload:perfect-rtptime:
* *
* Try to use the offset fields to generate perfect RTP timestamps. when this * Try to use the offset fields to generate perfect RTP timestamps. when this
* option is disabled, RTP timestamps are generated from the GStreamer * option is disabled, RTP timestamps are generated from the GStreamer
@ -226,7 +226,7 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
"Generate perfect RTP timestamps when possible", "Generate perfect RTP timestamps when possible",
DEFAULT_PERFECT_RTPTIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PERFECT_RTPTIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/** /**
* GstBaseRTPAudioPayload:ptime-multiple: * GstRTPBaseAudioPayload:ptime-multiple:
* *
* Force buffers to be multiples of this duration in ns (0 disables) * Force buffers to be multiples of this duration in ns (0 disables)
* *
@ -238,23 +238,23 @@ gst_base_rtp_payload_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_base_rtp_payload_change_state; gstelement_class->change_state = gst_rtp_base_payload_change_state;
klass->get_caps = gst_base_rtp_payload_getcaps_default; klass->get_caps = gst_rtp_base_payload_getcaps_default;
klass->handle_event = gst_base_rtp_payload_event_default; klass->handle_event = gst_rtp_base_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_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, gpointer g_class) gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload, gpointer g_class)
{ {
GstPadTemplate *templ; GstPadTemplate *templ;
GstBaseRTPPayloadPrivate *priv; GstRTPBasePayloadPrivate *priv;
basertppayload->priv = priv = basertppayload->priv = priv =
GST_BASE_RTP_PAYLOAD_GET_PRIVATE (basertppayload); GST_RTP_BASE_PAYLOAD_GET_PRIVATE (basertppayload);
templ = templ =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src"); gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
@ -269,11 +269,11 @@ gst_base_rtp_payload_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_base_rtp_payload_sink_getcaps); gst_rtp_base_payload_sink_getcaps);
gst_pad_set_event_function (basertppayload->sinkpad, gst_pad_set_event_function (basertppayload->sinkpad,
gst_base_rtp_payload_event); gst_rtp_base_payload_event);
gst_pad_set_chain_function (basertppayload->sinkpad, gst_pad_set_chain_function (basertppayload->sinkpad,
gst_base_rtp_payload_chain); gst_rtp_base_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;
@ -302,11 +302,11 @@ gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
} }
static void static void
gst_base_rtp_payload_finalize (GObject * object) gst_rtp_base_payload_finalize (GObject * object)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
basertppayload = GST_BASE_RTP_PAYLOAD (object); basertppayload = GST_RTP_BASE_PAYLOAD (object);
g_free (basertppayload->media); g_free (basertppayload->media);
basertppayload->media = NULL; basertppayload->media = NULL;
@ -317,7 +317,7 @@ gst_base_rtp_payload_finalize (GObject * object)
} }
static GstCaps * static GstCaps *
gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * basertppayload, gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * basertppayload,
GstPad * pad, GstCaps * filter) GstPad * pad, GstCaps * filter)
{ {
GstCaps *caps; GstCaps *caps;
@ -336,16 +336,16 @@ gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * basertppayload,
} }
static GstCaps * static GstCaps *
gst_base_rtp_payload_sink_getcaps (GstPad * pad, GstCaps * filter) gst_rtp_base_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
GstBaseRTPPayloadClass *basertppayload_class; GstRTPBasePayloadClass *basertppayload_class;
GstCaps *caps = NULL; GstCaps *caps = NULL;
GST_DEBUG_OBJECT (pad, "getting caps"); GST_DEBUG_OBJECT (pad, "getting caps");
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad)); basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload); basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
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);
@ -356,7 +356,7 @@ gst_base_rtp_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
} }
static gboolean static gboolean
gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload, gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
GstEvent * event) GstEvent * event)
{ {
gboolean res = FALSE; gboolean res = FALSE;
@ -371,13 +371,13 @@ gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
break; break;
case GST_EVENT_CAPS: case GST_EVENT_CAPS:
{ {
GstBaseRTPPayloadClass *basertppayload_class; GstRTPBasePayloadClass *basertppayload_class;
GstCaps *caps; GstCaps *caps;
gst_event_parse_caps (event, &caps); gst_event_parse_caps (event, &caps);
GST_DEBUG_OBJECT (basertppayload, "setting caps %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (basertppayload, "setting caps %" GST_PTR_FORMAT, caps);
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload); basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
if (basertppayload_class->set_caps) if (basertppayload_class->set_caps)
res = basertppayload_class->set_caps (basertppayload, caps); res = basertppayload_class->set_caps (basertppayload, caps);
@ -406,19 +406,19 @@ gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
} }
static gboolean static gboolean
gst_base_rtp_payload_event (GstPad * pad, GstEvent * event) gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
GstBaseRTPPayloadClass *basertppayload_class; GstRTPBasePayloadClass *basertppayload_class;
gboolean res = FALSE; gboolean res = FALSE;
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad)); basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
if (G_UNLIKELY (basertppayload == NULL)) { if (G_UNLIKELY (basertppayload == NULL)) {
gst_event_unref (event); gst_event_unref (event);
return FALSE; return FALSE;
} }
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload); basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
if (basertppayload_class->handle_event) if (basertppayload_class->handle_event)
res = basertppayload_class->handle_event (basertppayload, event); res = basertppayload_class->handle_event (basertppayload, event);
@ -432,14 +432,14 @@ gst_base_rtp_payload_event (GstPad * pad, GstEvent * event)
static GstFlowReturn static GstFlowReturn
gst_base_rtp_payload_chain (GstPad * pad, GstBuffer * buffer) gst_rtp_base_payload_chain (GstPad * pad, GstBuffer * buffer)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
GstBaseRTPPayloadClass *basertppayload_class; GstRTPBasePayloadClass *basertppayload_class;
GstFlowReturn ret; GstFlowReturn ret;
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad)); basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload); basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
if (!basertppayload_class->handle_buffer) if (!basertppayload_class->handle_buffer)
goto no_function; goto no_function;
@ -462,8 +462,8 @@ no_function:
} }
/** /**
* gst_base_rtp_payload_set_options: * gst_rtp_base_payload_set_options:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* @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
* @encoding_name: the encoding name * @encoding_name: the encoding name
@ -471,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_base_rtp_payload_push() or gst_base_rtp_payload_set_outcaps(). * gst_rtp_base_payload_push() or gst_rtp_base_payload_set_outcaps().
*/ */
void void
gst_base_rtp_payload_set_options (GstBaseRTPPayload * payload, gst_rtp_base_payload_set_options (GstRTPBasePayload * 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)
{ {
@ -499,7 +499,7 @@ copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
} }
static void static void
update_max_ptime (GstBaseRTPPayload * basertppayload) update_max_ptime (GstRTPBasePayload * basertppayload)
{ {
if (basertppayload->priv->caps_max_ptime != -1 && if (basertppayload->priv->caps_max_ptime != -1 &&
basertppayload->priv->prop_max_ptime != -1) basertppayload->priv->prop_max_ptime != -1)
@ -514,8 +514,8 @@ update_max_ptime (GstBaseRTPPayload * basertppayload)
} }
/** /**
* gst_base_rtp_payload_set_outcaps: * gst_rtp_base_payload_set_outcaps:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* @fieldname: the first field name or %NULL * @fieldname: the first field name or %NULL
* @...: field values * @...: field values
* *
@ -527,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_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload, gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload,
const gchar * fieldname, ...) const gchar * fieldname, ...)
{ {
GstCaps *srccaps, *peercaps; GstCaps *srccaps, *peercaps;
@ -560,7 +560,7 @@ gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
if (peercaps == NULL) { if (peercaps == NULL) {
/* no peer caps, just add the other properties */ /* no peer caps, just add the other properties */
gst_caps_set_simple (srccaps, gst_caps_set_simple (srccaps,
"payload", G_TYPE_INT, GST_BASE_RTP_PAYLOAD_PT (payload), "payload", G_TYPE_INT, GST_RTP_BASE_PAYLOAD_PT (payload),
"ssrc", G_TYPE_UINT, payload->current_ssrc, "ssrc", G_TYPE_UINT, payload->current_ssrc,
"timestamp-offset", G_TYPE_UINT, payload->ts_base, "timestamp-offset", G_TYPE_UINT, payload->ts_base,
"seqnum-offset", G_TYPE_UINT, payload->seqnum_base, NULL); "seqnum-offset", G_TYPE_UINT, payload->seqnum_base, NULL);
@ -597,18 +597,18 @@ gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
if (gst_structure_get_int (s, "payload", &pt)) { if (gst_structure_get_int (s, "payload", &pt)) {
/* use peer pt */ /* use peer pt */
GST_BASE_RTP_PAYLOAD_PT (payload) = pt; GST_RTP_BASE_PAYLOAD_PT (payload) = pt;
GST_LOG_OBJECT (payload, "using peer pt %d", pt); GST_LOG_OBJECT (payload, "using peer pt %d", pt);
} else { } else {
if (gst_structure_has_field (s, "payload")) { if (gst_structure_has_field (s, "payload")) {
/* can only fixate if there is a field */ /* can only fixate if there is a field */
gst_structure_fixate_field_nearest_int (s, "payload", gst_structure_fixate_field_nearest_int (s, "payload",
GST_BASE_RTP_PAYLOAD_PT (payload)); GST_RTP_BASE_PAYLOAD_PT (payload));
gst_structure_get_int (s, "payload", &pt); gst_structure_get_int (s, "payload", &pt);
GST_LOG_OBJECT (payload, "using peer pt %d", pt); GST_LOG_OBJECT (payload, "using peer pt %d", pt);
} else { } else {
/* no pt field, use the internal pt */ /* no pt field, use the internal pt */
pt = GST_BASE_RTP_PAYLOAD_PT (payload); pt = GST_RTP_BASE_PAYLOAD_PT (payload);
gst_structure_set (s, "payload", G_TYPE_INT, pt, NULL); gst_structure_set (s, "payload", G_TYPE_INT, pt, NULL);
GST_LOG_OBJECT (payload, "using internal pt %d", pt); GST_LOG_OBJECT (payload, "using internal pt %d", pt);
} }
@ -664,15 +664,15 @@ gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
update_max_ptime (payload); update_max_ptime (payload);
res = gst_pad_set_caps (GST_BASE_RTP_PAYLOAD_SRCPAD (payload), srccaps); res = gst_pad_set_caps (GST_RTP_BASE_PAYLOAD_SRCPAD (payload), srccaps);
gst_caps_unref (srccaps); gst_caps_unref (srccaps);
return res; return res;
} }
/** /**
* gst_base_rtp_payload_is_filled: * gst_rtp_base_payload_is_filled:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* @size: the size of the packet * @size: the size of the packet
* @duration: the duration of the packet * @duration: the duration of the packet
* *
@ -683,7 +683,7 @@ gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
* configured MTU or max_ptime. * configured MTU or max_ptime.
*/ */
gboolean gboolean
gst_base_rtp_payload_is_filled (GstBaseRTPPayload * payload, gst_rtp_base_payload_is_filled (GstRTPBasePayload * payload,
guint size, GstClockTime duration) guint size, GstClockTime duration)
{ {
if (size > payload->mtu) if (size > payload->mtu)
@ -697,7 +697,7 @@ gst_base_rtp_payload_is_filled (GstBaseRTPPayload * payload,
typedef struct typedef struct
{ {
GstBaseRTPPayload *payload; GstRTPBasePayload *payload;
guint32 ssrc; guint32 ssrc;
guint16 seqnum; guint16 seqnum;
guint8 pt; guint8 pt;
@ -741,10 +741,10 @@ 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_base_rtp_payload_prepare_push (GstBaseRTPPayload * payload, gst_rtp_base_payload_prepare_push (GstRTPBasePayload * payload,
gpointer obj, gboolean is_list) gpointer obj, gboolean is_list)
{ {
GstBaseRTPPayloadPrivate *priv; GstRTPBasePayloadPrivate *priv;
HeaderData data; HeaderData data;
if (payload->clock_rate == 0) if (payload->clock_rate == 0)
@ -844,8 +844,8 @@ no_rate:
} }
/** /**
* gst_base_rtp_payload_push_list: * gst_rtp_base_payload_push_list:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* @list: a #GstBufferList * @list: a #GstBufferList
* *
* Push @list to the peer element of the payloader. The SSRC, payload type, * Push @list to the peer element of the payloader. The SSRC, payload type,
@ -858,12 +858,12 @@ no_rate:
* Since: 0.10.24 * Since: 0.10.24
*/ */
GstFlowReturn GstFlowReturn
gst_base_rtp_payload_push_list (GstBaseRTPPayload * payload, gst_rtp_base_payload_push_list (GstRTPBasePayload * payload,
GstBufferList * list) GstBufferList * list)
{ {
GstFlowReturn res; GstFlowReturn res;
res = gst_base_rtp_payload_prepare_push (payload, list, TRUE); res = gst_rtp_base_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);
@ -874,8 +874,8 @@ gst_base_rtp_payload_push_list (GstBaseRTPPayload * payload,
} }
/** /**
* gst_base_rtp_payload_push: * gst_rtp_base_payload_push:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* @buffer: a #GstBuffer * @buffer: a #GstBuffer
* *
* Push @buffer to the peer element of the payloader. The SSRC, payload type, * Push @buffer to the peer element of the payloader. The SSRC, payload type,
@ -886,11 +886,11 @@ gst_base_rtp_payload_push_list (GstBaseRTPPayload * payload,
* Returns: a #GstFlowReturn. * Returns: a #GstFlowReturn.
*/ */
GstFlowReturn GstFlowReturn
gst_base_rtp_payload_push (GstBaseRTPPayload * payload, GstBuffer * buffer) gst_rtp_base_payload_push (GstRTPBasePayload * payload, GstBuffer * buffer)
{ {
GstFlowReturn res; GstFlowReturn res;
res = gst_base_rtp_payload_prepare_push (payload, buffer, FALSE); res = gst_rtp_base_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);
@ -901,14 +901,14 @@ gst_base_rtp_payload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
} }
static void static void
gst_base_rtp_payload_set_property (GObject * object, guint prop_id, gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
GstBaseRTPPayloadPrivate *priv; GstRTPBasePayloadPrivate *priv;
gint64 val; gint64 val;
basertppayload = GST_BASE_RTP_PAYLOAD (object); basertppayload = GST_RTP_BASE_PAYLOAD (object);
priv = basertppayload->priv; priv = basertppayload->priv;
switch (prop_id) { switch (prop_id) {
@ -955,13 +955,13 @@ gst_base_rtp_payload_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_base_rtp_payload_get_property (GObject * object, guint prop_id, gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
GstBaseRTPPayloadPrivate *priv; GstRTPBasePayloadPrivate *priv;
basertppayload = GST_BASE_RTP_PAYLOAD (object); basertppayload = GST_RTP_BASE_PAYLOAD (object);
priv = basertppayload->priv; priv = basertppayload->priv;
switch (prop_id) { switch (prop_id) {
@ -1014,14 +1014,14 @@ gst_base_rtp_payload_get_property (GObject * object, guint prop_id,
} }
static GstStateChangeReturn static GstStateChangeReturn
gst_base_rtp_payload_change_state (GstElement * element, gst_rtp_base_payload_change_state (GstElement * element,
GstStateChange transition) GstStateChange transition)
{ {
GstBaseRTPPayload *basertppayload; GstRTPBasePayload *basertppayload;
GstBaseRTPPayloadPrivate *priv; GstRTPBasePayloadPrivate *priv;
GstStateChangeReturn ret; GstStateChangeReturn ret;
basertppayload = GST_BASE_RTP_PAYLOAD (element); basertppayload = GST_RTP_BASE_PAYLOAD (element);
priv = basertppayload->priv; priv = basertppayload->priv;
switch (transition) { switch (transition) {

View file

@ -17,63 +17,63 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_BASE_RTP_PAYLOAD_H__ #ifndef __GST_RTP_BASE_PAYLOAD_H__
#define __GST_BASE_RTP_PAYLOAD_H__ #define __GST_RTP_BASE_PAYLOAD_H__
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_BASE_RTP_PAYLOAD \ #define GST_TYPE_RTP_BASE_PAYLOAD \
(gst_base_rtp_payload_get_type()) (gst_rtp_base_payload_get_type())
#define GST_BASE_RTP_PAYLOAD(obj) \ #define GST_RTP_BASE_PAYLOAD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayload)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_BASE_PAYLOAD,GstRTPBasePayload))
#define GST_BASE_RTP_PAYLOAD_CLASS(klass) \ #define GST_RTP_BASE_PAYLOAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayloadClass)) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_BASE_PAYLOAD,GstRTPBasePayloadClass))
#define GST_BASE_RTP_PAYLOAD_GET_CLASS(obj) \ #define GST_RTP_BASE_PAYLOAD_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASE_RTP_PAYLOAD, GstBaseRTPPayloadClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_BASE_PAYLOAD, GstRTPBasePayloadClass))
#define GST_IS_BASE_RTP_PAYLOAD(obj) \ #define GST_IS_RTP_BASE_PAYLOAD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_PAYLOAD)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_PAYLOAD))
#define GST_IS_BASE_RTP_PAYLOAD_CLASS(klass) \ #define GST_IS_RTP_BASE_PAYLOAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_PAYLOAD)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_PAYLOAD))
#define GST_BASE_RTP_PAYLOAD_CAST(obj) \ #define GST_RTP_BASE_PAYLOAD_CAST(obj) \
((GstBaseRTPPayload*)(obj)) ((GstRTPBasePayload*)(obj))
typedef struct _GstBaseRTPPayload GstBaseRTPPayload; typedef struct _GstRTPBasePayload GstRTPBasePayload;
typedef struct _GstBaseRTPPayloadPrivate GstBaseRTPPayloadPrivate; typedef struct _GstRTPBasePayloadPrivate GstRTPBasePayloadPrivate;
typedef struct _GstBaseRTPPayloadClass GstBaseRTPPayloadClass; typedef struct _GstRTPBasePayloadClass GstRTPBasePayloadClass;
/** /**
* GST_BASE_RTP_PAYLOAD_SINKPAD: * GST_RTP_BASE_PAYLOAD_SINKPAD:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* *
* Get access to the sinkpad of @payload. * Get access to the sinkpad of @payload.
*/ */
#define GST_BASE_RTP_PAYLOAD_SINKPAD(payload) (GST_BASE_RTP_PAYLOAD (payload)->sinkpad) #define GST_RTP_BASE_PAYLOAD_SINKPAD(payload) (GST_RTP_BASE_PAYLOAD (payload)->sinkpad)
/** /**
* GST_BASE_RTP_PAYLOAD_SRCPAD: * GST_RTP_BASE_PAYLOAD_SRCPAD:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* *
* Get access to the srcpad of @payload. * Get access to the srcpad of @payload.
*/ */
#define GST_BASE_RTP_PAYLOAD_SRCPAD(payload) (GST_BASE_RTP_PAYLOAD (payload)->srcpad) #define GST_RTP_BASE_PAYLOAD_SRCPAD(payload) (GST_RTP_BASE_PAYLOAD (payload)->srcpad)
/** /**
* GST_BASE_RTP_PAYLOAD_PT: * GST_RTP_BASE_PAYLOAD_PT:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* *
* Get access to the configured payload type of @payload. * Get access to the configured payload type of @payload.
*/ */
#define GST_BASE_RTP_PAYLOAD_PT(payload) (GST_BASE_RTP_PAYLOAD (payload)->pt) #define GST_RTP_BASE_PAYLOAD_PT(payload) (GST_RTP_BASE_PAYLOAD (payload)->pt)
/** /**
* GST_BASE_RTP_PAYLOAD_MTU: * GST_RTP_BASE_PAYLOAD_MTU:
* @payload: a #GstBaseRTPPayload * @payload: a #GstRTPBasePayload
* *
* Get access to the configured MTU of @payload. * Get access to the configured MTU of @payload.
*/ */
#define GST_BASE_RTP_PAYLOAD_MTU(payload) (GST_BASE_RTP_PAYLOAD (payload)->mtu) #define GST_RTP_BASE_PAYLOAD_MTU(payload) (GST_RTP_BASE_PAYLOAD (payload)->mtu)
struct _GstBaseRTPPayload struct _GstRTPBasePayload
{ {
GstElement element; GstElement element;
@ -104,7 +104,7 @@ struct _GstBaseRTPPayload
guint64 min_ptime; guint64 min_ptime;
/*< private >*/ /*< private >*/
GstBaseRTPPayloadPrivate *priv; GstRTPBasePayloadPrivate *priv;
union { union {
struct { struct {
@ -116,7 +116,7 @@ struct _GstBaseRTPPayload
}; };
/** /**
* GstBaseRTPPayloadClass: * GstRTPBasePayloadClass:
* @parent_class: the parent class * @parent_class: the parent class
* @set_caps: configure the payloader * @set_caps: configure the payloader
* @handle_buffer: process data * @handle_buffer: process data
@ -125,45 +125,45 @@ struct _GstBaseRTPPayload
* *
* Base class for audio RTP payloader. * Base class for audio RTP payloader.
*/ */
struct _GstBaseRTPPayloadClass struct _GstRTPBasePayloadClass
{ {
GstElementClass parent_class; GstElementClass parent_class;
/* query accepted caps */ /* query accepted caps */
GstCaps * (*get_caps) (GstBaseRTPPayload *payload, GstPad * pad, GstCaps * filter); GstCaps * (*get_caps) (GstRTPBasePayload *payload, GstPad * pad, GstCaps * filter);
/* 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) (GstRTPBasePayload *payload, GstCaps *caps);
/* handle a buffer, perform 0 or more gst_base_rtp_payload_push() on /* handle a buffer, perform 0 or more gst_rtp_base_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) (GstRTPBasePayload *payload,
GstBuffer *buffer); GstBuffer *buffer);
gboolean (*handle_event) (GstBaseRTPPayload *payload, GstEvent * event); gboolean (*handle_event) (GstRTPBasePayload *payload, GstEvent * event);
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_base_rtp_payload_get_type (void); GType gst_rtp_base_payload_get_type (void);
void gst_base_rtp_payload_set_options (GstBaseRTPPayload *payload, void gst_rtp_base_payload_set_options (GstRTPBasePayload *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_base_rtp_payload_set_outcaps (GstBaseRTPPayload *payload, gboolean gst_rtp_base_payload_set_outcaps (GstRTPBasePayload *payload,
const gchar *fieldname, ...); const gchar *fieldname, ...);
gboolean gst_base_rtp_payload_is_filled (GstBaseRTPPayload *payload, gboolean gst_rtp_base_payload_is_filled (GstRTPBasePayload *payload,
guint size, GstClockTime duration); guint size, GstClockTime duration);
GstFlowReturn gst_base_rtp_payload_push (GstBaseRTPPayload *payload, GstFlowReturn gst_rtp_base_payload_push (GstRTPBasePayload *payload,
GstBuffer *buffer); GstBuffer *buffer);
GstFlowReturn gst_base_rtp_payload_push_list (GstBaseRTPPayload *payload, GstFlowReturn gst_rtp_base_payload_push_list (GstRTPBasePayload *payload,
GstBufferList *list); GstBufferList *list);
G_END_DECLS G_END_DECLS
#endif /* __GST_BASE_RTP_PAYLOAD_H__ */ #endif /* __GST_RTP_BASE_PAYLOAD_H__ */

View file

@ -23,7 +23,7 @@
/** /**
* SECTION:gstrtcpbuffer * SECTION:gstrtcpbuffer
* @short_description: Helper methods for dealing with RTCP buffers * @short_description: Helper methods for dealing with RTCP buffers
* @see_also: #GstBaseRTPPayload, #GstBaseRTPDepayload, #gstrtpbuffer * @see_also: #GstRTPBasePayload, #GstRTPBaseDepayload, #gstrtpbuffer
* *
* Note: The API in this module is not yet declared stable. * Note: The API in this module is not yet declared stable.
* *

View file

@ -21,7 +21,7 @@
/** /**
* SECTION:gstrtpbuffer * SECTION:gstrtpbuffer
* @short_description: Helper methods for dealing with RTP buffers * @short_description: Helper methods for dealing with RTP buffers
* @see_also: #GstBaseRTPPayload, #GstBaseRTPDepayload, gstrtcpbuffer * @see_also: #GstRTPBasePayload, #GstRTPBaseDepayload, gstrtcpbuffer
* *
* <refsect2> * <refsect2>
* <para> * <para>