mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rename files to match object names
This commit is contained in:
parent
ccf511a5d4
commit
5f1312b5d8
9 changed files with 221 additions and 221 deletions
|
@ -1123,8 +1123,8 @@ gst_riff_strh
|
||||||
# rtp
|
# rtp
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gstbasertpaudiopayload</FILE>
|
<FILE>gstrtpbaseaudiopayload</FILE>
|
||||||
<INCLUDE>gst/rtp/gstbasertpaudiopayload.h</INCLUDE>
|
<INCLUDE>gst/rtp/gstrtpbaseaudiopayload.h</INCLUDE>
|
||||||
GstRTPBaseAudioPayload
|
GstRTPBaseAudioPayload
|
||||||
GstRTPBaseAudioPayloadClass
|
GstRTPBaseAudioPayloadClass
|
||||||
|
|
||||||
|
@ -1148,8 +1148,8 @@ GstRTPBaseAudioPayloadPrivate
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gstbasertpdepayload</FILE>
|
<FILE>gstrtpbasedepayload</FILE>
|
||||||
<INCLUDE>gst/rtp/gstbasertpdepayload.h</INCLUDE>
|
<INCLUDE>gst/rtp/gstrtpbasedepayload.h</INCLUDE>
|
||||||
GstRTPBaseDepayload
|
GstRTPBaseDepayload
|
||||||
GstRTPBaseDepayloadClass
|
GstRTPBaseDepayloadClass
|
||||||
|
|
||||||
|
@ -1179,8 +1179,8 @@ QUEUE_UNLOCK
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gstbasertppayload</FILE>
|
<FILE>gstrtpbasepayload</FILE>
|
||||||
<INCLUDE>gst/rtp/gstbasertppayload.h</INCLUDE>
|
<INCLUDE>gst/rtp/gstrtpbasepayload.h</INCLUDE>
|
||||||
GstRTPBasePayload
|
GstRTPBasePayload
|
||||||
GstRTPBasePayloadClass
|
GstRTPBasePayloadClass
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,11 @@ gst_video_orientation_get_type
|
||||||
gst_video_overlay_get_type
|
gst_video_overlay_get_type
|
||||||
|
|
||||||
|
|
||||||
#include <gst/rtp/gstbasertpdepayload.h>
|
#include <gst/rtp/gstrtpbasedepayload.h>
|
||||||
gst_rtp_base_depayload_get_type
|
gst_rtp_base_depayload_get_type
|
||||||
#include <gst/rtp/gstbasertppayload.h>
|
#include <gst/rtp/gstrtpbasepayload.h>
|
||||||
gst_rtp_base_payload_get_type
|
gst_rtp_base_payload_get_type
|
||||||
#include <gst/rtp/gstbasertpaudiopayload.h>
|
#include <gst/rtp/gstrtpbaseaudiopayload.h>
|
||||||
gst_rtp_base_audio_payload_get_type
|
gst_rtp_base_audio_payload_get_type
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,18 +3,18 @@ libgstrtpincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/rtp
|
||||||
libgstrtpinclude_HEADERS = gstrtpbuffer.h \
|
libgstrtpinclude_HEADERS = gstrtpbuffer.h \
|
||||||
gstrtcpbuffer.h \
|
gstrtcpbuffer.h \
|
||||||
gstrtppayloads.h \
|
gstrtppayloads.h \
|
||||||
gstbasertpaudiopayload.h \
|
gstrtpbaseaudiopayload.h \
|
||||||
gstbasertppayload.h \
|
gstrtpbasepayload.h \
|
||||||
gstbasertpdepayload.h
|
gstrtpbasedepayload.h
|
||||||
|
|
||||||
lib_LTLIBRARIES = libgstrtp-@GST_MAJORMINOR@.la
|
lib_LTLIBRARIES = libgstrtp-@GST_MAJORMINOR@.la
|
||||||
|
|
||||||
libgstrtp_@GST_MAJORMINOR@_la_SOURCES = gstrtpbuffer.c \
|
libgstrtp_@GST_MAJORMINOR@_la_SOURCES = gstrtpbuffer.c \
|
||||||
gstrtcpbuffer.c \
|
gstrtcpbuffer.c \
|
||||||
gstrtppayloads.c \
|
gstrtppayloads.c \
|
||||||
gstbasertpaudiopayload.c \
|
gstrtpbaseaudiopayload.c \
|
||||||
gstbasertppayload.c \
|
gstrtpbasepayload.c \
|
||||||
gstbasertpdepayload.c
|
gstrtpbasedepayload.c
|
||||||
|
|
||||||
libgstrtp_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
libgstrtp_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
||||||
libgstrtp_@GST_MAJORMINOR@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)
|
libgstrtp_@GST_MAJORMINOR@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gstbasertpaudiopayload
|
* SECTION:gstrtpbaseaudiopayload
|
||||||
* @short_description: Base class for audio RTP payloader
|
* @short_description: Base class for audio RTP payloader
|
||||||
*
|
*
|
||||||
* Provides a base class for audio RTP payloaders for frame or sample based
|
* Provides a base class for audio RTP payloaders for frame or sample based
|
||||||
|
@ -63,10 +63,10 @@
|
||||||
#include <gst/rtp/gstrtpbuffer.h>
|
#include <gst/rtp/gstrtpbuffer.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/base/gstadapter.h>
|
||||||
|
|
||||||
#include "gstbasertpaudiopayload.h"
|
#include "gstrtpbaseaudiopayload.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (basertpaudiopayload_debug);
|
GST_DEBUG_CATEGORY_STATIC (rtpbaseaudiopayload_debug);
|
||||||
#define GST_CAT_DEFAULT (basertpaudiopayload_debug)
|
#define GST_CAT_DEFAULT (rtpbaseaudiopayload_debug)
|
||||||
|
|
||||||
#define DEFAULT_BUFFER_LIST FALSE
|
#define DEFAULT_BUFFER_LIST FALSE
|
||||||
|
|
||||||
|
@ -166,13 +166,13 @@ gst_rtp_base_audio_payload_class_init (GstRTPBaseAudioPayloadClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
GstRTPBasePayloadClass *gstbasertppayload_class;
|
GstRTPBasePayloadClass *gstrtpbasepayload_class;
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (GstRTPBaseAudioPayloadPrivate));
|
g_type_class_add_private (klass, sizeof (GstRTPBaseAudioPayloadPrivate));
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
gstelement_class = (GstElementClass *) klass;
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstbasertppayload_class = (GstRTPBasePayloadClass *) klass;
|
gstrtpbasepayload_class = (GstRTPBasePayloadClass *) klass;
|
||||||
|
|
||||||
gobject_class->finalize = gst_rtp_base_audio_payload_finalize;
|
gobject_class->finalize = gst_rtp_base_audio_payload_finalize;
|
||||||
gobject_class->set_property = gst_rtp_base_audio_payload_set_property;
|
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 =
|
gstelement_class->change_state =
|
||||||
GST_DEBUG_FUNCPTR (gst_rtp_base_payload_audio_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);
|
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_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");
|
"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:
|
* 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
|
* Tells #GstRTPBaseAudioPayload that the child element is for a frame based
|
||||||
* audio codec
|
* audio codec
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *
|
gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *
|
||||||
basertpaudiopayload)
|
rtpbaseaudiopayload)
|
||||||
{
|
{
|
||||||
g_return_if_fail (basertpaudiopayload != NULL);
|
g_return_if_fail (rtpbaseaudiopayload != NULL);
|
||||||
g_return_if_fail (basertpaudiopayload->priv->time_to_bytes == NULL);
|
g_return_if_fail (rtpbaseaudiopayload->priv->time_to_bytes == NULL);
|
||||||
g_return_if_fail (basertpaudiopayload->priv->bytes_to_time == NULL);
|
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_time == NULL);
|
||||||
g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == 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;
|
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;
|
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_frame_time_to_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtp_base_audio_payload_set_sample_based:
|
* 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
|
* Tells #GstRTPBaseAudioPayload that the child element is for a sample based
|
||||||
* audio codec
|
* audio codec
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
|
gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
|
||||||
basertpaudiopayload)
|
rtpbaseaudiopayload)
|
||||||
{
|
{
|
||||||
g_return_if_fail (basertpaudiopayload != NULL);
|
g_return_if_fail (rtpbaseaudiopayload != NULL);
|
||||||
g_return_if_fail (basertpaudiopayload->priv->time_to_bytes == NULL);
|
g_return_if_fail (rtpbaseaudiopayload->priv->time_to_bytes == NULL);
|
||||||
g_return_if_fail (basertpaudiopayload->priv->bytes_to_time == NULL);
|
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_time == NULL);
|
||||||
g_return_if_fail (basertpaudiopayload->priv->bytes_to_rtptime == 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;
|
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;
|
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_sample_time_to_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtp_base_audio_payload_set_frame_options:
|
* 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_duration: The duraction of an audio frame in milliseconds.
|
||||||
* @frame_size: The size of an audio frame in bytes.
|
* @frame_size: The size of an audio frame in bytes.
|
||||||
*
|
*
|
||||||
|
@ -319,46 +319,46 @@ gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload
|
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;
|
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;
|
priv->frame_duration_ns = frame_duration * GST_MSECOND;
|
||||||
basertpaudiopayload->frame_size = frame_size;
|
rtpbaseaudiopayload->frame_size = frame_size;
|
||||||
priv->align = frame_size;
|
priv->align = frame_size;
|
||||||
|
|
||||||
gst_adapter_clear (priv->adapter);
|
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);
|
frame_duration, frame_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtp_base_audio_payload_set_sample_options:
|
* 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.
|
* @sample_size: Size per sample in bytes.
|
||||||
*
|
*
|
||||||
* Sets the options for sample based audio codecs.
|
* Sets the options for sample based audio codecs.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload
|
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 */
|
/* 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);
|
sample_size * 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtp_base_audio_payload_set_samplebits_options:
|
* 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.
|
* @sample_size: Size per sample in bits.
|
||||||
*
|
*
|
||||||
* Sets the options for sample based audio codecs.
|
* Sets the options for sample based audio codecs.
|
||||||
|
@ -367,16 +367,16 @@ gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
|
gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
|
||||||
* basertpaudiopayload, gint sample_size)
|
* rtpbaseaudiopayload, gint sample_size)
|
||||||
{
|
{
|
||||||
guint fragment_size;
|
guint fragment_size;
|
||||||
GstRTPBaseAudioPayloadPrivate *priv;
|
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 */
|
/* sample_size is in bits and is converted into multiple bytes */
|
||||||
fragment_size = sample_size;
|
fragment_size = sample_size;
|
||||||
|
@ -387,7 +387,7 @@ gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload
|
||||||
|
|
||||||
gst_adapter_clear (priv->adapter);
|
gst_adapter_clear (priv->adapter);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basertpaudiopayload,
|
GST_DEBUG_OBJECT (rtpbaseaudiopayload,
|
||||||
"Samplebits set to sample size %d bits", sample_size);
|
"Samplebits set to sample size %d bits", sample_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -922,16 +922,16 @@ static GstStateChangeReturn
|
||||||
gst_rtp_base_payload_audio_change_state (GstElement * element,
|
gst_rtp_base_payload_audio_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstRTPBaseAudioPayload *basertppayload;
|
GstRTPBaseAudioPayload *rtpbasepayload;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_AUDIO_PAYLOAD (element);
|
rtpbasepayload = GST_RTP_BASE_AUDIO_PAYLOAD (element);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
basertppayload->priv->cached_mtu = -1;
|
rtpbasepayload->priv->cached_mtu = -1;
|
||||||
basertppayload->priv->last_rtptime = -1;
|
rtpbasepayload->priv->last_rtptime = -1;
|
||||||
basertppayload->priv->last_timestamp = -1;
|
rtpbasepayload->priv->last_timestamp = -1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -941,7 +941,7 @@ gst_rtp_base_payload_audio_change_state (GstElement * element,
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
gst_adapter_clear (basertppayload->priv->adapter);
|
gst_adapter_clear (rtpbasepayload->priv->adapter);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -979,7 +979,7 @@ gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload * basep,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtp_base_audio_payload_get_adapter:
|
* gst_rtp_base_audio_payload_get_adapter:
|
||||||
* @basertpaudiopayload: a #GstRTPBaseAudioPayload
|
* @rtpbaseaudiopayload: a #GstRTPBaseAudioPayload
|
||||||
*
|
*
|
||||||
* Gets the internal adapter used by the depayloader.
|
* Gets the internal adapter used by the depayloader.
|
||||||
*
|
*
|
||||||
|
@ -989,11 +989,11 @@ gst_rtp_base_payload_audio_handle_event (GstRTPBasePayload * basep,
|
||||||
*/
|
*/
|
||||||
GstAdapter *
|
GstAdapter *
|
||||||
gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload
|
gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload
|
||||||
* basertpaudiopayload)
|
* rtpbaseaudiopayload)
|
||||||
{
|
{
|
||||||
GstAdapter *adapter;
|
GstAdapter *adapter;
|
||||||
|
|
||||||
if ((adapter = basertpaudiopayload->priv->adapter))
|
if ((adapter = rtpbaseaudiopayload->priv->adapter))
|
||||||
g_object_ref (adapter);
|
g_object_ref (adapter);
|
||||||
|
|
||||||
return adapter;
|
return adapter;
|
|
@ -21,7 +21,7 @@
|
||||||
#define __GST_RTP_BASE_AUDIO_PAYLOAD_H__
|
#define __GST_RTP_BASE_AUDIO_PAYLOAD_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/rtp/gstbasertppayload.h>
|
#include <gst/rtp/gstrtpbasepayload.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/base/gstadapter.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -78,20 +78,20 @@ struct _GstRTPBaseAudioPayloadClass
|
||||||
GType gst_rtp_base_audio_payload_get_type (void);
|
GType gst_rtp_base_audio_payload_get_type (void);
|
||||||
|
|
||||||
/* configure frame based */
|
/* 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);
|
gint frame_duration, gint frame_size);
|
||||||
|
|
||||||
/* configure sample based */
|
/* configure sample based */
|
||||||
void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *basertpaudiopayload);
|
void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
|
||||||
void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *basertpaudiopayload,
|
void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
|
||||||
gint sample_size);
|
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);
|
gint sample_size);
|
||||||
|
|
||||||
/* get the internal adapter */
|
/* 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 */
|
/* push and flushing data */
|
||||||
GstFlowReturn gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,
|
GstFlowReturn gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,
|
|
@ -19,16 +19,16 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gstbasertpdepayload
|
* SECTION:gstrtpbasedepayload
|
||||||
* @short_description: Base class for RTP depayloader
|
* @short_description: Base class for RTP depayloader
|
||||||
*
|
*
|
||||||
* Provides a base class for RTP depayloaders
|
* Provides a base class for RTP depayloaders
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gstbasertpdepayload.h"
|
#include "gstrtpbasedepayload.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (basertpdepayload_debug);
|
GST_DEBUG_CATEGORY_STATIC (rtpbasedepayload_debug);
|
||||||
#define GST_CAT_DEFAULT (basertpdepayload_debug)
|
#define GST_CAT_DEFAULT (rtpbasedepayload_debug)
|
||||||
|
|
||||||
#define GST_RTP_BASE_DEPAYLOAD_GET_PRIVATE(obj) \
|
#define GST_RTP_BASE_DEPAYLOAD_GET_PRIVATE(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_DEPAYLOAD, GstRTPBaseDepayloadPrivate))
|
(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 GstElementClass *parent_class = NULL;
|
||||||
static void gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass *
|
static void gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass *
|
||||||
klass);
|
klass);
|
||||||
static void gst_rtp_base_depayload_init (GstRTPBaseDepayload * basertppayload,
|
static void gst_rtp_base_depayload_init (GstRTPBaseDepayload * rtpbasepayload,
|
||||||
GstRTPBaseDepayloadClass * klass);
|
GstRTPBaseDepayloadClass * klass);
|
||||||
|
|
||||||
GType
|
GType
|
||||||
|
@ -134,7 +134,7 @@ gst_rtp_base_depayload_class_init (GstRTPBaseDepayloadClass * klass)
|
||||||
klass->packet_lost = gst_rtp_base_depayload_packet_lost;
|
klass->packet_lost = gst_rtp_base_depayload_packet_lost;
|
||||||
klass->handle_event = gst_rtp_base_depayload_handle_event;
|
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");
|
"Base class for RTP Depayloaders");
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gstbasertppayload
|
* SECTION:gstrtpbasepayload
|
||||||
* @short_description: Base class for RTP payloader
|
* @short_description: Base class for RTP payloader
|
||||||
*
|
*
|
||||||
* Provides a base class for RTP payloaders
|
* Provides a base class for RTP payloaders
|
||||||
|
@ -27,10 +27,10 @@
|
||||||
|
|
||||||
#include <gst/rtp/gstrtpbuffer.h>
|
#include <gst/rtp/gstrtpbuffer.h>
|
||||||
|
|
||||||
#include "gstbasertppayload.h"
|
#include "gstrtpbasepayload.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (basertppayload_debug);
|
GST_DEBUG_CATEGORY_STATIC (rtpbasepayload_debug);
|
||||||
#define GST_CAT_DEFAULT (basertppayload_debug)
|
#define GST_CAT_DEFAULT (rtpbasepayload_debug)
|
||||||
|
|
||||||
#define GST_RTP_BASE_PAYLOAD_GET_PRIVATE(obj) \
|
#define GST_RTP_BASE_PAYLOAD_GET_PRIVATE(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BASE_PAYLOAD, GstRTPBasePayloadPrivate))
|
(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_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);
|
gpointer g_class);
|
||||||
static void gst_rtp_base_payload_finalize (GObject * object);
|
static void gst_rtp_base_payload_finalize (GObject * object);
|
||||||
|
|
||||||
static GstCaps *gst_rtp_base_payload_sink_getcaps (GstPad * pad,
|
static GstCaps *gst_rtp_base_payload_sink_getcaps (GstPad * pad,
|
||||||
GstCaps * filter);
|
GstCaps * filter);
|
||||||
static gboolean gst_rtp_base_payload_event_default (GstRTPBasePayload *
|
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 gboolean gst_rtp_base_payload_event (GstPad * pad, GstEvent * event);
|
||||||
static GstFlowReturn gst_rtp_base_payload_chain (GstPad * pad,
|
static GstFlowReturn gst_rtp_base_payload_chain (GstPad * pad,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
static GstCaps *gst_rtp_base_payload_getcaps_default (GstRTPBasePayload *
|
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,
|
static void gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
|
@ -121,10 +121,10 @@ static GstElementClass *parent_class = NULL;
|
||||||
GType
|
GType
|
||||||
gst_rtp_base_payload_get_type (void)
|
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)) {
|
if (g_once_init_enter ((gsize *) & rtpbasepayload_type)) {
|
||||||
static const GTypeInfo basertppayload_info = {
|
static const GTypeInfo rtpbasepayload_info = {
|
||||||
sizeof (GstRTPBasePayloadClass),
|
sizeof (GstRTPBasePayloadClass),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -136,11 +136,11 @@ gst_rtp_base_payload_get_type (void)
|
||||||
(GInstanceInitFunc) gst_rtp_base_payload_init,
|
(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",
|
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
|
static void
|
||||||
|
@ -243,81 +243,81 @@ gst_rtp_base_payload_class_init (GstRTPBasePayloadClass * klass)
|
||||||
klass->get_caps = gst_rtp_base_payload_getcaps_default;
|
klass->get_caps = gst_rtp_base_payload_getcaps_default;
|
||||||
klass->handle_event = gst_rtp_base_payload_event_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");
|
"Base class for RTP Payloaders");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtp_base_payload_init (GstRTPBasePayload * basertppayload, gpointer g_class)
|
gst_rtp_base_payload_init (GstRTPBasePayload * rtpbasepayload, gpointer g_class)
|
||||||
{
|
{
|
||||||
GstPadTemplate *templ;
|
GstPadTemplate *templ;
|
||||||
GstRTPBasePayloadPrivate *priv;
|
GstRTPBasePayloadPrivate *priv;
|
||||||
|
|
||||||
basertppayload->priv = priv =
|
rtpbasepayload->priv = priv =
|
||||||
GST_RTP_BASE_PAYLOAD_GET_PRIVATE (basertppayload);
|
GST_RTP_BASE_PAYLOAD_GET_PRIVATE (rtpbasepayload);
|
||||||
|
|
||||||
templ =
|
templ =
|
||||||
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
|
||||||
g_return_if_fail (templ != NULL);
|
g_return_if_fail (templ != NULL);
|
||||||
|
|
||||||
basertppayload->srcpad = gst_pad_new_from_template (templ, "src");
|
rtpbasepayload->srcpad = gst_pad_new_from_template (templ, "src");
|
||||||
gst_element_add_pad (GST_ELEMENT (basertppayload), basertppayload->srcpad);
|
gst_element_add_pad (GST_ELEMENT (rtpbasepayload), rtpbasepayload->srcpad);
|
||||||
|
|
||||||
templ =
|
templ =
|
||||||
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
|
||||||
g_return_if_fail (templ != NULL);
|
g_return_if_fail (templ != NULL);
|
||||||
|
|
||||||
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
rtpbasepayload->sinkpad = gst_pad_new_from_template (templ, "sink");
|
||||||
gst_pad_set_getcaps_function (basertppayload->sinkpad,
|
gst_pad_set_getcaps_function (rtpbasepayload->sinkpad,
|
||||||
gst_rtp_base_payload_sink_getcaps);
|
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_rtp_base_payload_event);
|
||||||
gst_pad_set_chain_function (basertppayload->sinkpad,
|
gst_pad_set_chain_function (rtpbasepayload->sinkpad,
|
||||||
gst_rtp_base_payload_chain);
|
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;
|
rtpbasepayload->mtu = DEFAULT_MTU;
|
||||||
basertppayload->pt = DEFAULT_PT;
|
rtpbasepayload->pt = DEFAULT_PT;
|
||||||
basertppayload->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
|
rtpbasepayload->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
|
||||||
basertppayload->ssrc = DEFAULT_SSRC;
|
rtpbasepayload->ssrc = DEFAULT_SSRC;
|
||||||
basertppayload->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
|
rtpbasepayload->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
|
||||||
priv->seqnum_offset_random = (basertppayload->seqnum_offset == -1);
|
priv->seqnum_offset_random = (rtpbasepayload->seqnum_offset == -1);
|
||||||
priv->ts_offset_random = (basertppayload->ts_offset == -1);
|
priv->ts_offset_random = (rtpbasepayload->ts_offset == -1);
|
||||||
priv->ssrc_random = (basertppayload->ssrc == -1);
|
priv->ssrc_random = (rtpbasepayload->ssrc == -1);
|
||||||
|
|
||||||
basertppayload->max_ptime = DEFAULT_MAX_PTIME;
|
rtpbasepayload->max_ptime = DEFAULT_MAX_PTIME;
|
||||||
basertppayload->min_ptime = DEFAULT_MIN_PTIME;
|
rtpbasepayload->min_ptime = DEFAULT_MIN_PTIME;
|
||||||
basertppayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
|
rtpbasepayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
|
||||||
basertppayload->abidata.ABI.ptime_multiple = DEFAULT_PTIME_MULTIPLE;
|
rtpbasepayload->abidata.ABI.ptime_multiple = DEFAULT_PTIME_MULTIPLE;
|
||||||
basertppayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
rtpbasepayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
||||||
basertppayload->priv->base_rtime = GST_BUFFER_OFFSET_NONE;
|
rtpbasepayload->priv->base_rtime = GST_BUFFER_OFFSET_NONE;
|
||||||
|
|
||||||
basertppayload->media = NULL;
|
rtpbasepayload->media = NULL;
|
||||||
basertppayload->encoding_name = NULL;
|
rtpbasepayload->encoding_name = NULL;
|
||||||
|
|
||||||
basertppayload->clock_rate = 0;
|
rtpbasepayload->clock_rate = 0;
|
||||||
|
|
||||||
basertppayload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
rtpbasepayload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
|
||||||
basertppayload->priv->prop_max_ptime = DEFAULT_MAX_PTIME;
|
rtpbasepayload->priv->prop_max_ptime = DEFAULT_MAX_PTIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtp_base_payload_finalize (GObject * object)
|
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);
|
g_free (rtpbasepayload->media);
|
||||||
basertppayload->media = NULL;
|
rtpbasepayload->media = NULL;
|
||||||
g_free (basertppayload->encoding_name);
|
g_free (rtpbasepayload->encoding_name);
|
||||||
basertppayload->encoding_name = NULL;
|
rtpbasepayload->encoding_name = NULL;
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * basertppayload,
|
gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * rtpbasepayload,
|
||||||
GstPad * pad, GstCaps * filter)
|
GstPad * pad, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -338,48 +338,48 @@ gst_rtp_base_payload_getcaps_default (GstRTPBasePayload * basertppayload,
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_rtp_base_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
gst_rtp_base_payload_sink_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstRTPBasePayload *basertppayload;
|
GstRTPBasePayload *rtpbasepayload;
|
||||||
GstRTPBasePayloadClass *basertppayload_class;
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
||||||
GstCaps *caps = NULL;
|
GstCaps *caps = NULL;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "getting caps");
|
GST_DEBUG_OBJECT (pad, "getting caps");
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
||||||
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
||||||
|
|
||||||
if (basertppayload_class->get_caps)
|
if (rtpbasepayload_class->get_caps)
|
||||||
caps = basertppayload_class->get_caps (basertppayload, pad, filter);
|
caps = rtpbasepayload_class->get_caps (rtpbasepayload, pad, filter);
|
||||||
|
|
||||||
gst_object_unref (basertppayload);
|
gst_object_unref (rtpbasepayload);
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
|
gst_rtp_base_payload_event_default (GstRTPBasePayload * rtpbasepayload,
|
||||||
GstEvent * event)
|
GstEvent * event)
|
||||||
{
|
{
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_FLUSH_START:
|
case GST_EVENT_FLUSH_START:
|
||||||
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_FLUSH_STOP:
|
case GST_EVENT_FLUSH_STOP:
|
||||||
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
|
||||||
gst_segment_init (&basertppayload->segment, GST_FORMAT_UNDEFINED);
|
gst_segment_init (&rtpbasepayload->segment, GST_FORMAT_UNDEFINED);
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_CAPS:
|
case GST_EVENT_CAPS:
|
||||||
{
|
{
|
||||||
GstRTPBasePayloadClass *basertppayload_class;
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
gst_event_parse_caps (event, &caps);
|
gst_event_parse_caps (event, &caps);
|
||||||
GST_DEBUG_OBJECT (basertppayload, "setting caps %" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (rtpbasepayload, "setting caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
||||||
if (basertppayload_class->set_caps)
|
if (rtpbasepayload_class->set_caps)
|
||||||
res = basertppayload_class->set_caps (basertppayload, caps);
|
res = rtpbasepayload_class->set_caps (rtpbasepayload, caps);
|
||||||
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
break;
|
break;
|
||||||
|
@ -388,18 +388,18 @@ gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
|
||||||
{
|
{
|
||||||
GstSegment *segment;
|
GstSegment *segment;
|
||||||
|
|
||||||
segment = &basertppayload->segment;
|
segment = &rtpbasepayload->segment;
|
||||||
gst_event_copy_segment (event, 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);
|
"configured SEGMENT %" GST_SEGMENT_FORMAT, segment);
|
||||||
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
res = gst_pad_event_default (basertppayload->sinkpad, event);
|
res = gst_pad_event_default (rtpbasepayload->sinkpad, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
@ -408,24 +408,24 @@ gst_rtp_base_payload_event_default (GstRTPBasePayload * basertppayload,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
|
gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstRTPBasePayload *basertppayload;
|
GstRTPBasePayload *rtpbasepayload;
|
||||||
GstRTPBasePayloadClass *basertppayload_class;
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
||||||
if (G_UNLIKELY (basertppayload == NULL)) {
|
if (G_UNLIKELY (rtpbasepayload == NULL)) {
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
return FALSE;
|
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)
|
if (rtpbasepayload_class->handle_event)
|
||||||
res = basertppayload_class->handle_event (basertppayload, event);
|
res = rtpbasepayload_class->handle_event (rtpbasepayload, event);
|
||||||
else
|
else
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
|
||||||
gst_object_unref (basertppayload);
|
gst_object_unref (rtpbasepayload);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -434,28 +434,28 @@ gst_rtp_base_payload_event (GstPad * pad, GstEvent * event)
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_rtp_base_payload_chain (GstPad * pad, GstBuffer * buffer)
|
gst_rtp_base_payload_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstRTPBasePayload *basertppayload;
|
GstRTPBasePayload *rtpbasepayload;
|
||||||
GstRTPBasePayloadClass *basertppayload_class;
|
GstRTPBasePayloadClass *rtpbasepayload_class;
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (gst_pad_get_parent (pad));
|
||||||
basertppayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (basertppayload);
|
rtpbasepayload_class = GST_RTP_BASE_PAYLOAD_GET_CLASS (rtpbasepayload);
|
||||||
|
|
||||||
if (!basertppayload_class->handle_buffer)
|
if (!rtpbasepayload_class->handle_buffer)
|
||||||
goto no_function;
|
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;
|
return ret;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_function:
|
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"));
|
("subclass did not implement handle_buffer function"));
|
||||||
gst_object_unref (basertppayload);
|
gst_object_unref (rtpbasepayload);
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -499,18 +499,18 @@ copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_max_ptime (GstRTPBasePayload * basertppayload)
|
update_max_ptime (GstRTPBasePayload * rtpbasepayload)
|
||||||
{
|
{
|
||||||
if (basertppayload->priv->caps_max_ptime != -1 &&
|
if (rtpbasepayload->priv->caps_max_ptime != -1 &&
|
||||||
basertppayload->priv->prop_max_ptime != -1)
|
rtpbasepayload->priv->prop_max_ptime != -1)
|
||||||
basertppayload->max_ptime = MIN (basertppayload->priv->caps_max_ptime,
|
rtpbasepayload->max_ptime = MIN (rtpbasepayload->priv->caps_max_ptime,
|
||||||
basertppayload->priv->prop_max_ptime);
|
rtpbasepayload->priv->prop_max_ptime);
|
||||||
else if (basertppayload->priv->caps_max_ptime != -1)
|
else if (rtpbasepayload->priv->caps_max_ptime != -1)
|
||||||
basertppayload->max_ptime = basertppayload->priv->caps_max_ptime;
|
rtpbasepayload->max_ptime = rtpbasepayload->priv->caps_max_ptime;
|
||||||
else if (basertppayload->priv->prop_max_ptime != -1)
|
else if (rtpbasepayload->priv->prop_max_ptime != -1)
|
||||||
basertppayload->max_ptime = basertppayload->priv->prop_max_ptime;
|
rtpbasepayload->max_ptime = rtpbasepayload->priv->prop_max_ptime;
|
||||||
else
|
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,
|
gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstRTPBasePayload *basertppayload;
|
GstRTPBasePayload *rtpbasepayload;
|
||||||
GstRTPBasePayloadPrivate *priv;
|
GstRTPBasePayloadPrivate *priv;
|
||||||
gint64 val;
|
gint64 val;
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_PAYLOAD (object);
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
|
||||||
priv = basertppayload->priv;
|
priv = rtpbasepayload->priv;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_MTU:
|
case PROP_MTU:
|
||||||
basertppayload->mtu = g_value_get_uint (value);
|
rtpbasepayload->mtu = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
case PROP_PT:
|
case PROP_PT:
|
||||||
basertppayload->pt = g_value_get_uint (value);
|
rtpbasepayload->pt = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
case PROP_SSRC:
|
case PROP_SSRC:
|
||||||
val = g_value_get_uint (value);
|
val = g_value_get_uint (value);
|
||||||
basertppayload->ssrc = val;
|
rtpbasepayload->ssrc = val;
|
||||||
priv->ssrc_random = FALSE;
|
priv->ssrc_random = FALSE;
|
||||||
break;
|
break;
|
||||||
case PROP_TIMESTAMP_OFFSET:
|
case PROP_TIMESTAMP_OFFSET:
|
||||||
val = g_value_get_uint (value);
|
val = g_value_get_uint (value);
|
||||||
basertppayload->ts_offset = val;
|
rtpbasepayload->ts_offset = val;
|
||||||
priv->ts_offset_random = FALSE;
|
priv->ts_offset_random = FALSE;
|
||||||
break;
|
break;
|
||||||
case PROP_SEQNUM_OFFSET:
|
case PROP_SEQNUM_OFFSET:
|
||||||
val = g_value_get_int (value);
|
val = g_value_get_int (value);
|
||||||
basertppayload->seqnum_offset = val;
|
rtpbasepayload->seqnum_offset = val;
|
||||||
priv->seqnum_offset_random = (val == -1);
|
priv->seqnum_offset_random = (val == -1);
|
||||||
GST_DEBUG_OBJECT (basertppayload, "seqnum offset 0x%04x, random %d",
|
GST_DEBUG_OBJECT (rtpbasepayload, "seqnum offset 0x%04x, random %d",
|
||||||
basertppayload->seqnum_offset, priv->seqnum_offset_random);
|
rtpbasepayload->seqnum_offset, priv->seqnum_offset_random);
|
||||||
break;
|
break;
|
||||||
case PROP_MAX_PTIME:
|
case PROP_MAX_PTIME:
|
||||||
basertppayload->priv->prop_max_ptime = g_value_get_int64 (value);
|
rtpbasepayload->priv->prop_max_ptime = g_value_get_int64 (value);
|
||||||
update_max_ptime (basertppayload);
|
update_max_ptime (rtpbasepayload);
|
||||||
break;
|
break;
|
||||||
case PROP_MIN_PTIME:
|
case PROP_MIN_PTIME:
|
||||||
basertppayload->min_ptime = g_value_get_int64 (value);
|
rtpbasepayload->min_ptime = g_value_get_int64 (value);
|
||||||
break;
|
break;
|
||||||
case PROP_PERFECT_RTPTIME:
|
case PROP_PERFECT_RTPTIME:
|
||||||
priv->perfect_rtptime = g_value_get_boolean (value);
|
priv->perfect_rtptime = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
case PROP_PTIME_MULTIPLE:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
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,
|
gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec)
|
GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
GstRTPBasePayload *basertppayload;
|
GstRTPBasePayload *rtpbasepayload;
|
||||||
GstRTPBasePayloadPrivate *priv;
|
GstRTPBasePayloadPrivate *priv;
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_PAYLOAD (object);
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (object);
|
||||||
priv = basertppayload->priv;
|
priv = rtpbasepayload->priv;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_MTU:
|
case PROP_MTU:
|
||||||
g_value_set_uint (value, basertppayload->mtu);
|
g_value_set_uint (value, rtpbasepayload->mtu);
|
||||||
break;
|
break;
|
||||||
case PROP_PT:
|
case PROP_PT:
|
||||||
g_value_set_uint (value, basertppayload->pt);
|
g_value_set_uint (value, rtpbasepayload->pt);
|
||||||
break;
|
break;
|
||||||
case PROP_SSRC:
|
case PROP_SSRC:
|
||||||
if (priv->ssrc_random)
|
if (priv->ssrc_random)
|
||||||
g_value_set_uint (value, -1);
|
g_value_set_uint (value, -1);
|
||||||
else
|
else
|
||||||
g_value_set_uint (value, basertppayload->ssrc);
|
g_value_set_uint (value, rtpbasepayload->ssrc);
|
||||||
break;
|
break;
|
||||||
case PROP_TIMESTAMP_OFFSET:
|
case PROP_TIMESTAMP_OFFSET:
|
||||||
if (priv->ts_offset_random)
|
if (priv->ts_offset_random)
|
||||||
g_value_set_uint (value, -1);
|
g_value_set_uint (value, -1);
|
||||||
else
|
else
|
||||||
g_value_set_uint (value, (guint32) basertppayload->ts_offset);
|
g_value_set_uint (value, (guint32) rtpbasepayload->ts_offset);
|
||||||
break;
|
break;
|
||||||
case PROP_SEQNUM_OFFSET:
|
case PROP_SEQNUM_OFFSET:
|
||||||
if (priv->seqnum_offset_random)
|
if (priv->seqnum_offset_random)
|
||||||
g_value_set_int (value, -1);
|
g_value_set_int (value, -1);
|
||||||
else
|
else
|
||||||
g_value_set_int (value, (guint16) basertppayload->seqnum_offset);
|
g_value_set_int (value, (guint16) rtpbasepayload->seqnum_offset);
|
||||||
break;
|
break;
|
||||||
case PROP_MAX_PTIME:
|
case PROP_MAX_PTIME:
|
||||||
g_value_set_int64 (value, basertppayload->max_ptime);
|
g_value_set_int64 (value, rtpbasepayload->max_ptime);
|
||||||
break;
|
break;
|
||||||
case PROP_MIN_PTIME:
|
case PROP_MIN_PTIME:
|
||||||
g_value_set_int64 (value, basertppayload->min_ptime);
|
g_value_set_int64 (value, rtpbasepayload->min_ptime);
|
||||||
break;
|
break;
|
||||||
case PROP_TIMESTAMP:
|
case PROP_TIMESTAMP:
|
||||||
g_value_set_uint (value, basertppayload->timestamp);
|
g_value_set_uint (value, rtpbasepayload->timestamp);
|
||||||
break;
|
break;
|
||||||
case PROP_SEQNUM:
|
case PROP_SEQNUM:
|
||||||
g_value_set_uint (value, basertppayload->seqnum);
|
g_value_set_uint (value, rtpbasepayload->seqnum);
|
||||||
break;
|
break;
|
||||||
case PROP_PERFECT_RTPTIME:
|
case PROP_PERFECT_RTPTIME:
|
||||||
g_value_set_boolean (value, priv->perfect_rtptime);
|
g_value_set_boolean (value, priv->perfect_rtptime);
|
||||||
break;
|
break;
|
||||||
case PROP_PTIME_MULTIPLE:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -1017,37 +1017,37 @@ static GstStateChangeReturn
|
||||||
gst_rtp_base_payload_change_state (GstElement * element,
|
gst_rtp_base_payload_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstRTPBasePayload *basertppayload;
|
GstRTPBasePayload *rtpbasepayload;
|
||||||
GstRTPBasePayloadPrivate *priv;
|
GstRTPBasePayloadPrivate *priv;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
|
||||||
basertppayload = GST_RTP_BASE_PAYLOAD (element);
|
rtpbasepayload = GST_RTP_BASE_PAYLOAD (element);
|
||||||
priv = basertppayload->priv;
|
priv = rtpbasepayload->priv;
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
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)
|
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
|
else
|
||||||
basertppayload->seqnum_base = basertppayload->seqnum_offset;
|
rtpbasepayload->seqnum_base = rtpbasepayload->seqnum_offset;
|
||||||
priv->next_seqnum = basertppayload->seqnum_base;
|
priv->next_seqnum = rtpbasepayload->seqnum_base;
|
||||||
basertppayload->seqnum = basertppayload->seqnum_base;
|
rtpbasepayload->seqnum = rtpbasepayload->seqnum_base;
|
||||||
|
|
||||||
if (priv->ssrc_random)
|
if (priv->ssrc_random)
|
||||||
basertppayload->current_ssrc = g_random_int ();
|
rtpbasepayload->current_ssrc = g_random_int ();
|
||||||
else
|
else
|
||||||
basertppayload->current_ssrc = basertppayload->ssrc;
|
rtpbasepayload->current_ssrc = rtpbasepayload->ssrc;
|
||||||
|
|
||||||
if (priv->ts_offset_random)
|
if (priv->ts_offset_random)
|
||||||
basertppayload->ts_base = g_random_int ();
|
rtpbasepayload->ts_base = g_random_int ();
|
||||||
else
|
else
|
||||||
basertppayload->ts_base = basertppayload->ts_offset;
|
rtpbasepayload->ts_base = rtpbasepayload->ts_offset;
|
||||||
basertppayload->timestamp = basertppayload->ts_base;
|
rtpbasepayload->timestamp = rtpbasepayload->ts_base;
|
||||||
g_atomic_int_set (&basertppayload->priv->notified_first_timestamp, 1);
|
g_atomic_int_set (&rtpbasepayload->priv->notified_first_timestamp, 1);
|
||||||
priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
priv->base_offset = GST_BUFFER_OFFSET_NONE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1058,7 +1058,7 @@ gst_rtp_base_payload_change_state (GstElement * element,
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
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;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
break;
|
break;
|
Loading…
Reference in a new issue