rename files to match object names

This commit is contained in:
Wim Taymans 2011-11-11 12:32:23 +01:00
parent ccf511a5d4
commit 5f1312b5d8
9 changed files with 221 additions and 221 deletions

View file

@ -1123,8 +1123,8 @@ gst_riff_strh
# rtp
<SECTION>
<FILE>gstbasertpaudiopayload</FILE>
<INCLUDE>gst/rtp/gstbasertpaudiopayload.h</INCLUDE>
<FILE>gstrtpbaseaudiopayload</FILE>
<INCLUDE>gst/rtp/gstrtpbaseaudiopayload.h</INCLUDE>
GstRTPBaseAudioPayload
GstRTPBaseAudioPayloadClass
@ -1148,8 +1148,8 @@ GstRTPBaseAudioPayloadPrivate
</SECTION>
<SECTION>
<FILE>gstbasertpdepayload</FILE>
<INCLUDE>gst/rtp/gstbasertpdepayload.h</INCLUDE>
<FILE>gstrtpbasedepayload</FILE>
<INCLUDE>gst/rtp/gstrtpbasedepayload.h</INCLUDE>
GstRTPBaseDepayload
GstRTPBaseDepayloadClass
@ -1179,8 +1179,8 @@ QUEUE_UNLOCK
</SECTION>
<SECTION>
<FILE>gstbasertppayload</FILE>
<INCLUDE>gst/rtp/gstbasertppayload.h</INCLUDE>
<FILE>gstrtpbasepayload</FILE>
<INCLUDE>gst/rtp/gstrtpbasepayload.h</INCLUDE>
GstRTPBasePayload
GstRTPBasePayloadClass

View file

@ -48,11 +48,11 @@ gst_video_orientation_get_type
gst_video_overlay_get_type
#include <gst/rtp/gstbasertpdepayload.h>
#include <gst/rtp/gstrtpbasedepayload.h>
gst_rtp_base_depayload_get_type
#include <gst/rtp/gstbasertppayload.h>
#include <gst/rtp/gstrtpbasepayload.h>
gst_rtp_base_payload_get_type
#include <gst/rtp/gstbasertpaudiopayload.h>
#include <gst/rtp/gstrtpbaseaudiopayload.h>
gst_rtp_base_audio_payload_get_type

View file

@ -3,18 +3,18 @@ libgstrtpincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/rtp
libgstrtpinclude_HEADERS = gstrtpbuffer.h \
gstrtcpbuffer.h \
gstrtppayloads.h \
gstbasertpaudiopayload.h \
gstbasertppayload.h \
gstbasertpdepayload.h
gstrtpbaseaudiopayload.h \
gstrtpbasepayload.h \
gstrtpbasedepayload.h
lib_LTLIBRARIES = libgstrtp-@GST_MAJORMINOR@.la
libgstrtp_@GST_MAJORMINOR@_la_SOURCES = gstrtpbuffer.c \
gstrtcpbuffer.c \
gstrtppayloads.c \
gstbasertpaudiopayload.c \
gstbasertppayload.c \
gstbasertpdepayload.c
gstrtpbaseaudiopayload.c \
gstrtpbasepayload.c \
gstrtpbasedepayload.c
libgstrtp_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstrtp_@GST_MAJORMINOR@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)

View file

