mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rename BaseRTP -> RTPBase
This commit is contained in:
parent
a3416bc11f
commit
ccf511a5d4
10 changed files with 482 additions and 485 deletions
|
@ -1125,52 +1125,51 @@ gst_riff_strh
|
|||
<SECTION>
|
||||
<FILE>gstbasertpaudiopayload</FILE>
|
||||
<INCLUDE>gst/rtp/gstbasertpaudiopayload.h</INCLUDE>
|
||||
GstBaseRTPAudioPayload
|
||||
GstBaseRTPAudioPayloadClass
|
||||
GstRTPBaseAudioPayload
|
||||
GstRTPBaseAudioPayloadClass
|
||||
|
||||
gst_base_rtp_audio_payload_set_frame_based
|
||||
gst_base_rtp_audio_payload_set_frame_options
|
||||
gst_base_rtp_audio_payload_set_sample_based
|
||||
gst_base_rtp_audio_payload_set_sample_options
|
||||
gst_base_rtp_audio_payload_get_adapter
|
||||
gst_base_rtp_audio_payload_push
|
||||
gst_base_rtp_audio_payload_flush
|
||||
gst_base_rtp_audio_payload_set_samplebits_options
|
||||
gst_rtp_base_audio_payload_set_frame_based
|
||||
gst_rtp_base_audio_payload_set_frame_options
|
||||
gst_rtp_base_audio_payload_set_sample_based
|
||||
gst_rtp_base_audio_payload_set_sample_options
|
||||
gst_rtp_base_audio_payload_get_adapter
|
||||
gst_rtp_base_audio_payload_push
|
||||
gst_rtp_base_audio_payload_flush
|
||||
gst_rtp_base_audio_payload_set_samplebits_options
|
||||
<SUBSECTION Standard>
|
||||
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD
|
||||
GST_BASE_RTP_AUDIO_PAYLOAD
|
||||
GST_BASE_RTP_AUDIO_PAYLOAD_CLASS
|
||||
GST_IS_BASE_RTP_AUDIO_PAYLOAD
|
||||
GST_IS_BASE_RTP_AUDIO_PAYLOAD_CLASS
|
||||
GST_BASE_RTP_AUDIO_PAYLOAD_CAST
|
||||
gst_base_rtp_audio_payload_get_type
|
||||
GstBaseRTPAudioPayloadPrivate
|
||||
GST_TYPE_RTP_BASE_AUDIO_PAYLOAD
|
||||
GST_RTP_BASE_AUDIO_PAYLOAD
|
||||
GST_RTP_BASE_AUDIO_PAYLOAD_CLASS
|
||||
GST_IS_RTP_BASE_AUDIO_PAYLOAD
|
||||
GST_IS_RTP_BASE_AUDIO_PAYLOAD_CLASS
|
||||
GST_RTP_BASE_AUDIO_PAYLOAD_CAST
|
||||
gst_rtp_base_audio_payload_get_type
|
||||
GstRTPBaseAudioPayloadPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gstbasertpdepayload</FILE>
|
||||
<INCLUDE>gst/rtp/gstbasertpdepayload.h</INCLUDE>
|
||||
GstBaseRTPDepayload
|
||||
GstBaseRTPDepayloadClass
|
||||
GstRTPBaseDepayload
|
||||
GstRTPBaseDepayloadClass
|
||||
|
||||
GST_BASE_RTP_DEPAYLOAD_SINKPAD
|
||||
GST_BASE_RTP_DEPAYLOAD_SRCPAD
|
||||
GST_RTP_BASE_DEPAYLOAD_SINKPAD
|
||||
GST_RTP_BASE_DEPAYLOAD_SRCPAD
|
||||
|
||||
gst_base_rtp_depayload_push
|
||||
gst_base_rtp_depayload_push_ts
|
||||
gst_base_rtp_depayload_push_list
|
||||
gst_rtp_base_depayload_push
|
||||
gst_rtp_base_depayload_push_list
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GstBaseRTPDepayloadPrivate
|
||||
GST_TYPE_BASE_RTP_DEPAYLOAD
|
||||
GST_BASE_RTP_DEPAYLOAD
|
||||
GST_BASE_RTP_DEPAYLOAD_CLASS
|
||||
GST_BASE_RTP_DEPAYLOAD_GET_CLASS
|
||||
GST_IS_BASE_RTP_DEPAYLOAD
|
||||
GST_IS_BASE_RTP_DEPAYLOAD_CLASS
|
||||
GST_BASE_RTP_PAYLOAD_CAST
|
||||
gst_base_rtp_depayload_get_type
|
||||
GstBaseRTPPayloadPrivate
|
||||
GstRTPBaseDepayloadPrivate
|
||||
GST_TYPE_RTP_BASE_DEPAYLOAD
|
||||
GST_RTP_BASE_DEPAYLOAD
|
||||
GST_RTP_BASE_DEPAYLOAD_CLASS
|
||||
GST_RTP_BASE_DEPAYLOAD_GET_CLASS
|
||||
GST_IS_RTP_BASE_DEPAYLOAD
|
||||
GST_IS_RTP_BASE_DEPAYLOAD_CLASS
|
||||
GST_RTP_BASE_PAYLOAD_CAST
|
||||
gst_rtp_base_depayload_get_type
|
||||
GstRTPBasePayloadPrivate
|
||||
|
||||
<SUBSECTION Private>
|
||||
QUEUE_LOCK_INIT
|
||||
|
@ -1182,27 +1181,27 @@ QUEUE_UNLOCK
|
|||
<SECTION>
|
||||
<FILE>gstbasertppayload</FILE>
|
||||
<INCLUDE>gst/rtp/gstbasertppayload.h</INCLUDE>
|
||||
GstBaseRTPPayload
|
||||
GstBaseRTPPayloadClass
|
||||
GstRTPBasePayload
|
||||
GstRTPBasePayloadClass
|
||||
|
||||
GST_BASE_RTP_PAYLOAD_MTU
|
||||
GST_BASE_RTP_PAYLOAD_PT
|
||||
GST_BASE_RTP_PAYLOAD_SINKPAD
|
||||
GST_BASE_RTP_PAYLOAD_SRCPAD
|
||||
GST_RTP_BASE_PAYLOAD_MTU
|
||||
GST_RTP_BASE_PAYLOAD_PT
|
||||
GST_RTP_BASE_PAYLOAD_SINKPAD
|
||||
GST_RTP_BASE_PAYLOAD_SRCPAD
|
||||
|
||||
gst_basertppayload_is_filled
|
||||
gst_basertppayload_push
|
||||
gst_basertppayload_push_list
|
||||
gst_basertppayload_set_options
|
||||
gst_basertppayload_set_outcaps
|
||||
gst_rtp_base_payload_is_filled
|
||||
gst_rtp_base_payload_push
|
||||
gst_rtp_base_payload_push_list
|
||||
gst_rtp_base_payload_set_options
|
||||
gst_rtp_base_payload_set_outcaps
|
||||
<SUBSECTION Standard>
|
||||
GST_TYPE_BASE_RTP_PAYLOAD
|
||||
GST_BASE_RTP_PAYLOAD
|
||||
GST_BASE_RTP_PAYLOAD_CLASS
|
||||
GST_BASE_RTP_PAYLOAD_GET_CLASS
|
||||
GST_IS_BASE_RTP_PAYLOAD
|
||||
GST_IS_BASE_RTP_PAYLOAD_CLASS
|
||||
gst_basertppayload_get_type
|
||||
GST_TYPE_RTP_BASE_PAYLOAD
|
||||
GST_RTP_BASE_PAYLOAD
|
||||
GST_RTP_BASE_PAYLOAD_CLASS
|
||||
GST_RTP_BASE_PAYLOAD_GET_CLASS
|
||||
GST_IS_RTP_BASE_PAYLOAD
|
||||
GST_IS_RTP_BASE_PAYLOAD_CLASS
|
||||
gst_rtp_base_payload_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
|
|
@ -49,11 +49,11 @@ gst_video_overlay_get_type
|
|||
|
||||
|
||||
#include <gst/rtp/gstbasertpdepayload.h>
|
||||
gst_base_rtp_depayload_get_type
|
||||
gst_rtp_base_depayload_get_type
|
||||
#include <gst/rtp/gstbasertppayload.h>
|
||||
gst_base_rtp_payload_get_type
|
||||
gst_rtp_base_payload_get_type
|
||||
#include <gst/rtp/gstbasertpaudiopayload.h>
|
||||
gst_base_rtp_audio_payload_get_type
|
||||
gst_rtp_base_audio_payload_get_type
|
||||
|
||||
|
||||
#include <gst/video/gstvideofilter.h>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* Provides a base class for audio RTP payloaders for frame or sample based
|
||||
* 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
|
||||
* 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
|
||||
|
@ -40,16 +40,16 @@
|
|||
* <title>Usage</title>
|
||||
* <para>
|
||||
* To use this base class, your child element needs to call either
|
||||
* gst_base_rtp_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_frame_based() or
|
||||
* 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
|
||||
* gst_base_rtp_audio_payload_set_frame_options(),
|
||||
* gst_base_rtp_audio_payload_set_sample_options() or
|
||||
* gst_base_rtp_audio_payload_set_samplebits_options. Since
|
||||
* GstBaseRTPAudioPayload derives from GstBaseRTPPayload, the child element
|
||||
* gst_rtp_base_audio_payload_set_frame_options(),
|
||||
* gst_rtp_base_audio_payload_set_sample_options() or
|
||||
* gst_rtp_base_audio_payload_set_samplebits_options. Since
|
||||
* GstRTPBaseAudioPayload derives from GstRTPBasePayload, the child element
|
||||
* 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
|
||||
* specific to GstBaseRTPAudioPayload.
|
||||
* specific to GstRTPBaseAudioPayload.
|
||||
* </para>
|
||||
* </refsect2>
|
||||
*/
|
||||
|
@ -78,16 +78,16 @@ enum
|
|||
};
|
||||
|
||||
/* function to convert bytes to a time */
|
||||
typedef GstClockTime (*GetBytesToTimeFunc) (GstBaseRTPAudioPayload * payload,
|
||||
typedef GstClockTime (*GetBytesToTimeFunc) (GstRTPBaseAudioPayload * payload,
|
||||
guint64 bytes);
|
||||
/* function to convert bytes to a RTP time */
|
||||
typedef guint32 (*GetBytesToRTPTimeFunc) (GstBaseRTPAudioPayload * payload,
|
||||
typedef guint32 (*GetBytesToRTPTimeFunc) (GstRTPBaseAudioPayload * payload,
|
||||
guint64 bytes);
|
||||
/* function to convert time to bytes */
|
||||
typedef guint64 (*GetTimeToBytesFunc) (GstBaseRTPAudioPayload * payload,
|
||||
typedef guint64 (*GetTimeToBytesFunc) (GstRTPBaseAudioPayload * payload,
|
||||
GstClockTime time);
|
||||
|
||||
struct _GstBaseRTPAudioPayloadPrivate
|
||||
struct _GstRTPBaseAudioPayloadPrivate
|
||||
{
|
||||
GetBytesToTimeFunc bytes_to_time;
|
||||
GetBytesToRTPTimeFunc bytes_to_rtptime;
|
||||
|
@ -115,68 +115,68 @@ struct _GstBaseRTPAudioPayloadPrivate
|
|||
};
|
||||
|
||||
|
||||
#define GST_BASE_RTP_AUDIO_PAYLOAD_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_BASE_RTP_AUDIO_PAYLOAD, \
|
||||
GstBaseRTPAudioPayloadPrivate))
|
||||
#define GST_RTP_BASE_AUDIO_PAYLOAD_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_RTP_BASE_AUDIO_PAYLOAD, \
|
||||
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);
|
||||
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);
|
||||
|
||||
/* bytes to time functions */
|
||||
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);
|
||||
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);
|
||||
|
||||
/* bytes to RTP time functions */
|
||||
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);
|
||||
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);
|
||||
|
||||
/* time to bytes functions */
|
||||
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);
|
||||
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);
|
||||
|
||||
static GstFlowReturn gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload
|
||||
static GstFlowReturn gst_rtp_base_audio_payload_handle_buffer (GstRTPBasePayload
|
||||
* 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);
|
||||
static gboolean gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload
|
||||
static gboolean gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload
|
||||
* payload, GstEvent * event);
|
||||
|
||||
#define gst_base_rtp_audio_payload_parent_class parent_class
|
||||
G_DEFINE_TYPE (GstBaseRTPAudioPayload, gst_base_rtp_audio_payload,
|
||||
GST_TYPE_BASE_RTP_PAYLOAD);
|
||||
#define gst_rtp_base_audio_payload_parent_class parent_class
|
||||
G_DEFINE_TYPE (GstRTPBaseAudioPayload, gst_rtp_base_audio_payload,
|
||||
GST_TYPE_RTP_BASE_PAYLOAD);
|
||||
|
||||
static void
|
||||
gst_base_rtp_audio_payload_class_init (GstBaseRTPAudioPayloadClass * klass)
|
||||
gst_rtp_base_audio_payload_class_init (GstRTPBaseAudioPayloadClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_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;
|
||||
gstelement_class = (GstElementClass *) klass;
|
||||
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
|
||||
gstbasertppayload_class = (GstRTPBasePayloadClass *) klass;
|
||||
|
||||
gobject_class->finalize = gst_base_rtp_audio_payload_finalize;
|
||||
gobject_class->set_property = gst_base_rtp_audio_payload_set_property;
|
||||
gobject_class->get_property = gst_base_rtp_audio_payload_get_property;
|
||||
gobject_class->finalize = gst_rtp_base_audio_payload_finalize;
|
||||
gobject_class->set_property = gst_rtp_base_audio_payload_set_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_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));
|
||||
|
||||
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 =
|
||||
GST_DEBUG_FUNCPTR (gst_base_rtp_audio_payload_handle_buffer);
|
||||
GST_DEBUG_FUNCPTR (gst_rtp_base_audio_payload_handle_buffer);
|
||||
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,
|
||||
"base audio RTP payloader");
|
||||
}
|
||||
|
||||
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 */
|
||||
payload->frame_size = 0;
|
||||
|
@ -213,11 +213,11 @@ gst_base_rtp_audio_payload_init (GstBaseRTPAudioPayload * payload)
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
|
@ -225,12 +225,12 @@ gst_base_rtp_audio_payload_finalize (GObject * object)
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GstBaseRTPAudioPayload *payload;
|
||||
GstRTPBaseAudioPayload *payload;
|
||||
|
||||
payload = GST_BASE_RTP_AUDIO_PAYLOAD (object);
|
||||
payload = GST_RTP_BASE_AUDIO_PAYLOAD (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_BUFFER_LIST:
|
||||
|
@ -243,12 +243,12 @@ gst_base_rtp_audio_payload_set_property (GObject * object,
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GstBaseRTPAudioPayload *payload;
|
||||
GstRTPBaseAudioPayload *payload;
|
||||
|
||||
payload = GST_BASE_RTP_AUDIO_PAYLOAD (object);
|
||||
payload = GST_RTP_BASE_AUDIO_PAYLOAD (object);
|
||||
|
||||
switch (prop_id) {
|
||||
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.
|
||||
*
|
||||
* Tells #GstBaseRTPAudioPayload that the child element is for a frame based
|
||||
* Tells #GstRTPBaseAudioPayload that the child element is for a frame based
|
||||
* audio codec
|
||||
*/
|
||||
void
|
||||
gst_base_rtp_audio_payload_set_frame_based (GstBaseRTPAudioPayload *
|
||||
gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *
|
||||
basertpaudiopayload)
|
||||
{
|
||||
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);
|
||||
|
||||
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 =
|
||||
gst_base_rtp_audio_payload_frame_bytes_to_rtptime;
|
||||
gst_rtp_base_audio_payload_frame_bytes_to_rtptime;
|
||||
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.
|
||||
*
|
||||
* Tells #GstBaseRTPAudioPayload that the child element is for a sample based
|
||||
* Tells #GstRTPBaseAudioPayload that the child element is for a sample based
|
||||
* audio codec
|
||||
*/
|
||||
void
|
||||
gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload *
|
||||
gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
|
||||
basertpaudiopayload)
|
||||
{
|
||||
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);
|
||||
|
||||
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 =
|
||||
gst_base_rtp_audio_payload_sample_bytes_to_rtptime;
|
||||
gst_rtp_base_audio_payload_sample_bytes_to_rtptime;
|
||||
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.
|
||||
* @frame_duration: The duraction of an audio frame in milliseconds.
|
||||
* @frame_size: The size of an audio frame in bytes.
|
||||
|
@ -318,10 +318,10 @@ gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload *
|
|||
*
|
||||
*/
|
||||
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)
|
||||
{
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
|
||||
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.
|
||||
* @sample_size: Size per sample in bytes.
|
||||
*
|
||||
* Sets the options for sample based audio codecs.
|
||||
*/
|
||||
void
|
||||
gst_base_rtp_audio_payload_set_sample_options (GstBaseRTPAudioPayload
|
||||
gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload
|
||||
* basertpaudiopayload, gint sample_size)
|
||||
{
|
||||
g_return_if_fail (basertpaudiopayload != NULL);
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_audio_payload_set_samplebits_options:
|
||||
* gst_rtp_base_audio_payload_set_samplebits_options:
|
||||
* @basertpaudiopayload: a pointer to the element.
|
||||
* @sample_size: Size per sample in bits.
|
||||
*
|
||||
|
@ -366,11 +366,11 @@ gst_base_rtp_audio_payload_set_sample_options (GstBaseRTPAudioPayload
|
|||
* Since: 0.10.18
|
||||
*/
|
||||
void
|
||||
gst_base_rtp_audio_payload_set_samplebits_options (GstBaseRTPAudioPayload
|
||||
gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
|
||||
* basertpaudiopayload, gint sample_size)
|
||||
{
|
||||
guint fragment_size;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
|
||||
g_return_if_fail (basertpaudiopayload != NULL);
|
||||
|
||||
|
@ -392,14 +392,14 @@ gst_base_rtp_audio_payload_set_samplebits_options (GstBaseRTPAudioPayload
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GstBaseRTPPayload *basepayload;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBasePayload *basepayload;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
GstRTPBuffer rtp;
|
||||
|
||||
basepayload = GST_BASE_RTP_PAYLOAD_CAST (payload);
|
||||
basepayload = GST_RTP_BASE_PAYLOAD_CAST (payload);
|
||||
priv = payload->priv;
|
||||
|
||||
/* set payload type */
|
||||
|
@ -431,8 +431,8 @@ gst_base_rtp_audio_payload_set_meta (GstBaseRTPAudioPayload * payload,
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_audio_payload_push:
|
||||
* @baseaudiopayload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_audio_payload_push:
|
||||
* @baseaudiopayload: a #GstRTPBasePayload
|
||||
* @data: data to set as payload
|
||||
* @payload_len: length of payload
|
||||
* @timestamp: a #GstClockTime
|
||||
|
@ -446,16 +446,16 @@ gst_base_rtp_audio_payload_set_meta (GstBaseRTPAudioPayload * payload,
|
|||
* Since: 0.10.13
|
||||
*/
|
||||
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)
|
||||
{
|
||||
GstBaseRTPPayload *basepayload;
|
||||
GstRTPBasePayload *basepayload;
|
||||
GstBuffer *outbuf;
|
||||
guint8 *payload;
|
||||
GstFlowReturn ret;
|
||||
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,
|
||||
payload_len, GST_TIME_ARGS (timestamp));
|
||||
|
@ -470,27 +470,27 @@ gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload,
|
|||
gst_rtp_buffer_unmap (&rtp);
|
||||
|
||||
/* 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);
|
||||
|
||||
ret = gst_base_rtp_payload_push (basepayload, outbuf);
|
||||
ret = gst_rtp_base_payload_push (basepayload, outbuf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
||||
gst_rtp_base_audio_payload_push_buffer (GstRTPBaseAudioPayload *
|
||||
baseaudiopayload, GstBuffer * buffer, GstClockTime timestamp)
|
||||
{
|
||||
GstBaseRTPPayload *basepayload;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBasePayload *basepayload;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
GstBuffer *outbuf;
|
||||
guint8 *payload;
|
||||
guint payload_len;
|
||||
GstFlowReturn ret;
|
||||
|
||||
priv = baseaudiopayload->priv;
|
||||
basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload);
|
||||
basepayload = GST_RTP_BASE_PAYLOAD (baseaudiopayload);
|
||||
|
||||
payload_len = gst_buffer_get_size (buffer);
|
||||
|
||||
|
@ -506,7 +506,7 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
|||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
if (priv->buffer_list) {
|
||||
|
@ -524,7 +524,7 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
|||
}
|
||||
|
||||
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 {
|
||||
GstRTPBuffer rtp;
|
||||
|
||||
|
@ -537,15 +537,15 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
|||
gst_buffer_unref (buffer);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_audio_payload_flush:
|
||||
* @baseaudiopayload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_audio_payload_flush:
|
||||
* @baseaudiopayload: a #GstRTPBasePayload
|
||||
* @payload_len: length of payload
|
||||
* @timestamp: a #GstClockTime
|
||||
*
|
||||
|
@ -561,11 +561,11 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
|||
* Since: 0.10.25
|
||||
*/
|
||||
GstFlowReturn
|
||||
gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
|
||||
gst_rtp_base_audio_payload_flush (GstRTPBaseAudioPayload * baseaudiopayload,
|
||||
guint payload_len, GstClockTime timestamp)
|
||||
{
|
||||
GstBaseRTPPayload *basepayload;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBasePayload *basepayload;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
GstBuffer *outbuf;
|
||||
guint8 *payload;
|
||||
GstFlowReturn ret;
|
||||
|
@ -575,7 +575,7 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
|
|||
priv = baseaudiopayload->priv;
|
||||
adapter = priv->adapter;
|
||||
|
||||
basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload);
|
||||
basepayload = GST_RTP_BASE_PAYLOAD (baseaudiopayload);
|
||||
|
||||
if (payload_len == -1)
|
||||
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);
|
||||
|
||||
ret =
|
||||
gst_base_rtp_audio_payload_push_buffer (baseaudiopayload, buffer,
|
||||
gst_rtp_base_audio_payload_push_buffer (baseaudiopayload, buffer,
|
||||
timestamp);
|
||||
} else {
|
||||
GstRTPBuffer rtp;
|
||||
|
@ -625,10 +625,10 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
|
|||
gst_rtp_buffer_unmap (&rtp);
|
||||
|
||||
/* 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);
|
||||
|
||||
ret = gst_base_rtp_payload_push (basepayload, outbuf);
|
||||
ret = gst_rtp_base_payload_push (basepayload, outbuf);
|
||||
}
|
||||
|
||||
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
|
||||
* all the calculations */
|
||||
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,
|
||||
guint * align)
|
||||
{
|
||||
GstBaseRTPAudioPayload *payload;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBaseAudioPayload *payload;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
guint max_mtu, mtu;
|
||||
guint maxptime_octets;
|
||||
guint minptime_octets;
|
||||
guint ptime_mult_octets;
|
||||
|
||||
payload = GST_BASE_RTP_AUDIO_PAYLOAD_CAST (basepayload);
|
||||
payload = GST_RTP_BASE_AUDIO_PAYLOAD_CAST (basepayload);
|
||||
priv = payload->priv;
|
||||
|
||||
if (priv->align == 0)
|
||||
return FALSE;
|
||||
|
||||
mtu = GST_BASE_RTP_PAYLOAD_MTU (payload);
|
||||
mtu = GST_RTP_BASE_PAYLOAD_MTU (payload);
|
||||
|
||||
/* check cached values */
|
||||
if (G_LIKELY (priv->cached_mtu == mtu
|
||||
|
@ -726,7 +726,7 @@ gst_base_rtp_audio_payload_get_lengths (GstBaseRTPPayload *
|
|||
|
||||
/* frame conversions functions */
|
||||
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)
|
||||
{
|
||||
guint64 framecount;
|
||||
|
@ -739,7 +739,7 @@ gst_base_rtp_audio_payload_frame_bytes_to_time (GstBaseRTPAudioPayload *
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
guint64 framecount;
|
||||
|
@ -752,11 +752,11 @@ gst_base_rtp_audio_payload_frame_bytes_to_rtptime (GstBaseRTPAudioPayload *
|
|||
time = framecount * payload->priv->frame_duration_ns;
|
||||
|
||||
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
|
||||
gst_base_rtp_audio_payload_frame_time_to_bytes (GstBaseRTPAudioPayload *
|
||||
gst_rtp_base_audio_payload_frame_time_to_bytes (GstRTPBaseAudioPayload *
|
||||
payload, GstClockTime time)
|
||||
{
|
||||
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 */
|
||||
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)
|
||||
{
|
||||
guint64 rtptime;
|
||||
|
@ -777,11 +777,11 @@ gst_base_rtp_audio_payload_sample_bytes_to_time (GstBaseRTPAudioPayload *
|
|||
rtptime = bytes;
|
||||
|
||||
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
|
||||
gst_base_rtp_audio_payload_sample_bytes_to_rtptime (GstBaseRTPAudioPayload *
|
||||
gst_rtp_base_audio_payload_sample_bytes_to_rtptime (GstRTPBaseAudioPayload *
|
||||
payload, guint64 bytes)
|
||||
{
|
||||
/* avoid division when we can */
|
||||
|
@ -792,13 +792,13 @@ gst_base_rtp_audio_payload_sample_bytes_to_rtptime (GstBaseRTPAudioPayload *
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
guint64 samples;
|
||||
|
||||
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 */
|
||||
if (G_LIKELY (payload->sample_size != 8))
|
||||
|
@ -808,11 +808,11 @@ gst_base_rtp_audio_payload_sample_time_to_bytes (GstBaseRTPAudioPayload *
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
|
||||
gst_rtp_base_audio_payload_handle_buffer (GstRTPBasePayload *
|
||||
basepayload, GstBuffer * buffer)
|
||||
{
|
||||
GstBaseRTPAudioPayload *payload;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBaseAudioPayload *payload;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
guint payload_len;
|
||||
GstFlowReturn ret;
|
||||
guint available;
|
||||
|
@ -825,7 +825,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
|
|||
|
||||
ret = GST_FLOW_OK;
|
||||
|
||||
payload = GST_BASE_RTP_AUDIO_PAYLOAD_CAST (basepayload);
|
||||
payload = GST_RTP_BASE_AUDIO_PAYLOAD_CAST (basepayload);
|
||||
priv = payload->priv;
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
|
@ -834,7 +834,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
|
|||
|
||||
GST_DEBUG_OBJECT (payload, "Got 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;
|
||||
|
||||
/* 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))
|
||||
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
|
||||
* this will check against max_ptime and max_mtu */
|
||||
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 {
|
||||
/* push the buffer in the adapter */
|
||||
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
|
||||
* 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;
|
||||
GST_DEBUG_OBJECT (payload, "available after push %u", available);
|
||||
|
@ -919,13 +919,13 @@ config_error:
|
|||
}
|
||||
|
||||
static GstStateChangeReturn
|
||||
gst_base_rtp_payload_audio_change_state (GstElement * element,
|
||||
gst_rtp_base_payload_audio_change_state (GstElement * element,
|
||||
GstStateChange transition)
|
||||
{
|
||||
GstBaseRTPAudioPayload *basertppayload;
|
||||
GstRTPBaseAudioPayload *basertppayload;
|
||||
GstStateChangeReturn ret;
|
||||
|
||||
basertppayload = GST_BASE_RTP_AUDIO_PAYLOAD (element);
|
||||
basertppayload = GST_RTP_BASE_AUDIO_PAYLOAD (element);
|
||||
|
||||
switch (transition) {
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
|
@ -951,18 +951,18 @@ gst_base_rtp_payload_audio_change_state (GstElement * element,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_rtp_payload_audio_handle_event (GstBaseRTPPayload * basep,
|
||||
gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload * basep,
|
||||
GstEvent * event)
|
||||
{
|
||||
GstBaseRTPAudioPayload *payload;
|
||||
GstRTPBaseAudioPayload *payload;
|
||||
gboolean res = FALSE;
|
||||
|
||||
payload = GST_BASE_RTP_AUDIO_PAYLOAD (basep);
|
||||
payload = GST_RTP_BASE_AUDIO_PAYLOAD (basep);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_EOS:
|
||||
/* 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;
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
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 */
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_audio_payload_get_adapter:
|
||||
* @basertpaudiopayload: a #GstBaseRTPAudioPayload
|
||||
* gst_rtp_base_audio_payload_get_adapter:
|
||||
* @basertpaudiopayload: a #GstRTPBaseAudioPayload
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
GstAdapter *
|
||||
gst_base_rtp_audio_payload_get_adapter (GstBaseRTPAudioPayload
|
||||
gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload
|
||||
* basertpaudiopayload)
|
||||
{
|
||||
GstAdapter *adapter;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_BASE_RTP_AUDIO_PAYLOAD_H__
|
||||
#define __GST_BASE_RTP_AUDIO_PAYLOAD_H__
|
||||
#ifndef __GST_RTP_BASE_AUDIO_PAYLOAD_H__
|
||||
#define __GST_RTP_BASE_AUDIO_PAYLOAD_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/rtp/gstbasertppayload.h>
|
||||
|
@ -26,31 +26,31 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GstBaseRTPAudioPayload GstBaseRTPAudioPayload;
|
||||
typedef struct _GstBaseRTPAudioPayloadClass GstBaseRTPAudioPayloadClass;
|
||||
typedef struct _GstRTPBaseAudioPayload GstRTPBaseAudioPayload;
|
||||
typedef struct _GstRTPBaseAudioPayloadClass GstRTPBaseAudioPayloadClass;
|
||||
|
||||
typedef struct _GstBaseRTPAudioPayloadPrivate GstBaseRTPAudioPayloadPrivate;
|
||||
typedef struct _GstRTPBaseAudioPayloadPrivate GstRTPBaseAudioPayloadPrivate;
|
||||
|
||||
#define GST_TYPE_BASE_RTP_AUDIO_PAYLOAD \
|
||||
(gst_base_rtp_audio_payload_get_type())
|
||||
#define GST_BASE_RTP_AUDIO_PAYLOAD(obj) \
|
||||
#define GST_TYPE_RTP_BASE_AUDIO_PAYLOAD \
|
||||
(gst_rtp_base_audio_payload_get_type())
|
||||
#define GST_RTP_BASE_AUDIO_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
|
||||
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD,GstBaseRTPAudioPayload))
|
||||
#define GST_BASE_RTP_AUDIO_PAYLOAD_CLASS(klass) \
|
||||
GST_TYPE_RTP_BASE_AUDIO_PAYLOAD,GstRTPBaseAudioPayload))
|
||||
#define GST_RTP_BASE_AUDIO_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass), \
|
||||
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD,GstBaseRTPAudioPayloadClass))
|
||||
#define GST_IS_BASE_RTP_AUDIO_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_AUDIO_PAYLOAD))
|
||||
#define GST_IS_BASE_RTP_AUDIO_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_AUDIO_PAYLOAD))
|
||||
#define GST_BASE_RTP_AUDIO_PAYLOAD_CAST(obj) \
|
||||
((GstBaseRTPAudioPayload *) (obj))
|
||||
GST_TYPE_RTP_BASE_AUDIO_PAYLOAD,GstRTPBaseAudioPayloadClass))
|
||||
#define GST_IS_RTP_BASE_AUDIO_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_AUDIO_PAYLOAD))
|
||||
#define GST_IS_RTP_BASE_AUDIO_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_AUDIO_PAYLOAD))
|
||||
#define GST_RTP_BASE_AUDIO_PAYLOAD_CAST(obj) \
|
||||
((GstRTPBaseAudioPayload *) (obj))
|
||||
|
||||
struct _GstBaseRTPAudioPayload
|
||||
struct _GstRTPBaseAudioPayload
|
||||
{
|
||||
GstBaseRTPPayload payload;
|
||||
GstRTPBasePayload payload;
|
||||
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstRTPBaseAudioPayloadPrivate *priv;
|
||||
|
||||
GstClockTime base_ts;
|
||||
gint frame_size;
|
||||
|
@ -62,44 +62,44 @@ struct _GstBaseRTPAudioPayload
|
|||
};
|
||||
|
||||
/**
|
||||
* GstBaseRTPAudioPayloadClass:
|
||||
* GstRTPBaseAudioPayloadClass:
|
||||
* @parent_class: the parent class
|
||||
*
|
||||
* Base class for audio RTP payloader.
|
||||
*/
|
||||
struct _GstBaseRTPAudioPayloadClass
|
||||
struct _GstRTPBaseAudioPayloadClass
|
||||
{
|
||||
GstBaseRTPPayloadClass parent_class;
|
||||
GstRTPBasePayloadClass parent_class;
|
||||
|
||||
/*< private >*/
|
||||
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 */
|
||||
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);
|
||||
|
||||
/* configure sample based */
|
||||
void gst_base_rtp_audio_payload_set_sample_based (GstBaseRTPAudioPayload *basertpaudiopayload);
|
||||
void gst_base_rtp_audio_payload_set_sample_options (GstBaseRTPAudioPayload *basertpaudiopayload,
|
||||
void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *basertpaudiopayload);
|
||||
void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *basertpaudiopayload,
|
||||
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);
|
||||
|
||||
/* 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 */
|
||||
GstFlowReturn gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload,
|
||||
GstFlowReturn gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,
|
||||
const guint8 * data, guint payload_len,
|
||||
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);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_BASE_RTP_AUDIO_PAYLOAD_H__ */
|
||||
#endif /* __GST_RTP_BASE_AUDIO_PAYLOAD_H__ */
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (basertpdepayload_debug);
|
||||
#define GST_CAT_DEFAULT (basertpdepayload_debug)
|
||||
|
||||
#define GST_BASE_RTP_DEPAYLOAD_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_RTP_DEPAYLOAD, GstBaseRTPDepayloadPrivate))
|
||||
#define GST_RTP_BASE_DEPAYLOAD_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_DEPAYLOAD, GstRTPBaseDepayloadPrivate))
|
||||
|
||||
struct _GstBaseRTPDepayloadPrivate
|
||||
struct _GstRTPBaseDepayloadPrivate
|
||||
{
|
||||
GstClockTime npt_start;
|
||||
GstClockTime npt_stop;
|
||||
|
@ -63,58 +63,58 @@ enum
|
|||
PROP_LAST
|
||||
};
|
||||
|
||||
static void gst_base_rtp_depayload_finalize (GObject * object);
|
||||
static void gst_base_rtp_depayload_set_property (GObject * object,
|
||||
static void gst_rtp_base_depayload_finalize (GObject * object);
|
||||
static void gst_rtp_base_depayload_set_property (GObject * object,
|
||||
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);
|
||||
|
||||
static GstFlowReturn gst_base_rtp_depayload_chain (GstPad * pad,
|
||||
static GstFlowReturn gst_rtp_base_depayload_chain (GstPad * pad,
|
||||
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);
|
||||
|
||||
static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement *
|
||||
static GstStateChangeReturn gst_rtp_base_depayload_change_state (GstElement *
|
||||
element, GstStateChange transition);
|
||||
|
||||
static gboolean gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload *
|
||||
static gboolean gst_rtp_base_depayload_packet_lost (GstRTPBaseDepayload *
|
||||
filter, GstEvent * event);
|
||||
static gboolean gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload *
|
||||
static gboolean gst_rtp_base_depayload_handle_event (GstRTPBaseDepayload *
|
||||
filter, GstEvent * event);
|
||||
|
||||
static GstElementClass *parent_class = NULL;
|
||||
static void gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass *
|
||||
static void gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass *
|
||||
klass);
|
||||
static void gst_base_rtp_depayload_init (GstBaseRTPDepayload * basertppayload,
|
||||
GstBaseRTPDepayloadClass * klass);
|
||||
static void gst_rtp_base_depayload_init (GstRTPBaseDepayload * basertppayload,
|
||||
GstRTPBaseDepayloadClass * klass);
|
||||
|
||||
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)) {
|
||||
static const GTypeInfo base_rtp_depayload_info = {
|
||||
sizeof (GstBaseRTPDepayloadClass),
|
||||
if (g_once_init_enter ((gsize *) & rtp_base_depayload_type)) {
|
||||
static const GTypeInfo rtp_base_depayload_info = {
|
||||
sizeof (GstRTPBaseDepayloadClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gst_base_rtp_depayload_class_init,
|
||||
(GClassInitFunc) gst_rtp_base_depayload_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GstBaseRTPDepayload),
|
||||
sizeof (GstRTPBaseDepayload),
|
||||
0,
|
||||
(GInstanceInitFunc) gst_base_rtp_depayload_init,
|
||||
(GInstanceInitFunc) gst_rtp_base_depayload_init,
|
||||
};
|
||||
|
||||
g_once_init_leave ((gsize *) & base_rtp_depayload_type,
|
||||
g_type_register_static (GST_TYPE_ELEMENT, "GstBaseRTPDepayload",
|
||||
&base_rtp_depayload_info, G_TYPE_FLAG_ABSTRACT));
|
||||
g_once_init_leave ((gsize *) & rtp_base_depayload_type,
|
||||
g_type_register_static (GST_TYPE_ELEMENT, "GstRTPBaseDepayload",
|
||||
&rtp_base_depayload_info, G_TYPE_FLAG_ABSTRACT));
|
||||
}
|
||||
return base_rtp_depayload_type;
|
||||
return rtp_base_depayload_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass)
|
||||
gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *gstelement_class;
|
||||
|
@ -123,29 +123,29 @@ gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass)
|
|||
gstelement_class = (GstElementClass *) 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->set_property = gst_base_rtp_depayload_set_property;
|
||||
gobject_class->get_property = gst_base_rtp_depayload_get_property;
|
||||
gobject_class->finalize = gst_rtp_base_depayload_finalize;
|
||||
gobject_class->set_property = gst_rtp_base_depayload_set_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->handle_event = gst_base_rtp_depayload_handle_event;
|
||||
klass->packet_lost = gst_rtp_base_depayload_packet_lost;
|
||||
klass->handle_event = gst_rtp_base_depayload_handle_event;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (basertpdepayload_debug, "basertpdepayload", 0,
|
||||
"Base class for RTP Depayloaders");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter,
|
||||
GstBaseRTPDepayloadClass * klass)
|
||||
gst_rtp_base_depayload_init (GstRTPBaseDepayload * filter,
|
||||
GstRTPBaseDepayloadClass * klass)
|
||||
{
|
||||
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;
|
||||
|
||||
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");
|
||||
g_return_if_fail (pad_template != NULL);
|
||||
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_base_rtp_depayload_handle_sink_event);
|
||||
gst_rtp_base_depayload_handle_sink_event);
|
||||
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
||||
|
||||
pad_template =
|
||||
|
@ -170,23 +170,23 @@ gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_base_rtp_depayload_finalize (GObject * object)
|
||||
gst_rtp_base_depayload_finalize (GObject * object)
|
||||
{
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_rtp_depayload_setcaps (GstBaseRTPDepayload * filter, GstCaps * caps)
|
||||
gst_rtp_base_depayload_setcaps (GstRTPBaseDepayload * filter, GstCaps * caps)
|
||||
{
|
||||
GstBaseRTPDepayloadClass *bclass;
|
||||
GstBaseRTPDepayloadPrivate *priv;
|
||||
GstRTPBaseDepayloadClass *bclass;
|
||||
GstRTPBaseDepayloadPrivate *priv;
|
||||
gboolean res;
|
||||
GstStructure *caps_struct;
|
||||
const GValue *value;
|
||||
|
||||
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");
|
||||
|
||||
|
@ -236,11 +236,11 @@ gst_base_rtp_depayload_setcaps (GstBaseRTPDepayload * filter, GstCaps * caps)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
||||
gst_rtp_base_depayload_chain (GstPad * pad, GstBuffer * in)
|
||||
{
|
||||
GstBaseRTPDepayload *filter;
|
||||
GstBaseRTPDepayloadPrivate *priv;
|
||||
GstBaseRTPDepayloadClass *bclass;
|
||||
GstRTPBaseDepayload *filter;
|
||||
GstRTPBaseDepayloadPrivate *priv;
|
||||
GstRTPBaseDepayloadClass *bclass;
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
GstBuffer *out_buf;
|
||||
GstClockTime pts, dts;
|
||||
|
@ -250,7 +250,7 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
|||
gint gap;
|
||||
GstRTPBuffer rtp;
|
||||
|
||||
filter = GST_BASE_RTP_DEPAYLOAD (GST_OBJECT_PARENT (pad));
|
||||
filter = GST_RTP_BASE_DEPAYLOAD (GST_OBJECT_PARENT (pad));
|
||||
priv = filter->priv;
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
||||
bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
|
||||
|
||||
if (G_UNLIKELY (bclass->process == NULL))
|
||||
goto no_process;
|
||||
|
@ -334,7 +334,7 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
|||
/* let's send it out to processing */
|
||||
out_buf = bclass->process (filter, in);
|
||||
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);
|
||||
|
||||
|
@ -380,7 +380,7 @@ no_process:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
|
||||
gst_rtp_base_depayload_handle_event (GstRTPBaseDepayload * filter,
|
||||
GstEvent * event)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
@ -398,7 +398,7 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
|
|||
|
||||
gst_event_parse_caps (event, &caps);
|
||||
|
||||
res = gst_base_rtp_depayload_setcaps (filter, caps);
|
||||
res = gst_rtp_base_depayload_setcaps (filter, caps);
|
||||
forward = FALSE;
|
||||
break;
|
||||
}
|
||||
|
@ -412,9 +412,9 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
|
|||
}
|
||||
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")) {
|
||||
/* 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
|
||||
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;
|
||||
GstBaseRTPDepayload *filter;
|
||||
GstBaseRTPDepayloadClass *bclass;
|
||||
GstRTPBaseDepayload *filter;
|
||||
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)) {
|
||||
gst_event_unref (event);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
||||
bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
|
||||
if (bclass->handle_event)
|
||||
res = bclass->handle_event (filter, event);
|
||||
else
|
||||
|
@ -469,12 +469,12 @@ gst_base_rtp_depayload_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
static GstEvent *
|
||||
create_segment_event (GstBaseRTPDepayload * filter, gboolean update,
|
||||
create_segment_event (GstRTPBaseDepayload * filter, gboolean update,
|
||||
GstClockTime position)
|
||||
{
|
||||
GstEvent *event;
|
||||
GstClockTime stop;
|
||||
GstBaseRTPDepayloadPrivate *priv;
|
||||
GstRTPBaseDepayloadPrivate *priv;
|
||||
GstSegment segment;
|
||||
|
||||
priv = filter->priv;
|
||||
|
@ -499,15 +499,15 @@ create_segment_event (GstBaseRTPDepayload * filter, gboolean update,
|
|||
|
||||
typedef struct
|
||||
{
|
||||
GstBaseRTPDepayload *depayload;
|
||||
GstBaseRTPDepayloadClass *bclass;
|
||||
GstRTPBaseDepayload *depayload;
|
||||
GstRTPBaseDepayloadClass *bclass;
|
||||
} HeaderData;
|
||||
|
||||
static gboolean
|
||||
set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
|
||||
{
|
||||
GstBaseRTPDepayload *depayload = data->depayload;
|
||||
GstBaseRTPDepayloadPrivate *priv = depayload->priv;
|
||||
GstRTPBaseDepayload *depayload = data->depayload;
|
||||
GstRTPBaseDepayloadPrivate *priv = depayload->priv;
|
||||
GstClockTime pts, dts, duration;
|
||||
|
||||
*buffer = gst_buffer_make_writable (*buffer);
|
||||
|
@ -540,13 +540,13 @@ set_headers (GstBuffer ** buffer, guint idx, HeaderData * data)
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
|
||||
gst_rtp_base_depayload_prepare_push (GstRTPBaseDepayload * filter,
|
||||
gboolean is_list, gpointer obj)
|
||||
{
|
||||
HeaderData data;
|
||||
|
||||
data.depayload = filter;
|
||||
data.bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
||||
data.bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
|
||||
|
||||
if (is_list) {
|
||||
GstBufferList **blist = obj;
|
||||
|
@ -572,8 +572,8 @@ gst_base_rtp_depayload_prepare_push (GstBaseRTPDepayload * filter,
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_depayload_push:
|
||||
* @filter: a #GstBaseRTPDepayload
|
||||
* gst_rtp_base_depayload_push:
|
||||
* @filter: a #GstRTPBaseDepayload
|
||||
* @out_buf: a #GstBuffer
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
GstFlowReturn
|
||||
gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * out_buf)
|
||||
gst_rtp_base_depayload_push (GstRTPBaseDepayload * filter, GstBuffer * out_buf)
|
||||
{
|
||||
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))
|
||||
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:
|
||||
* @filter: a #GstBaseRTPDepayload
|
||||
* gst_rtp_base_depayload_push_list:
|
||||
* @filter: a #GstRTPBaseDepayload
|
||||
* @out_list: a #GstBufferList
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
GstFlowReturn
|
||||
gst_base_rtp_depayload_push_list (GstBaseRTPDepayload * filter,
|
||||
gst_rtp_base_depayload_push_list (GstRTPBaseDepayload * filter,
|
||||
GstBufferList * out_list)
|
||||
{
|
||||
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))
|
||||
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.
|
||||
* subclasses can override this. */
|
||||
static gboolean
|
||||
gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter,
|
||||
gst_rtp_base_depayload_packet_lost (GstRTPBaseDepayload * filter,
|
||||
GstEvent * event)
|
||||
{
|
||||
GstClockTime timestamp, duration, position;
|
||||
|
@ -657,14 +657,14 @@ gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter,
|
|||
}
|
||||
|
||||
static GstStateChangeReturn
|
||||
gst_base_rtp_depayload_change_state (GstElement * element,
|
||||
gst_rtp_base_depayload_change_state (GstElement * element,
|
||||
GstStateChange transition)
|
||||
{
|
||||
GstBaseRTPDepayload *filter;
|
||||
GstBaseRTPDepayloadPrivate *priv;
|
||||
GstRTPBaseDepayload *filter;
|
||||
GstRTPBaseDepayloadPrivate *priv;
|
||||
GstStateChangeReturn ret;
|
||||
|
||||
filter = GST_BASE_RTP_DEPAYLOAD (element);
|
||||
filter = GST_RTP_BASE_DEPAYLOAD (element);
|
||||
priv = filter->priv;
|
||||
|
||||
switch (transition) {
|
||||
|
@ -702,7 +702,7 @@ gst_base_rtp_depayload_change_state (GstElement * element,
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
switch (prop_id) {
|
||||
|
@ -713,7 +713,7 @@ gst_base_rtp_depayload_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
switch (prop_id) {
|
||||
|
|
|
@ -17,34 +17,34 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_BASE_RTP_DEPAYLOAD_H__
|
||||
#define __GST_BASE_RTP_DEPAYLOAD_H__
|
||||
#ifndef __GST_RTP_BASE_DEPAYLOAD_H__
|
||||
#define __GST_RTP_BASE_DEPAYLOAD_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/rtp/gstrtpbuffer.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_BASE_RTP_DEPAYLOAD (gst_base_rtp_depayload_get_type())
|
||||
#define GST_BASE_RTP_DEPAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_DEPAYLOAD,GstBaseRTPDepayload))
|
||||
#define GST_BASE_RTP_DEPAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_RTP_DEPAYLOAD,GstBaseRTPDepayloadClass))
|
||||
#define GST_BASE_RTP_DEPAYLOAD_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_BASE_RTP_DEPAYLOAD,GstBaseRTPDepayloadClass))
|
||||
#define GST_IS_BASE_RTP_DEPAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_DEPAYLOAD))
|
||||
#define GST_IS_BASE_RTP_DEPAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_DEPAYLOAD))
|
||||
#define GST_TYPE_RTP_BASE_DEPAYLOAD (gst_rtp_base_depayload_get_type())
|
||||
#define GST_RTP_BASE_DEPAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayload))
|
||||
#define GST_RTP_BASE_DEPAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayloadClass))
|
||||
#define GST_RTP_BASE_DEPAYLOAD_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_RTP_BASE_DEPAYLOAD,GstRTPBaseDepayloadClass))
|
||||
#define GST_IS_RTP_BASE_DEPAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_DEPAYLOAD))
|
||||
#define GST_IS_RTP_BASE_DEPAYLOAD_CLASS(klass) \
|
||||
(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_BASE_RTP_DEPAYLOAD_SRCPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->srcpad)
|
||||
#define GST_RTP_BASE_DEPAYLOAD_SINKPAD(depayload) (GST_RTP_BASE_DEPAYLOAD (depayload)->sinkpad)
|
||||
#define GST_RTP_BASE_DEPAYLOAD_SRCPAD(depayload) (GST_RTP_BASE_DEPAYLOAD (depayload)->srcpad)
|
||||
|
||||
typedef struct _GstBaseRTPDepayload GstBaseRTPDepayload;
|
||||
typedef struct _GstBaseRTPDepayloadClass GstBaseRTPDepayloadClass;
|
||||
typedef struct _GstBaseRTPDepayloadPrivate GstBaseRTPDepayloadPrivate;
|
||||
typedef struct _GstRTPBaseDepayload GstRTPBaseDepayload;
|
||||
typedef struct _GstRTPBaseDepayloadClass GstRTPBaseDepayloadClass;
|
||||
typedef struct _GstRTPBaseDepayloadPrivate GstRTPBaseDepayloadPrivate;
|
||||
|
||||
struct _GstBaseRTPDepayload
|
||||
struct _GstRTPBaseDepayload
|
||||
{
|
||||
GstElement parent;
|
||||
|
||||
|
@ -57,57 +57,55 @@ struct _GstBaseRTPDepayload
|
|||
gboolean need_newsegment;
|
||||
|
||||
/*< private >*/
|
||||
GstBaseRTPDepayloadPrivate *priv;
|
||||
GstRTPBaseDepayloadPrivate *priv;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING-1];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstBaseRTPDepayloadClass:
|
||||
* GstRTPBaseDepayloadClass:
|
||||
* @parent_class: the parent class
|
||||
* @set_caps: configure the depayloader
|
||||
* @add_to_queue: (deprecated)
|
||||
* @process: process incoming rtp packets
|
||||
* @set_gst_timestamp: convert from RTP timestamp to GST timestamp
|
||||
* @packet_lost: signal the depayloader about packet loss
|
||||
* @handle_event: custom event handling
|
||||
*
|
||||
* Base class for audio RTP payloader.
|
||||
*/
|
||||
struct _GstBaseRTPDepayloadClass
|
||||
struct _GstRTPBaseDepayloadClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* 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
|
||||
* 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
|
||||
* buffer will be pushed. If this function returns %NULL, nothing is
|
||||
* 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
|
||||
* timestamp and duration are the estimated values of the lost packet.
|
||||
* 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
|
||||
* implementation can override.
|
||||
* Since: 0.10.32 */
|
||||
gboolean (*handle_event) (GstBaseRTPDepayload * filter, GstEvent * event);
|
||||
gboolean (*handle_event) (GstRTPBaseDepayload * filter, GstEvent * event);
|
||||
|
||||
/*< private >*/
|
||||
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_base_rtp_depayload_push_list (GstBaseRTPDepayload *filter, GstBufferList *out_list);
|
||||
GstFlowReturn gst_rtp_base_depayload_push (GstRTPBaseDepayload *filter, GstBuffer *out_buf);
|
||||
GstFlowReturn gst_rtp_base_depayload_push_list (GstRTPBaseDepayload *filter, GstBufferList *out_list);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_BASE_RTP_DEPAYLOAD_H__ */
|
||||
#endif /* __GST_RTP_BASE_DEPAYLOAD_H__ */
|
||||
|
|
|
@ -32,10 +32,10 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (basertppayload_debug);
|
||||
#define GST_CAT_DEFAULT (basertppayload_debug)
|
||||
|
||||
#define GST_BASE_RTP_PAYLOAD_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_RTP_PAYLOAD, GstBaseRTPPayloadPrivate))
|
||||
#define GST_RTP_BASE_PAYLOAD_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_PAYLOAD, GstRTPBasePayloadPrivate))
|
||||
|
||||
struct _GstBaseRTPPayloadPrivate
|
||||
struct _GstRTPBasePayloadPrivate
|
||||
{
|
||||
gboolean ts_offset_random;
|
||||
gboolean seqnum_offset_random;
|
||||
|
@ -51,7 +51,7 @@ struct _GstBaseRTPPayloadPrivate
|
|||
gint64 caps_max_ptime;
|
||||
};
|
||||
|
||||
/* BaseRTPPayload signals and args */
|
||||
/* RTPBasePayload signals and args */
|
||||
enum
|
||||
{
|
||||
/* FILL ME */
|
||||
|
@ -91,27 +91,27 @@ enum
|
|||
PROP_LAST
|
||||
};
|
||||
|
||||
static void gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass);
|
||||
static void gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload,
|
||||
static void gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass);
|
||||
static void gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload,
|
||||
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);
|
||||
static gboolean gst_base_rtp_payload_event_default (GstBaseRTPPayload *
|
||||
static gboolean gst_rtp_base_payload_event_default (GstRTPBasePayload *
|
||||
basertppayload, GstEvent * event);
|
||||
static gboolean gst_base_rtp_payload_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_base_rtp_payload_chain (GstPad * pad,
|
||||
static gboolean gst_rtp_base_payload_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_rtp_base_payload_chain (GstPad * pad,
|
||||
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);
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
static GstStateChangeReturn gst_base_rtp_payload_change_state (GstElement *
|
||||
static GstStateChangeReturn gst_rtp_base_payload_change_state (GstElement *
|
||||
element, GstStateChange transition);
|
||||
|
||||
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 */
|
||||
|
||||
GType
|
||||
gst_base_rtp_payload_get_type (void)
|
||||
gst_rtp_base_payload_get_type (void)
|
||||
{
|
||||
static GType basertppayload_type = 0;
|
||||
|
||||
if (g_once_init_enter ((gsize *) & basertppayload_type)) {
|
||||
static const GTypeInfo basertppayload_info = {
|
||||
sizeof (GstBaseRTPPayloadClass),
|
||||
sizeof (GstRTPBasePayloadClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gst_base_rtp_payload_class_init,
|
||||
(GClassInitFunc) gst_rtp_base_payload_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GstBaseRTPPayload),
|
||||
sizeof (GstRTPBasePayload),
|
||||
0,
|
||||
(GInstanceInitFunc) gst_base_rtp_payload_init,
|
||||
(GInstanceInitFunc) gst_rtp_base_payload_init,
|
||||
};
|
||||
|
||||
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));
|
||||
}
|
||||
return basertppayload_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
|
||||
gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *gstelement_class;
|
||||
|
@ -152,14 +152,14 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
|
|||
gobject_class = (GObjectClass *) 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);
|
||||
|
||||
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->get_property = gst_base_rtp_payload_get_property;
|
||||
gobject_class->set_property = gst_rtp_base_payload_set_property;
|
||||
gobject_class->get_property = gst_rtp_base_payload_get_property;
|
||||
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_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,
|
||||
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)
|
||||
*
|
||||
|
@ -212,7 +212,7 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
|
|||
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
|
||||
* 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",
|
||||
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)
|
||||
*
|
||||
|
@ -238,23 +238,23 @@ gst_base_rtp_payload_class_init (GstBaseRTPPayloadClass * klass)
|
|||
0, G_MAXINT64, DEFAULT_PTIME_MULTIPLE,
|
||||
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->handle_event = gst_base_rtp_payload_event_default;
|
||||
klass->get_caps = gst_rtp_base_payload_getcaps_default;
|
||||
klass->handle_event = gst_rtp_base_payload_event_default;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (basertppayload_debug, "basertppayload", 0,
|
||||
"Base class for RTP Payloaders");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
||||
gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload, gpointer g_class)
|
||||
{
|
||||
GstPadTemplate *templ;
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
GstRTPBasePayloadPrivate *priv;
|
||||
|
||||
basertppayload->priv = priv =
|
||||
GST_BASE_RTP_PAYLOAD_GET_PRIVATE (basertppayload);
|
||||
GST_RTP_BASE_PAYLOAD_GET_PRIVATE (basertppayload);
|
||||
|
||||
templ =
|
||||
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");
|
||||
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_base_rtp_payload_event);
|
||||
gst_rtp_base_payload_event);
|
||||
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);
|
||||
|
||||
basertppayload->mtu = DEFAULT_MTU;
|
||||
|
@ -302,11 +302,11 @@ gst_base_rtp_payload_init (GstBaseRTPPayload * basertppayload, gpointer g_class)
|
|||
}
|
||||
|
||||
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);
|
||||
basertppayload->media = NULL;
|
||||
|
@ -317,7 +317,7 @@ gst_base_rtp_payload_finalize (GObject * object)
|
|||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * basertppayload,
|
||||
gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * basertppayload,
|
||||
GstPad * pad, GstCaps * filter)
|
||||
{
|
||||
GstCaps *caps;
|
||||
|
@ -336,16 +336,16 @@ gst_base_rtp_payload_getcaps_default (GstBaseRTPPayload * basertppayload,
|
|||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_base_rtp_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
||||
gst_rtp_base_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
||||
{
|
||||
GstBaseRTPPayload *basertppayload;
|
||||
GstBaseRTPPayloadClass *basertppayload_class;
|
||||
GstRTPBasePayload *basertppayload;
|
||||
GstRTPBasePayloadClass *basertppayload_class;
|
||||
GstCaps *caps = NULL;
|
||||
|
||||
GST_DEBUG_OBJECT (pad, "getting caps");
|
||||
|
||||
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
|
||||
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
||||
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
||||
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
|
||||
|
||||
if (basertppayload_class->get_caps)
|
||||
caps = basertppayload_class->get_caps (basertppayload, pad, filter);
|
||||
|
@ -356,7 +356,7 @@ gst_base_rtp_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
|
||||
gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
|
||||
GstEvent * event)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
|
@ -371,13 +371,13 @@ gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
|
|||
break;
|
||||
case GST_EVENT_CAPS:
|
||||
{
|
||||
GstBaseRTPPayloadClass *basertppayload_class;
|
||||
GstRTPBasePayloadClass *basertppayload_class;
|
||||
GstCaps *caps;
|
||||
|
||||
gst_event_parse_caps (event, &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)
|
||||
res = basertppayload_class->set_caps (basertppayload, caps);
|
||||
|
||||
|
@ -406,19 +406,19 @@ gst_base_rtp_payload_event_default (GstBaseRTPPayload * basertppayload,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_rtp_payload_event (GstPad * pad, GstEvent * event)
|
||||
gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
GstBaseRTPPayload *basertppayload;
|
||||
GstBaseRTPPayloadClass *basertppayload_class;
|
||||
GstRTPBasePayload *basertppayload;
|
||||
GstRTPBasePayloadClass *basertppayload_class;
|
||||
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)) {
|
||||
gst_event_unref (event);
|
||||
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)
|
||||
res = basertppayload_class->handle_event (basertppayload, event);
|
||||
|
@ -432,14 +432,14 @@ gst_base_rtp_payload_event (GstPad * pad, GstEvent * event)
|
|||
|
||||
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_payload_chain (GstPad * pad, GstBuffer * buffer)
|
||||
gst_rtp_base_payload_chain (GstPad * pad, GstBuffer * buffer)
|
||||
{
|
||||
GstBaseRTPPayload *basertppayload;
|
||||
GstBaseRTPPayloadClass *basertppayload_class;
|
||||
GstRTPBasePayload *basertppayload;
|
||||
GstRTPBasePayloadClass *basertppayload_class;
|
||||
GstFlowReturn ret;
|
||||
|
||||
basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
|
||||
basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
|
||||
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
||||
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
|
||||
|
||||
if (!basertppayload_class->handle_buffer)
|
||||
goto no_function;
|
||||
|
@ -462,8 +462,8 @@ no_function:
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_payload_set_options:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_payload_set_options:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
* @media: the media type (typically "audio" or "video")
|
||||
* @dynamic: if the payload type is dynamic
|
||||
* @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
|
||||
* 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
|
||||
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,
|
||||
guint32 clock_rate)
|
||||
{
|
||||
|
@ -499,7 +499,7 @@ copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
|
|||
}
|
||||
|
||||
static void
|
||||
update_max_ptime (GstBaseRTPPayload * basertppayload)
|
||||
update_max_ptime (GstRTPBasePayload * basertppayload)
|
||||
{
|
||||
if (basertppayload->priv->caps_max_ptime != -1 &&
|
||||
basertppayload->priv->prop_max_ptime != -1)
|
||||
|
@ -514,8 +514,8 @@ update_max_ptime (GstBaseRTPPayload * basertppayload)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_payload_set_outcaps:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_payload_set_outcaps:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
* @fieldname: the first field name or %NULL
|
||||
* @...: field values
|
||||
*
|
||||
|
@ -527,7 +527,7 @@ update_max_ptime (GstBaseRTPPayload * basertppayload)
|
|||
* Returns: %TRUE if the caps could be set.
|
||||
*/
|
||||
gboolean
|
||||
gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
|
||||
gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload,
|
||||
const gchar * fieldname, ...)
|
||||
{
|
||||
GstCaps *srccaps, *peercaps;
|
||||
|
@ -560,7 +560,7 @@ gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * payload,
|
|||
if (peercaps == NULL) {
|
||||
/* no peer caps, just add the other properties */
|
||||
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,
|
||||
"timestamp-offset", G_TYPE_UINT, payload->ts_base,
|
||||
"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)) {
|
||||
/* 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);
|
||||
} else {
|
||||
if (gst_structure_has_field (s, "payload")) {
|
||||
/* can only fixate if there is a field */
|
||||
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_LOG_OBJECT (payload, "using peer pt %d", pt);
|
||||
} else {
|
||||
/* 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_LOG_OBJECT (payload, "using internal pt %d", pt);
|
||||
}
|
||||
|
@ -664,15 +664,15 @@ gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload * 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);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_payload_is_filled:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_payload_is_filled:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
* @size: the size 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.
|
||||
*/
|
||||
gboolean
|
||||
gst_base_rtp_payload_is_filled (GstBaseRTPPayload * payload,
|
||||
gst_rtp_base_payload_is_filled (GstRTPBasePayload * payload,
|
||||
guint size, GstClockTime duration)
|
||||
{
|
||||
if (size > payload->mtu)
|
||||
|
@ -697,7 +697,7 @@ gst_base_rtp_payload_is_filled (GstBaseRTPPayload * payload,
|
|||
|
||||
typedef struct
|
||||
{
|
||||
GstBaseRTPPayload *payload;
|
||||
GstRTPBasePayload *payload;
|
||||
guint32 ssrc;
|
||||
guint16 seqnum;
|
||||
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
|
||||
* before the buffer is pushed. */
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_payload_prepare_push (GstBaseRTPPayload * payload,
|
||||
gst_rtp_base_payload_prepare_push (GstRTPBasePayload * payload,
|
||||
gpointer obj, gboolean is_list)
|
||||
{
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
GstRTPBasePayloadPrivate *priv;
|
||||
HeaderData data;
|
||||
|
||||
if (payload->clock_rate == 0)
|
||||
|
@ -844,8 +844,8 @@ no_rate:
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_base_rtp_payload_push_list:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_payload_push_list:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
* @list: a #GstBufferList
|
||||
*
|
||||
* Push @list to the peer element of the payloader. The SSRC, payload type,
|
||||
|
@ -858,12 +858,12 @@ no_rate:
|
|||
* Since: 0.10.24
|
||||
*/
|
||||
GstFlowReturn
|
||||
gst_base_rtp_payload_push_list (GstBaseRTPPayload * payload,
|
||||
gst_rtp_base_payload_push_list (GstRTPBasePayload * payload,
|
||||
GstBufferList * list)
|
||||
{
|
||||
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))
|
||||
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:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* gst_rtp_base_payload_push:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
* @buffer: a #GstBuffer
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
GstFlowReturn
|
||||
gst_base_rtp_payload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
|
||||
gst_rtp_base_payload_push (GstRTPBasePayload * payload, GstBuffer * buffer)
|
||||
{
|
||||
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))
|
||||
res = gst_pad_push (payload->srcpad, buffer);
|
||||
|
@ -901,14 +901,14 @@ gst_base_rtp_payload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GstBaseRTPPayload *basertppayload;
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
GstRTPBasePayload *basertppayload;
|
||||
GstRTPBasePayloadPrivate *priv;
|
||||
gint64 val;
|
||||
|
||||
basertppayload = GST_BASE_RTP_PAYLOAD (object);
|
||||
basertppayload = GST_RTP_BASE_PAYLOAD (object);
|
||||
priv = basertppayload->priv;
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -955,13 +955,13 @@ gst_base_rtp_payload_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GstBaseRTPPayload *basertppayload;
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
GstRTPBasePayload *basertppayload;
|
||||
GstRTPBasePayloadPrivate *priv;
|
||||
|
||||
basertppayload = GST_BASE_RTP_PAYLOAD (object);
|
||||
basertppayload = GST_RTP_BASE_PAYLOAD (object);
|
||||
priv = basertppayload->priv;
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -1014,14 +1014,14 @@ gst_base_rtp_payload_get_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static GstStateChangeReturn
|
||||
gst_base_rtp_payload_change_state (GstElement * element,
|
||||
gst_rtp_base_payload_change_state (GstElement * element,
|
||||
GstStateChange transition)
|
||||
{
|
||||
GstBaseRTPPayload *basertppayload;
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
GstRTPBasePayload *basertppayload;
|
||||
GstRTPBasePayloadPrivate *priv;
|
||||
GstStateChangeReturn ret;
|
||||
|
||||
basertppayload = GST_BASE_RTP_PAYLOAD (element);
|
||||
basertppayload = GST_RTP_BASE_PAYLOAD (element);
|
||||
priv = basertppayload->priv;
|
||||
|
||||
switch (transition) {
|
||||
|
|
|
@ -17,63 +17,63 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_BASE_RTP_PAYLOAD_H__
|
||||
#define __GST_BASE_RTP_PAYLOAD_H__
|
||||
#ifndef __GST_RTP_BASE_PAYLOAD_H__
|
||||
#define __GST_RTP_BASE_PAYLOAD_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_BASE_RTP_PAYLOAD \
|
||||
(gst_base_rtp_payload_get_type())
|
||||
#define GST_BASE_RTP_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayload))
|
||||
#define GST_BASE_RTP_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_RTP_PAYLOAD,GstBaseRTPPayloadClass))
|
||||
#define GST_BASE_RTP_PAYLOAD_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BASE_RTP_PAYLOAD, GstBaseRTPPayloadClass))
|
||||
#define GST_IS_BASE_RTP_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_RTP_PAYLOAD))
|
||||
#define GST_IS_BASE_RTP_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_RTP_PAYLOAD))
|
||||
#define GST_BASE_RTP_PAYLOAD_CAST(obj) \
|
||||
((GstBaseRTPPayload*)(obj))
|
||||
#define GST_TYPE_RTP_BASE_PAYLOAD \
|
||||
(gst_rtp_base_payload_get_type())
|
||||
#define GST_RTP_BASE_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_BASE_PAYLOAD,GstRTPBasePayload))
|
||||
#define GST_RTP_BASE_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_BASE_PAYLOAD,GstRTPBasePayloadClass))
|
||||
#define GST_RTP_BASE_PAYLOAD_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_BASE_PAYLOAD, GstRTPBasePayloadClass))
|
||||
#define GST_IS_RTP_BASE_PAYLOAD(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_PAYLOAD))
|
||||
#define GST_IS_RTP_BASE_PAYLOAD_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_PAYLOAD))
|
||||
#define GST_RTP_BASE_PAYLOAD_CAST(obj) \
|
||||
((GstRTPBasePayload*)(obj))
|
||||
|
||||
typedef struct _GstBaseRTPPayload GstBaseRTPPayload;
|
||||
typedef struct _GstBaseRTPPayloadPrivate GstBaseRTPPayloadPrivate;
|
||||
typedef struct _GstBaseRTPPayloadClass GstBaseRTPPayloadClass;
|
||||
typedef struct _GstRTPBasePayload GstRTPBasePayload;
|
||||
typedef struct _GstRTPBasePayloadPrivate GstRTPBasePayloadPrivate;
|
||||
typedef struct _GstRTPBasePayloadClass GstRTPBasePayloadClass;
|
||||
|
||||
/**
|
||||
* GST_BASE_RTP_PAYLOAD_SINKPAD:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* GST_RTP_BASE_PAYLOAD_SINKPAD:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
*
|
||||
* 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:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* GST_RTP_BASE_PAYLOAD_SRCPAD:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
*
|
||||
* 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:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* GST_RTP_BASE_PAYLOAD_PT:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
*
|
||||
* 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:
|
||||
* @payload: a #GstBaseRTPPayload
|
||||
* GST_RTP_BASE_PAYLOAD_MTU:
|
||||
* @payload: a #GstRTPBasePayload
|
||||
*
|
||||
* 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;
|
||||
|
||||
|
@ -104,7 +104,7 @@ struct _GstBaseRTPPayload
|
|||
guint64 min_ptime;
|
||||
|
||||
/*< private >*/
|
||||
GstBaseRTPPayloadPrivate *priv;
|
||||
GstRTPBasePayloadPrivate *priv;
|
||||
|
||||
union {
|
||||
struct {
|
||||
|
@ -116,7 +116,7 @@ struct _GstBaseRTPPayload
|
|||
};
|
||||
|
||||
/**
|
||||
* GstBaseRTPPayloadClass:
|
||||
* GstRTPBasePayloadClass:
|
||||
* @parent_class: the parent class
|
||||
* @set_caps: configure the payloader
|
||||
* @handle_buffer: process data
|
||||
|
@ -125,45 +125,45 @@ struct _GstBaseRTPPayload
|
|||
*
|
||||
* Base class for audio RTP payloader.
|
||||
*/
|
||||
struct _GstBaseRTPPayloadClass
|
||||
struct _GstRTPBasePayloadClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* 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. */
|
||||
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. */
|
||||
GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
|
||||
GstFlowReturn (*handle_buffer) (GstRTPBasePayload *payload,
|
||||
GstBuffer *buffer);
|
||||
gboolean (*handle_event) (GstBaseRTPPayload *payload, GstEvent * event);
|
||||
gboolean (*handle_event) (GstRTPBasePayload *payload, GstEvent * event);
|
||||
|
||||
/*< private >*/
|
||||
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,
|
||||
gboolean dynamic,
|
||||
const gchar *encoding_name,
|
||||
guint32 clock_rate);
|
||||
|
||||
gboolean gst_base_rtp_payload_set_outcaps (GstBaseRTPPayload *payload,
|
||||
gboolean gst_rtp_base_payload_set_outcaps (GstRTPBasePayload *payload,
|
||||
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);
|
||||
|
||||
GstFlowReturn gst_base_rtp_payload_push (GstBaseRTPPayload *payload,
|
||||
GstFlowReturn gst_rtp_base_payload_push (GstRTPBasePayload *payload,
|
||||
GstBuffer *buffer);
|
||||
|
||||
GstFlowReturn gst_base_rtp_payload_push_list (GstBaseRTPPayload *payload,
|
||||
GstFlowReturn gst_rtp_base_payload_push_list (GstRTPBasePayload *payload,
|
||||
GstBufferList *list);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_BASE_RTP_PAYLOAD_H__ */
|
||||
#endif /* __GST_RTP_BASE_PAYLOAD_H__ */
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
/**
|
||||
* SECTION:gstrtcpbuffer
|
||||
* @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.
|
||||
*
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/**
|
||||
* SECTION:gstrtpbuffer
|
||||
* @short_description: Helper methods for dealing with RTP buffers
|
||||
* @see_also: #GstBaseRTPPayload, #GstBaseRTPDepayload, gstrtcpbuffer
|
||||
* @see_also: #GstRTPBasePayload, #GstRTPBaseDepayload, gstrtcpbuffer
|
||||
*
|
||||
* <refsect2>
|
||||
* <para>
|
||||
|
|
Loading…
Reference in a new issue