@ -18,7 +18,7 @@
*/
/**
* SECTION:gstbasertpaudiopayload
* SECTION:gstrtpbaseaudiopayload
* @short_description: Base class for audio RTP payloader
*
* Provides a base class for audio RTP payloaders for frame or sample based
@ -63,10 +63,10 @@
#include <gst/rtp/gstrtpbuffer.h>
#include <gst/base/gstadapter.h>
#include "gstbasertpaudiopayload.h"
#include "gstrtpbaseaudiopayload.h"
GST_DEBUG_CATEGORY_STATIC (basertpaudiopayload_debug);
#define GST_CAT_DEFAULT (basertpaudiopayload_debug)
GST_DEBUG_CATEGORY_STATIC (rtpbaseaudiopayload_debug);
#define GST_CAT_DEFAULT (rtpbaseaudiopayload_debug)
#define DEFAULT_BUFFER_LIST FALSE
@ -166,13 +166,13 @@ gst_rtp_base_audio_payload_class_init (GstRTPBaseAudioPayloadClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstRTPBasePayloadClass *gstbasertppayload_class;
GstRTPBasePayloadClass *gstrtpbasepayload_class;
g_type_class_add_private (klass, sizeof (GstRTPBaseAudioPayloadPrivate));
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstRTPBasePayloadClass *) klass;
gstrtpbasepayload_class = (GstRTPBasePayloadClass *) klass;
gobject_class->finalize = gst_rtp_base_audio_payload_finalize;
gobject_class->set_property = gst_rtp_base_audio_payload_set_property;
@ -186,12 +186,12 @@ gst_rtp_base_audio_payload_class_init (GstRTPBaseAudioPayloadClass * klass)
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_rtp_base_payload_audio_change_state);
gstbasertppayload_class->handle_buffer =
gstrtpbasepayload_class->handle_buffer =
GST_DEBUG_FUNCPTR (gst_rtp_base_audio_payload_handle_buffer);
gstbasertppayload_class->handle_event =
gstrtpbasepayload_class->handle_event =
GST_DEBUG_FUNCPTR (gst_rtp_base_payload_audio_handle_event);
GST_DEBUG_CATEGORY_INIT (basertpaudiopayload_debug, "basertpaudiopayload", 0,
GST_DEBUG_CATEGORY_INIT (rtpbaseaudiopayload_debug, "rtpbaseaudiopayload", 0,
"base audio RTP payloader");
}
@ -262,55 +262,55 @@ gst_rtp_base_audio_payload_get_property (GObject * object,
/**
* gst_rtp_base_audio_payload_set_frame_based:
* @basertpaudiopayload: a pointer to the element.
* @rtpbaseaudiopayload: a pointer to the element.
*
* Tells #GstRTPBaseAudioPayload that the child element is for a frame based
* audio codec
*/
void
gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *
basertpaudiopayload)
rtpbaseaudiopayload)
{
g_return_if_fail (basertpaudiopayload != NULL);
g_return_if_fail (basertpaudiopayload->priv->time_to_bytes == NULL);
g_return_if_fail (basertpaudiopayload->priv->bytes_to_time == NULL);
g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == NULL);
g_return_if_fail (rtpbaseaudiopayload != NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->time_to_bytes == NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_time == NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_rtptime == NULL);
basertpaudiopayload->priv->bytes_to_time =
rtpbaseaudiopayload->priv->bytes_to_time =
gst_rtp_base_audio_payload_frame_bytes_to_time;
basertpaudiopayload->priv->bytes_to_rtptime =
rtpbaseaudiopayload->priv->bytes_to_rtptime =
gst_rtp_base_audio_payload_frame_bytes_to_rtptime;
basertpaudiopayload->priv->time_to_bytes =
rtpbaseaudiopayload->priv->time_to_bytes =
gst_rtp_base_audio_payload_frame_time_to_bytes;
}
/**
* gst_rtp_base_audio_payload_set_sample_based:
* @basertpaudiopayload: a pointer to the element.
* @rtpbaseaudiopayload: a pointer to the element.
*
* Tells #GstRTPBaseAudioPayload that the child element is for a sample based
* audio codec
*/
void
gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
basertpaudiopayload)
rtpbaseaudiopayload)
{
g_return_if_fail (basertpaudiopayload != NULL);
g_return_if_fail (basertpaudiopayload->priv->time_to_bytes == NULL);
g_return_if_fail (basertpaudiopayload->priv->bytes_to_time == NULL);
g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == NULL);
g_return_if_fail (rtpbaseaudiopayload != NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->time_to_bytes == NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_time == NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_rtptime == NULL);
basertpaudiopayload->priv->bytes_to_time =
rtpbaseaudiopayload->priv->bytes_to_time =
gst_rtp_base_audio_payload_sample_bytes_to_time;
basertpaudiopayload->priv->bytes_to_rtptime =
rtpbaseaudiopayload->priv->bytes_to_rtptime =
gst_rtp_base_audio_payload_sample_bytes_to_rtptime;
basertpaudiopayload->priv->time_to_bytes =
rtpbaseaudiopayload->priv->time_to_bytes =
gst_rtp_base_audio_payload_sample_time_to_bytes;
}
/**
* gst_rtp_base_audio_payload_set_frame_options:
* @basertpaudiopayload: a pointer to the element.
* @rtpbaseaudiopayload: 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.
*
@ -319,46 +319,46 @@ gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
*/
void
gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload
* basertpaudiopayload, gint frame_duration, gint frame_size)
* rtpbaseaudiopayload, gint frame_duration, gint frame_size)
{
GstRTPBaseAudioPayloadPrivate *priv;
g_return_if_fail (basertpaudiopayload != NULL);
g_return_if_fail (rtpbaseaudiopayload != NULL);
priv = basertpaudiopayload->priv;
priv = rtpbaseaudiopayload->priv;
basertpaudiopayload->frame_duration = frame_duration;
rtpbaseaudiopayload->frame_duration = frame_duration;
priv->frame_duration_ns = frame_duration * GST_MSECOND;
basertpaudiopayload->frame_size = frame_size;
rtpbaseaudiopayload->frame_size = frame_size;
priv->align = frame_size;
gst_adapter_clear (priv->adapter);
GST_DEBUG_OBJECT (basertpaudiopayload, "frame set to %d ms and size %d",
GST_DEBUG_OBJECT (rtpbaseaudiopayload, "frame set to %d ms and size %d",
frame_duration, frame_size);
}
/**
* gst_rtp_base_audio_payload_set_sample_options:
* @basertpaudiopayload: a pointer to the element.
* @rtpbaseaudiopayload: a pointer to the element.
* @sample_size: Size per sample in bytes.
*
* Sets the options for sample based audio codecs.
*/
void
gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload
* basertpaudiopayload, gint sample_size)
* rtpbaseaudiopayload, gint sample_size)
{
g_return_if_fail (basertpaudiopayload != NULL);
g_return_if_fail (rtpbaseaudiopayload != NULL);
/* sample_size is in bits internally */
gst_rtp_base_audio_payload_set_samplebits_options (basertpaudiopayload,
gst_rtp_base_audio_payload_set_samplebits_options (rtpbaseaudiopayload,
sample_size * 8);
}
/**
* gst_rtp_base_audio_payload_set_samplebits_options:
* @basertpaudiopayload: a pointer to the element.
* @rtpbaseaudiopayload: a pointer to the element.
* @sample_size: Size per sample in bits.
*
* Sets the options for sample based audio codecs.
@ -367,16 +367,16 @@ gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload
*/
void
gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
* basertpaudiopayload, gint sample_size)
* rtpbaseaudiopayload, gint sample_size)
{
guint fragment_size;
GstRTPBaseAudioPayloadPrivate *priv;
g_return_if_fail (basertpaudiopayload != NULL);
g_return_if_fail (rtpbaseaudiopayload != NULL);
priv = basertpaudiopayload->priv;
priv = rtpbaseaudiopayload->priv;
basertpaudiopayload->sample_size = sample_size;
rtpbaseaudiopayload->sample_size = sample_size;
/* sample_size is in bits and is converted into multiple bytes */
fragment_size = sample_size;
@ -387,7 +387,7 @@ gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
gst_adapter_clear (priv->adapter);
GST_DEBUG_OBJECT (basertpaudiopayload,
GST_DEBUG_OBJECT (rtpbaseaudiopayload,
"Samplebits set to sample size %d bits", sample_size);
}
@ -922,16 +922,16 @@ static GstStateChangeReturn
gst_rtp_base_payload_audio_change_state (GstElement * element,
GstStateChange transition)
{
GstRTPBaseAudioPayload *basertppayload;
GstRTPBaseAudioPayload *rtpbasepayload;
GstStateChangeReturn ret;
basertppayload = GST_RTP_BASE_AUDIO_PAYLOAD (element);
rtpbasepayload = GST_RTP_BASE_AUDIO_PAYLOAD (element);
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
basertppayload->priv->cached_mtu = -1;
basertppayload->priv->last_rtptime = -1;
basertppayload->priv->last_timestamp = -1;
rtpbasepayload->priv->cached_mtu = -1;
rtpbasepayload->priv->last_rtptime = -1;
rtpbasepayload->priv->last_timestamp = -1;
break;
default:
break;
@ -941,7 +941,7 @@ gst_rtp_base_payload_audio_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_adapter_clear (basertppayload->priv->adapter);
gst_adapter_clear (rtpbasepayload->priv->adapter);
break;
default:
break;
@ -979,7 +979,7 @@ gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload * basep,
/**
* gst_rtp_base_audio_payload_get_adapter:
* @basertpaudiopayload: a #GstRTPBaseAudioPayload
* @rtpbaseaudiopayload: a #GstRTPBaseAudioPayload
*
* Gets the internal adapter used by the depayloader.
*
@ -989,11 +989,11 @@ gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload * basep,
*/
GstAdapter *
gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload
* basertpaudiopayload)
* rtpbaseaudiopayload)
{
GstAdapter *adapter;
if ((adapter = basertpaudiopayload->priv->adapter))
if ((adapter = rtpbaseaudiopayload->priv->adapter))
g_object_ref (adapter);
return adapter;

View file

@ -21,7 +21,7 @@
#define __GST_RTP_BASE_AUDIO_PAYLOAD_H__
#include <gst/gst.h>
#include <gst/rtp/gstbasertppayload.h>
#include <gst/rtp/gstrtpbasepayload.h>
#include <gst/base/gstadapter.h>
G_BEGIN_DECLS
@ -78,20 +78,20 @@ struct _GstRTPBaseAudioPayloadClass
GType gst_rtp_base_audio_payload_get_type (void);
/* configure frame based */
void gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *basertpaudiopayload);
void gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
void gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload *basertpaudiopayload,
void gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
gint frame_duration, gint frame_size);
/* configure sample based */
void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *basertpaudiopayload);
void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *basertpaudiopayload,
void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
gint sample_size);
void gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload *basertpaudiopayload,
void gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
gint sample_size);
/* get the internal adapter */
GstAdapter* gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload *basertpaudiopayload);
GstAdapter* gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
/* push and flushing data */
GstFlowReturn gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,

View file

@ -19,16 +19,16 @@
*/
/**
* SECTION:gstbasertpdepayload
* SECTION:gstrtpbasedepayload
* @short_description: Base class for RTP depayloader
*
* Provides a base class for RTP depayloaders
*/
#include "gstbasertpdepayload.h"
#include "gstrtpbasedepayload.h"
GST_DEBUG_CATEGORY_STATIC (basertpdepayload_debug);
#define GST_CAT_DEFAULT (basertpdepayload_debug)
GST_DEBUG_CATEGORY_STATIC (rtpbasedepayload_debug);
#define GST_CAT_DEFAULT (rtpbasedepayload_debug)
#define GST_RTP_BASE_DEPAYLOAD_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_DEPAYLOAD, GstRTPBaseDepayloadPrivate))
@ -85,7 +85,7 @@ static gboolean gst_rtp_base_depayload_handle_event (GstRTPBaseDepayload *
static GstElementClass *parent_class = NULL;
static void gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass *
klass);
static void gst_rtp_base_depayload_init (GstRTPBaseDepayload * basertppayload,
static void gst_rtp_base_depayload_init (GstRTPBaseDepayload * rtpbasepayload,
GstRTPBaseDepayloadClass * klass);
GType
@ -134,7 +134,7 @@ gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass * klass)
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,
GST_DEBUG_CATEGORY_INIT (rtpbasedepayload_debug, "rtpbasedepayload", 0,
"Base class for RTP Depayloaders");
}

View file

@ -13,7 +13,7 @@
*/
/**
* SECTION:gstbasertppayload
* SECTION:gstrtpbasepayload
* @short_description: Base class for RTP payloader
*
* Provides a base class for RTP payloaders
@ -27,10 +27,10 @@
#include <gst/rtp/gstrtpbuffer.h>
#include "gstbasertppayload.h"
#include "gstrtpbasepayload.h"
GST_DEBUG_CATEGORY_STATIC (basertppayload_debug);
#define GST_CAT_DEFAULT (basertppayload_debug)
GST_DEBUG_CATEGORY_STATIC (rtpbasepayload_debug);
#define GST_CAT_DEFAULT (rtpbasepayload_debug)
#define GST_RTP_BASE_PAYLOAD_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_PAYLOAD, GstRTPBasePayloadPrivate))
@ -92,19 +92,19 @@ enum
};
static void gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass);
static void gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload,
static void gst_rtp_base_payload_init (GstRTPBasePayload * rtpbasepayload,
gpointer g_class);
static void gst_rtp_base_payload_finalize (GObject * object);
static GstCaps *gst_rtp_base_payload_sink_getcaps (GstPad * pad,
GstCaps * filter);
static gboolean gst_rtp_base_payload_event_default (GstRTPBasePayload *
basertppayload, GstEvent * event);
rtpbasepayload, GstEvent * event);
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_rtp_base_payload_getcaps_default (GstRTPBasePayload *
basertppayload, GstPad * pad, GstCaps * filter);
rtpbasepayload, GstPad * pad, GstCaps * filter);
static void gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
@ -121,10 +121,10 @@ static GstElementClass *parent_class = NULL;
GType
gst_rtp_base_payload_get_type (void)
{
static GType basertppayload_type = 0;
static GType rtpbasepayload_type = 0;
if (g_once_init_enter ((gsize *) & basertppayload_type)) {
static const GTypeInfo basertppayload_info = {
if (g_once_init_enter ((gsize *) & rtpbasepayload_type)) {
static const GTypeInfo rtpbasepayload_info = {
sizeof (GstRTPBasePayloadClass),
NULL,
NULL,
@ -136,11 +136,11 @@ gst_rtp_base_payload_get_type (void)
(GInstanceInitFunc) gst_rtp_base_payload_init,
};
g_once_init_leave ((gsize *) & basertppayload_type,
g_once_init_leave ((gsize *) & rtpbasepayload_type,
g_type_register_static (GST_TYPE_ELEMENT, "GstRTPBasePayload",
&basertppayload_info, G_TYPE_FLAG_ABSTRACT));
&rtpbasepayload_info, G_TYPE_FLAG_ABSTRACT));
}
return basertppayload_type;
return rtpbasepayload_type;
}
static void
@ -243,81 +243,81 @@ gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass)
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,
GST_DEBUG_CATEGORY_INIT (rtpbasepayload_debug, "rtpbasepayload", 0,
"Base class for RTP Payloaders");
}
static void
gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload, gpointer g_class)
gst_rtp_base_payload_init (GstRTPBasePayload * rtpbasepayload, gpointer g_class)
{
GstPadTemplate *templ;
GstRTPBasePayloadPrivate *priv;
basertppayload->priv = priv =
GST_RTP_BASE_PAYLOAD_GET_PRIVATE (basertppayload);
rtpbasepayload->priv = priv =
GST_RTP_BASE_PAYLOAD_GET_PRIVATE (rtpbasepayload);
templ =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
g_return_if_fail (templ != NULL);
basertppayload->srcpad = gst_pad_new_from_template (templ, "src");
gst_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->srcpad);
rtpbasepayload->srcpad = gst_pad_new_from_template (templ, "src");
gst_element_add_pad (GST_ELEMENT (rtpbasepayload), rtpbasepayload->srcpad);
templ =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
g_return_if_fail (templ != NULL);
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
gst_pad_set_getcaps_function (basertppayload->sinkpad,
rtpbasepayload->sinkpad = gst_pad_new_from_template (templ, "sink");
gst_pad_set_getcaps_function (rtpbasepayload->sinkpad,
gst_rtp_base_payload_sink_getcaps);
gst_pad_set_event_function (basertppayload->sinkpad,
gst_pad_set_event_function (rtpbasepayload->sinkpad,
gst_rtp_base_payload_event);
gst_pad_set_chain_function (basertppayload->sinkpad,
gst_pad_set_chain_function (rtpbasepayload->sinkpad,
gst_rtp_base_payload_chain);
gst_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->sinkpad);
gst_element_add_pad (GST_ELEMENT (rtpbasepayload), rtpbasepayload->sinkpad);
basertppayload->mtu = DEFAULT_MTU;
basertppayload->pt = DEFAULT_PT;
basertppayload->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
basertppayload->ssrc = DEFAULT_SSRC;
basertppayload->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
priv->seqnum_offset_random = (basertppayload->seqnum_offset == -1);
priv->ts_offset_random = (basertppayload->ts_offset == -1);
priv->ssrc_random = (basertppayload->ssrc == -1);
rtpbasepayload->mtu = DEFAULT_MTU;
rtpbasepayload->pt = DEFAULT_PT;
rtpbasepayload->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
rtpbasepayload->ssrc = DEFAULT_SSRC;
rtpbasepayload->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
priv->seqnum_offset_random = (rtpbasepayload->seqnum_offset == -1);
priv->ts_offset_random = (rtpbasepayload->ts_offset == -1);
priv->ssrc_random = (rtpbasepayload->ssrc == -1);
basertppayload->max_ptime = DEFAULT_MAX_PTIME;
basertppayload->min_ptime = DEFAULT_MIN_PTIME;
basertppayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
basertppayload->abidata.ABI.ptime_multiple = DEFAULT_PTIME_MULTIPLE;
basertppayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
basertppayload->priv->base_rtime = GST_BUFFER_OFFSET_NONE;
rtpbasepayload->max_ptime = DEFAULT_MAX_PTIME;
rtpbasepayload->min_ptime = DEFAULT_MIN_PTIME;
rtpbasepayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
rtpbasepayload->abidata.ABI.ptime_multiple = DEFAULT_PTIME_MULTIPLE;
rtpbasepayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
rtpbasepayload->priv->base_rtime = GST_BUFFER_OFFSET_NONE;
basertppayload->media = NULL;
basertppayload->encoding_name = NULL;
rtpbasepayload->media = NULL;
rtpbasepayload->encoding_name = NULL;
basertppayload->clock_rate = 0;
rtpbasepayload->clock_rate = 0;
basertppayload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
basertppayload->priv->prop_max_ptime = DEFAULT_MAX_PTIME;
rtpbasepayload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
rtpbasepayload->priv->prop_max_ptime = DEFAULT_MAX_PTIME;
}
static void
gst_rtp_base_payload_finalize (GObject * object)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayload *rtpbasepayload;
basertppayload = GST_RTP_BASE_PAYLOAD (object);
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
g_free (basertppayload->media);
basertppayload->media = NULL;
g_free (basertppayload->encoding_name);
basertppayload->encoding_name = NULL;
g_free (rtpbasepayload->media);
rtpbasepayload->media = NULL;
g_free (rtpbasepayload->encoding_name);
rtpbasepayload->encoding_name = NULL;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static GstCaps *
gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * basertppayload,
gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * rtpbasepayload,
GstPad * pad, GstCaps * filter)
{
GstCaps *caps;
@ -338,48 +338,48 @@ gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * basertppayload,
static GstCaps *
gst_rtp_base_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayloadClass *basertppayload_class;
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadClass *rtpbasepayload_class;
GstCaps *caps = NULL;
GST_DEBUG_OBJECT (pad, "getting caps");
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
rtpbasepayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
if (basertppayload_class->get_caps)
caps = basertppayload_class->get_caps (basertppayload, pad, filter);
if (rtpbasepayload_class->get_caps)
caps = rtpbasepayload_class->get_caps (rtpbasepayload, pad, filter);
gst_object_unref (basertppayload);
gst_object_unref (rtpbasepayload);
return caps;
}
static gboolean
gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
gst_rtp_base_payload_event_default (GstRTPBasePayload * rtpbasepayload,
GstEvent * event)
{
gboolean res = FALSE;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
res = gst_pad_event_default (basertppayload->sinkpad, event);
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
break;
case GST_EVENT_FLUSH_STOP:
res = gst_pad_event_default (basertppayload->sinkpad, event);
gst_segment_init (&basertppayload->segment, GST_FORMAT_UNDEFINED);
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
gst_segment_init (&rtpbasepayload->segment, GST_FORMAT_UNDEFINED);
break;
case GST_EVENT_CAPS:
{
GstRTPBasePayloadClass *basertppayload_class;
GstRTPBasePayloadClass *rtpbasepayload_class;
GstCaps *caps;
gst_event_parse_caps (event, &caps);
GST_DEBUG_OBJECT (basertppayload, "setting caps %" GST_PTR_FORMAT, caps);
GST_DEBUG_OBJECT (rtpbasepayload, "setting caps %" GST_PTR_FORMAT, caps);
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
if (basertppayload_class->set_caps)
res = basertppayload_class->set_caps (basertppayload, caps);
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
if (rtpbasepayload_class->set_caps)
res = rtpbasepayload_class->set_caps (rtpbasepayload, caps);
gst_event_unref (event);
break;
@ -388,18 +388,18 @@ gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
{
GstSegment *segment;
segment = &basertppayload->segment;
segment = &rtpbasepayload->segment;
gst_event_copy_segment (event, segment);
basertppayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
rtpbasepayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
GST_DEBUG_OBJECT (basertppayload,
GST_DEBUG_OBJECT (rtpbasepayload,
"configured SEGMENT %" GST_SEGMENT_FORMAT, segment);
res = gst_pad_event_default (basertppayload->sinkpad, event);
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
break;
}
default:
res = gst_pad_event_default (basertppayload->sinkpad, event);
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
break;
}
return res;
@ -408,24 +408,24 @@ gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
static gboolean
gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayloadClass *basertppayload_class;
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadClass *rtpbasepayload_class;
gboolean res = FALSE;
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
if (G_UNLIKELY (basertppayload == NULL)) {
rtpbasepayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
if (G_UNLIKELY (rtpbasepayload == NULL)) {
gst_event_unref (event);
return FALSE;
}
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
if (basertppayload_class->handle_event)
res = basertppayload_class->handle_event (basertppayload, event);
if (rtpbasepayload_class->handle_event)
res = rtpbasepayload_class->handle_event (rtpbasepayload, event);
else
gst_event_unref (event);
gst_object_unref (basertppayload);
gst_object_unref (rtpbasepayload);
return res;
}
@ -434,28 +434,28 @@ gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
static GstFlowReturn
gst_rtp_base_payload_chain (GstPad * pad, GstBuffer * buffer)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayloadClass *basertppayload_class;
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadClass *rtpbasepayload_class;
GstFlowReturn ret;
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
rtpbasepayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
if (!basertppayload_class->handle_buffer)
if (!rtpbasepayload_class->handle_buffer)
goto no_function;
ret = basertppayload_class->handle_buffer (basertppayload, buffer);
ret = rtpbasepayload_class->handle_buffer (rtpbasepayload, buffer);
gst_object_unref (basertppayload);
gst_object_unref (rtpbasepayload);
return ret;
/* ERRORS */
no_function:
{
GST_ELEMENT_ERROR (basertppayload, STREAM, NOT_IMPLEMENTED, (NULL),
GST_ELEMENT_ERROR (rtpbasepayload, STREAM, NOT_IMPLEMENTED, (NULL),
("subclass did not implement handle_buffer function"));
gst_object_unref (basertppayload);
gst_object_unref (rtpbasepayload);
gst_buffer_unref (buffer);
return GST_FLOW_ERROR;
}
@ -499,18 +499,18 @@ copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
}
static void
update_max_ptime (GstRTPBasePayload * basertppayload)
update_max_ptime (GstRTPBasePayload * rtpbasepayload)
{
if (basertppayload->priv->caps_max_ptime != -1 &&
basertppayload->priv->prop_max_ptime != -1)
basertppayload->max_ptime = MIN (basertppayload->priv->caps_max_ptime,
basertppayload->priv->prop_max_ptime);
else if (basertppayload->priv->caps_max_ptime != -1)
basertppayload->max_ptime = basertppayload->priv->caps_max_ptime;
else if (basertppayload->priv->prop_max_ptime != -1)
basertppayload->max_ptime = basertppayload->priv->prop_max_ptime;
if (rtpbasepayload->priv->caps_max_ptime != -1 &&
rtpbasepayload->priv->prop_max_ptime != -1)
rtpbasepayload->max_ptime = MIN (rtpbasepayload->priv->caps_max_ptime,
rtpbasepayload->priv->prop_max_ptime);
else if (rtpbasepayload->priv->caps_max_ptime != -1)
rtpbasepayload->max_ptime = rtpbasepayload->priv->caps_max_ptime;
else if (rtpbasepayload->priv->prop_max_ptime != -1)
rtpbasepayload->max_ptime = rtpbasepayload->priv->prop_max_ptime;
else
basertppayload->max_ptime = DEFAULT_MAX_PTIME;
rtpbasepayload->max_ptime = DEFAULT_MAX_PTIME;
}
/**
@ -904,49 +904,49 @@ static void
gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadPrivate *priv;
gint64 val;
basertppayload = GST_RTP_BASE_PAYLOAD (object);
priv = basertppayload->priv;
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
priv = rtpbasepayload->priv;
switch (prop_id) {
case PROP_MTU:
basertppayload->mtu = g_value_get_uint (value);
rtpbasepayload->mtu = g_value_get_uint (value);
break;
case PROP_PT:
basertppayload->pt = g_value_get_uint (value);
rtpbasepayload->pt = g_value_get_uint (value);
break;
case PROP_SSRC:
val = g_value_get_uint (value);
basertppayload->ssrc = val;
rtpbasepayload->ssrc = val;
priv->ssrc_random = FALSE;
break;
case PROP_TIMESTAMP_OFFSET:
val = g_value_get_uint (value);
basertppayload->ts_offset = val;
rtpbasepayload->ts_offset = val;
priv->ts_offset_random = FALSE;
break;
case PROP_SEQNUM_OFFSET:
val = g_value_get_int (value);
basertppayload->seqnum_offset = val;
rtpbasepayload->seqnum_offset = val;
priv->seqnum_offset_random = (val == -1);
GST_DEBUG_OBJECT (basertppayload, "seqnum offset 0x%04x, random %d",
basertppayload->seqnum_offset, priv->seqnum_offset_random);
GST_DEBUG_OBJECT (rtpbasepayload, "seqnum offset 0x%04x, random %d",
rtpbasepayload->seqnum_offset, priv->seqnum_offset_random);
break;
case PROP_MAX_PTIME:
basertppayload->priv->prop_max_ptime = g_value_get_int64 (value);
update_max_ptime (basertppayload);
rtpbasepayload->priv->prop_max_ptime = g_value_get_int64 (value);
update_max_ptime (rtpbasepayload);
break;
case PROP_MIN_PTIME:
basertppayload->min_ptime = g_value_get_int64 (value);
rtpbasepayload->min_ptime = g_value_get_int64 (value);
break;
case PROP_PERFECT_RTPTIME:
priv->perfect_rtptime = g_value_get_boolean (value);
break;
case PROP_PTIME_MULTIPLE:
basertppayload->abidata.ABI.ptime_multiple = g_value_get_int64 (value);
rtpbasepayload->abidata.ABI.ptime_multiple = g_value_get_int64 (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -958,54 +958,54 @@ static void
gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadPrivate *priv;
basertppayload = GST_RTP_BASE_PAYLOAD (object);
priv = basertppayload->priv;
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
priv = rtpbasepayload->priv;
switch (prop_id) {
case PROP_MTU:
g_value_set_uint (value, basertppayload->mtu);
g_value_set_uint (value, rtpbasepayload->mtu);
break;
case PROP_PT:
g_value_set_uint (value, basertppayload->pt);
g_value_set_uint (value, rtpbasepayload->pt);
break;
case PROP_SSRC:
if (priv->ssrc_random)
g_value_set_uint (value, -1);
else
g_value_set_uint (value, basertppayload->ssrc);
g_value_set_uint (value, rtpbasepayload->ssrc);
break;
case PROP_TIMESTAMP_OFFSET:
if (priv->ts_offset_random)
g_value_set_uint (value, -1);
else
g_value_set_uint (value, (guint32) basertppayload->ts_offset);
g_value_set_uint (value, (guint32) rtpbasepayload->ts_offset);
break;
case PROP_SEQNUM_OFFSET:
if (priv->seqnum_offset_random)
g_value_set_int (value, -1);
else
g_value_set_int (value, (guint16) basertppayload->seqnum_offset);
g_value_set_int (value, (guint16) rtpbasepayload->seqnum_offset);
break;
case PROP_MAX_PTIME:
g_value_set_int64 (value, basertppayload->max_ptime);
g_value_set_int64 (value, rtpbasepayload->max_ptime);
break;
case PROP_MIN_PTIME:
g_value_set_int64 (value, basertppayload->min_ptime);
g_value_set_int64 (value, rtpbasepayload->min_ptime);
break;
case PROP_TIMESTAMP:
g_value_set_uint (value, basertppayload->timestamp);
g_value_set_uint (value, rtpbasepayload->timestamp);
break;
case PROP_SEQNUM:
g_value_set_uint (value, basertppayload->seqnum);
g_value_set_uint (value, rtpbasepayload->seqnum);
break;
case PROP_PERFECT_RTPTIME:
g_value_set_boolean (value, priv->perfect_rtptime);
break;
case PROP_PTIME_MULTIPLE:
g_value_set_int64 (value, basertppayload->abidata.ABI.ptime_multiple);
g_value_set_int64 (value, rtpbasepayload->abidata.ABI.ptime_multiple);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -1017,37 +1017,37 @@ static GstStateChangeReturn
gst_rtp_base_payload_change_state (GstElement * element,
GstStateChange transition)
{
GstRTPBasePayload *basertppayload;
GstRTPBasePayload *rtpbasepayload;
GstRTPBasePayloadPrivate *priv;
GstStateChangeReturn ret;
basertppayload = GST_RTP_BASE_PAYLOAD (element);
priv = basertppayload->priv;
rtpbasepayload = GST_RTP_BASE_PAYLOAD (element);
priv = rtpbasepayload->priv;
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_segment_init (&basertppayload->segment, GST_FORMAT_UNDEFINED);
gst_segment_init (&rtpbasepayload->segment, GST_FORMAT_UNDEFINED);
if (priv->seqnum_offset_random)
basertppayload->seqnum_base = g_random_int_range (0, G_MAXUINT16);
rtpbasepayload->seqnum_base = g_random_int_range (0, G_MAXUINT16);
else
basertppayload->seqnum_base = basertppayload->seqnum_offset;
priv->next_seqnum = basertppayload->seqnum_base;
basertppayload->seqnum = basertppayload->seqnum_base;
rtpbasepayload->seqnum_base = rtpbasepayload->seqnum_offset;
priv->next_seqnum = rtpbasepayload->seqnum_base;
rtpbasepayload->seqnum = rtpbasepayload->seqnum_base;
if (priv->ssrc_random)
basertppayload->current_ssrc = g_random_int ();
rtpbasepayload->current_ssrc = g_random_int ();
else
basertppayload->current_ssrc = basertppayload->ssrc;
rtpbasepayload->current_ssrc = rtpbasepayload->ssrc;
if (priv->ts_offset_random)
basertppayload->ts_base = g_random_int ();
rtpbasepayload->ts_base = g_random_int ();
else
basertppayload->ts_base = basertppayload->ts_offset;
basertppayload->timestamp = basertppayload->ts_base;
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
rtpbasepayload->ts_base = rtpbasepayload->ts_offset;
rtpbasepayload->timestamp = rtpbasepayload->ts_base;
g_atomic_int_set (&rtpbasepayload->priv->notified_first_timestamp, 1);
priv->base_offset = GST_BUFFER_OFFSET_NONE;
break;
default:
@ -1058,7 +1058,7 @@ gst_rtp_base_payload_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
g_atomic_int_set (&rtpbasepayload->priv->notified_first_timestamp, 1);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
break;