mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Re-indent to Gst style
This commit is contained in:
parent
fe071273c4
commit
ad4d98d70c
8 changed files with 78 additions and 92 deletions
|
@ -4,7 +4,7 @@
|
|||
<filename>../../gst/aacparse/.libs/libgstaacparse.so</filename>
|
||||
<basename>libgstaacparse.so</basename>
|
||||
<version>0.10.10.1</version>
|
||||
<license>unknown</license>
|
||||
<license>LGPL</license>
|
||||
<source>gst-plugins-bad</source>
|
||||
<package>GStreamer Bad Plug-ins CVS/prerelease</package>
|
||||
<origin>Unknown package origin</origin>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<plugin>
|
||||
<name>modplug</name>
|
||||
<description>.MOD audio decoding</description>
|
||||
<filename>../../gst/modplug/.libs/libgstmodplug.so</filename>
|
||||
<filename>../../ext/modplug/.libs/libgstmodplug.so</filename>
|
||||
<basename>libgstmodplug.so</basename>
|
||||
<version>0.10.10.1</version>
|
||||
<license>LGPL</license>
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
<name>video_%d</name>
|
||||
<direction>sink</direction>
|
||||
<presence>request</presence>
|
||||
<details>video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
|
||||
<details>video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>audio_%d</name>
|
||||
<direction>sink</direction>
|
||||
<presence>request</presence>
|
||||
<details>audio/AMR, channels=(int)[ 1, 8 ], rate=(int)[ 1, 2147483647 ]; audio/mpeg, mpegversion=(int)1, layer=(int)3, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]; audio/mpeg, mpegversion=(int)4, channels=(int)[ 1, 8 ], rate=(int)[ 1, 2147483647 ]</details>
|
||||
<details>audio/AMR, rate=(int)8000, channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)16000, channels=(int)[ 1, 2 ]; audio/mpeg, mpegversion=(int)1, layer=(int)3, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]; audio/mpeg, mpegversion=(int)4, channels=(int)[ 1, 8 ], rate=(int)[ 1, 2147483647 ]</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>src</name>
|
||||
|
@ -101,13 +101,13 @@
|
|||
<name>video_%d</name>
|
||||
<direction>sink</direction>
|
||||
<presence>request</presence>
|
||||
<details>video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-h263, h263version=(string)h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-divx, divxversion=(int)5, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-dv, systemstream=(boolean)false, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-qt-part, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
|
||||
<details>video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-divx, divxversion=(int)5, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-dv, systemstream=(boolean)false, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-qt-part, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>audio_%d</name>
|
||||
<direction>sink</direction>
|
||||
<presence>request</presence>
|
||||
<details>audio/x-raw-int, width=(int)8, depth=(int)8, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean){ true, false }; audio/x-raw-int, width=(int)16, depth=(int)16, endianness=(int){ 4321, 1234 }, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean)true; audio/x-raw-int, width=(int)24, depth=(int)24, endianness=(int){ 4321, 1234 }, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean)true; audio/x-raw-int, width=(int)32, depth=(int)32, endianness=(int){ 4321, 1234 }, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean)true; audio/mpeg, mpegversion=(int)1, layer=(int)3, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]; audio/mpeg, mpegversion=(int)4, channels=(int)[ 1, 8 ], rate=(int)[ 1, 2147483647 ]; audio/x-alaw, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]; audio/x-mulaw, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]</details>
|
||||
<details>audio/x-raw-int, width=(int)8, depth=(int)8, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean){ true, false }; audio/x-raw-int, width=(int)16, depth=(int)16, endianness=(int){ 4321, 1234 }, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean)true; audio/x-raw-int, width=(int)24, depth=(int)24, endianness=(int){ 4321, 1234 }, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean)true; audio/x-raw-int, width=(int)32, depth=(int)32, endianness=(int){ 4321, 1234 }, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ], signed=(boolean)true; audio/mpeg, mpegversion=(int)1, layer=(int)3, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]; audio/mpeg, mpegversion=(int)4, channels=(int)[ 1, 8 ], rate=(int)[ 1, 2147483647 ]; audio/x-alaw, channels=(int)[ 1, 2 ], rate=(int)[ 1, 2147483647 ]; audio/AMR, rate=(int)8000, channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)16000, channels=(int)[ 1, 2 ]</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>src</name>
|
||||
|
|
|
@ -93,10 +93,8 @@ static void gst_rtp_dtmf_mux_base_init (gpointer g_class);
|
|||
static void gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass);
|
||||
static void gst_rtp_dtmf_mux_finalize (GObject * object);
|
||||
|
||||
static gboolean gst_rtp_dtmf_mux_sink_event (GstPad * pad,
|
||||
GstEvent * event);
|
||||
static GstFlowReturn gst_rtp_dtmf_mux_chain (GstPad * pad,
|
||||
GstBuffer * buffer);
|
||||
static gboolean gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event);
|
||||
static GstFlowReturn gst_rtp_dtmf_mux_chain (GstPad * pad, GstBuffer * buffer);
|
||||
|
||||
static GstRTPMuxClass *parent_class = NULL;
|
||||
|
||||
|
@ -146,15 +144,15 @@ gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass)
|
|||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM] =
|
||||
g_signal_new ("locking", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstRTPDTMFMuxClass, locking),NULL, NULL,
|
||||
gst_marshal_VOID__OBJECT, G_TYPE_NONE,1,GST_TYPE_PAD);
|
||||
gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM] =
|
||||
g_signal_new ("locking", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstRTPDTMFMuxClass, locking), NULL, NULL,
|
||||
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_PAD);
|
||||
|
||||
gst_rtpdtmfmux_signals[SIGNAL_UNLOCKED_STREAM] =
|
||||
g_signal_new ("unlocked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstRTPDTMFMuxClass, unlocked),NULL, NULL,
|
||||
gst_marshal_VOID__OBJECT, G_TYPE_NONE,1,GST_TYPE_PAD);
|
||||
gst_rtpdtmfmux_signals[SIGNAL_UNLOCKED_STREAM] =
|
||||
g_signal_new ("unlocked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstRTPDTMFMuxClass, unlocked), NULL, NULL,
|
||||
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_PAD);
|
||||
|
||||
gobject_class->finalize = gst_rtp_dtmf_mux_finalize;
|
||||
gstrtpmux_class->chain_func = gst_rtp_dtmf_mux_chain;
|
||||
|
@ -202,53 +200,51 @@ gst_rtp_dtmf_mux_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_rtp_dtmf_mux_lock_stream (GstRTPDTMFMux *mux, GstPad * pad)
|
||||
gst_rtp_dtmf_mux_lock_stream (GstRTPDTMFMux * mux, GstPad * pad)
|
||||
{
|
||||
if (mux->special_pad != NULL)
|
||||
GST_WARNING_OBJECT (mux,
|
||||
"Stream lock already acquired by pad %s",
|
||||
GST_ELEMENT_NAME (mux->special_pad));
|
||||
"Stream lock already acquired by pad %s",
|
||||
GST_ELEMENT_NAME (mux->special_pad));
|
||||
|
||||
else {
|
||||
GST_DEBUG_OBJECT (mux,
|
||||
"Stream lock acquired by pad %s",
|
||||
GST_ELEMENT_NAME (pad));
|
||||
"Stream lock acquired by pad %s", GST_ELEMENT_NAME (pad));
|
||||
mux->special_pad = gst_object_ref (pad);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_rtp_dtmf_mux_unlock_stream (GstRTPDTMFMux *mux, GstPad * pad)
|
||||
gst_rtp_dtmf_mux_unlock_stream (GstRTPDTMFMux * mux, GstPad * pad)
|
||||
{
|
||||
if (mux->special_pad == NULL)
|
||||
GST_WARNING_OBJECT (mux,
|
||||
"Stream lock not acquired, can't release it");
|
||||
GST_WARNING_OBJECT (mux, "Stream lock not acquired, can't release it");
|
||||
|
||||
else if (pad != mux->special_pad)
|
||||
GST_WARNING_OBJECT (mux,
|
||||
"pad %s attempted to release Stream lock"
|
||||
" which was acquired by pad %s", GST_ELEMENT_NAME (pad),
|
||||
GST_ELEMENT_NAME (mux->special_pad));
|
||||
"pad %s attempted to release Stream lock"
|
||||
" which was acquired by pad %s", GST_ELEMENT_NAME (pad),
|
||||
GST_ELEMENT_NAME (mux->special_pad));
|
||||
else {
|
||||
GST_DEBUG_OBJECT (mux,
|
||||
"Stream lock released by pad %s",
|
||||
GST_ELEMENT_NAME (mux->special_pad));
|
||||
"Stream lock released by pad %s", GST_ELEMENT_NAME (mux->special_pad));
|
||||
gst_object_unref (mux->special_pad);
|
||||
mux->special_pad = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_rtp_dtmf_mux_handle_stream_lock_event (GstRTPDTMFMux *mux, GstPad * pad,
|
||||
const GstStructure * event_structure)
|
||||
gst_rtp_dtmf_mux_handle_stream_lock_event (GstRTPDTMFMux * mux, GstPad * pad,
|
||||
const GstStructure * event_structure)
|
||||
{
|
||||
gboolean lock;
|
||||
|
||||
if (!gst_structure_get_boolean (event_structure, "lock", &lock))
|
||||
return FALSE;
|
||||
|
||||
if (lock)
|
||||
g_signal_emit (G_OBJECT (mux), gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM], 0, pad);
|
||||
if (lock)
|
||||
g_signal_emit (G_OBJECT (mux),
|
||||
gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM], 0, pad);
|
||||
|
||||
GST_OBJECT_LOCK (mux);
|
||||
if (lock)
|
||||
|
@ -258,14 +254,15 @@ gst_rtp_dtmf_mux_handle_stream_lock_event (GstRTPDTMFMux *mux, GstPad * pad,
|
|||
GST_OBJECT_UNLOCK (mux);
|
||||
|
||||
if (!lock)
|
||||
g_signal_emit (G_OBJECT (mux), gst_rtpdtmfmux_signals[SIGNAL_UNLOCKED_STREAM], 0, pad);
|
||||
g_signal_emit (G_OBJECT (mux),
|
||||
gst_rtpdtmfmux_signals[SIGNAL_UNLOCKED_STREAM], 0, pad);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_rtp_dtmf_mux_handle_downstream_event (GstRTPDTMFMux *mux,
|
||||
GstPad * pad, GstEvent * event)
|
||||
gst_rtp_dtmf_mux_handle_downstream_event (GstRTPDTMFMux * mux,
|
||||
GstPad * pad, GstEvent * event)
|
||||
{
|
||||
const GstStructure *structure;
|
||||
gboolean ret = FALSE;
|
||||
|
@ -327,4 +324,3 @@ gst_rtp_dtmf_mux_plugin_init (GstPlugin * plugin)
|
|||
return gst_element_register (plugin, "rtpdtmfmux", GST_RANK_NONE,
|
||||
GST_TYPE_RTP_DTMF_MUX);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,13 +30,11 @@
|
|||
#include <gstrtpmux.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_RTP_DTMF_MUX (gst_rtp_dtmf_mux_get_type())
|
||||
#define GST_RTP_DTMF_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_DTMF_MUX, GstRTPDTMFMux))
|
||||
#define GST_RTP_DTMF_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_DTMF_MUX, GstRTPDTMFMux))
|
||||
#define GST_IS_RTP_DTMF_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_DTMF_MUX))
|
||||
#define GST_IS_RTP_DTMF_MUX_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_DTMF_MUX))
|
||||
|
||||
typedef struct _GstRTPDTMFMux GstRTPDTMFMux;
|
||||
typedef struct _GstRTPDTMFMuxClass GstRTPDTMFMuxClass;
|
||||
|
||||
|
@ -59,14 +57,12 @@ struct _GstRTPDTMFMuxClass
|
|||
GstRTPMuxClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (*locking) (GstElement *element, GstPad *pad);
|
||||
void (*unlocked) (GstElement *element, GstPad *pad);
|
||||
void (*locking) (GstElement * element, GstPad * pad);
|
||||
void (*unlocked) (GstElement * element, GstPad * pad);
|
||||
};
|
||||
|
||||
GType gst_rtp_dtmf_mux_get_type (void);
|
||||
gboolean gst_rtp_dtmf_mux_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_RTP_DTMF_MUX_H__ */
|
||||
|
||||
|
|
|
@ -64,7 +64,8 @@ enum
|
|||
#define DEFAULT_SEQNUM_OFFSET -1
|
||||
#define DEFAULT_SSRC -1
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
gboolean have_ts_base;
|
||||
guint clock_base;
|
||||
} GstRTPMuxPadPrivate;
|
||||
|
@ -89,11 +90,10 @@ static void gst_rtp_mux_finalize (GObject * object);
|
|||
|
||||
static GstPad *gst_rtp_mux_request_new_pad (GstElement * element,
|
||||
GstPadTemplate * templ, const gchar * name);
|
||||
static void gst_rtp_mux_release_pad (GstElement * element, GstPad *pad);
|
||||
static GstFlowReturn gst_rtp_mux_chain (GstPad * pad,
|
||||
GstBuffer * buffer);
|
||||
static gboolean gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps);
|
||||
static GstCaps * gst_rtp_mux_getcaps (GstPad *pad);
|
||||
static void gst_rtp_mux_release_pad (GstElement * element, GstPad * pad);
|
||||
static GstFlowReturn gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer);
|
||||
static gboolean gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps);
|
||||
static GstCaps *gst_rtp_mux_getcaps (GstPad * pad);
|
||||
|
||||
static GstStateChangeReturn gst_rtp_mux_change_state (GstElement *
|
||||
element, GstStateChange transition);
|
||||
|
@ -185,8 +185,8 @@ gst_rtp_mux_class_init (GstRTPMuxClass * klass)
|
|||
klass->chain_func = gst_rtp_mux_chain;
|
||||
}
|
||||
|
||||
static gboolean gst_rtp_mux_src_event (GstPad * pad,
|
||||
GstEvent * event)
|
||||
static gboolean
|
||||
gst_rtp_mux_src_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
GstElement *rtp_mux;
|
||||
GstIterator *iter;
|
||||
|
@ -200,7 +200,7 @@ static gboolean gst_rtp_mux_src_event (GstPad * pad,
|
|||
iter = gst_element_iterate_sink_pads (rtp_mux);
|
||||
|
||||
while (!done) {
|
||||
switch (gst_iterator_next (iter, (gpointer) &sinkpad)) {
|
||||
switch (gst_iterator_next (iter, (gpointer) & sinkpad)) {
|
||||
case GST_ITERATOR_OK:
|
||||
gst_event_ref (event);
|
||||
result |= gst_pad_push_event (sinkpad, event);
|
||||
|
@ -254,10 +254,11 @@ static GstPad *
|
|||
gst_rtp_mux_create_sinkpad (GstRTPMux * rtp_mux, GstPadTemplate * templ)
|
||||
{
|
||||
GstPad *newpad = NULL;
|
||||
GstPadTemplate * class_templ;
|
||||
GstPadTemplate *class_templ;
|
||||
|
||||
class_templ = gst_element_class_get_pad_template (
|
||||
GST_ELEMENT_GET_CLASS (rtp_mux), "sink_%d");
|
||||
class_templ =
|
||||
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (rtp_mux),
|
||||
"sink_%d");
|
||||
|
||||
if (templ == class_templ) {
|
||||
gchar *name;
|
||||
|
@ -327,7 +328,7 @@ gst_rtp_mux_request_new_pad (GstElement * element,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_rtp_mux_release_pad (GstElement * element, GstPad *pad)
|
||||
gst_rtp_mux_release_pad (GstElement * element, GstPad * pad)
|
||||
{
|
||||
GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
|
||||
|
||||
|
@ -360,7 +361,7 @@ static GstFlowReturn
|
|||
gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer)
|
||||
{
|
||||
GstRTPMux *rtp_mux;
|
||||
GstStructure * structure;
|
||||
GstStructure *structure;
|
||||
GstFlowReturn ret;
|
||||
|
||||
rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
|
||||
|
@ -371,15 +372,16 @@ gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer)
|
|||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
buffer = gst_buffer_make_writable(buffer);
|
||||
buffer = gst_buffer_make_writable (buffer);
|
||||
|
||||
GST_OBJECT_LOCK (rtp_mux);
|
||||
rtp_mux->seqnum++;
|
||||
gst_rtp_buffer_set_seq (buffer, rtp_mux->seqnum);
|
||||
GST_OBJECT_UNLOCK (rtp_mux);
|
||||
GST_BUFFER_CAPS (buffer) = gst_caps_make_writable(GST_BUFFER_CAPS (buffer));
|
||||
GST_BUFFER_CAPS (buffer) = gst_caps_make_writable (GST_BUFFER_CAPS (buffer));
|
||||
structure = gst_caps_get_structure (GST_BUFFER_CAPS (buffer), 0U);
|
||||
gst_structure_set (structure, "seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base, NULL);
|
||||
gst_structure_set (structure, "seqnum-base", G_TYPE_UINT,
|
||||
rtp_mux->seqnum_base, NULL);
|
||||
gst_rtp_buffer_set_ssrc (buffer, rtp_mux->current_ssrc);
|
||||
gst_rtp_mux_readjust_rtp_timestamp (rtp_mux, pad, buffer);
|
||||
GST_LOG_OBJECT (rtp_mux, "Pushing packet size %d, seq=%d, ts=%u",
|
||||
|
@ -395,7 +397,7 @@ gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
|
||||
gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
GstRTPMux *rtp_mux;
|
||||
GstStructure *structure;
|
||||
|
@ -417,22 +419,21 @@ gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
|
|||
|
||||
gst_caps_set_simple (caps,
|
||||
"clock-base", G_TYPE_UINT, rtp_mux->ts_base,
|
||||
"seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base,
|
||||
NULL);
|
||||
"seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base, NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (rtp_mux,
|
||||
"setting caps %" GST_PTR_FORMAT " on src pad..", caps);
|
||||
ret = gst_pad_set_caps (rtp_mux->srcpad, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
out:
|
||||
out:
|
||||
gst_object_unref (rtp_mux);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
clear_caps (GstCaps *caps, gboolean only_clock_rate)
|
||||
clear_caps (GstCaps * caps, gboolean only_clock_rate)
|
||||
{
|
||||
gint i, j;
|
||||
|
||||
|
@ -453,7 +454,7 @@ clear_caps (GstCaps *caps, gboolean only_clock_rate)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
same_clock_rate_fold (gpointer item, GValue *ret, gpointer user_data)
|
||||
same_clock_rate_fold (gpointer item, GValue * ret, gpointer user_data)
|
||||
{
|
||||
GstPad *mypad = user_data;
|
||||
GstPad *pad = item;
|
||||
|
@ -487,22 +488,21 @@ same_clock_rate_fold (gpointer item, GValue *ret, gpointer user_data)
|
|||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_rtp_mux_getcaps (GstPad *pad)
|
||||
gst_rtp_mux_getcaps (GstPad * pad)
|
||||
{
|
||||
GstRTPMux *mux = GST_RTP_MUX (gst_pad_get_parent (pad));
|
||||
GstCaps *caps = NULL;
|
||||
GstIterator *iter = NULL;
|
||||
GValue v = {0};
|
||||
GValue v = { 0 };
|
||||
GstIteratorResult res;
|
||||
GstCaps *peercaps = gst_pad_peer_get_caps (mux->srcpad);
|
||||
GstCaps *othercaps = NULL;
|
||||
GstCaps *othercaps = NULL;
|
||||
|
||||
if (peercaps) {
|
||||
othercaps = gst_caps_intersect (peercaps,
|
||||
gst_pad_get_pad_template_caps (pad));
|
||||
gst_caps_unref (peercaps);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
othercaps = gst_caps_copy (gst_pad_get_pad_template_caps (mux->srcpad));
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,7 @@ gst_rtp_mux_getcaps (GstPad *pad)
|
|||
} while (res == GST_ITERATOR_RESYNC);
|
||||
gst_iterator_free (iter);
|
||||
|
||||
caps = (GstCaps*) gst_value_get_caps (&v);
|
||||
caps = (GstCaps *) gst_value_get_caps (&v);
|
||||
|
||||
if (res == GST_ITERATOR_ERROR) {
|
||||
gst_caps_unref (caps);
|
||||
|
@ -605,7 +605,7 @@ gst_rtp_mux_ready_to_paused (GstRTPMux * rtp_mux)
|
|||
rtp_mux->ts_base = g_random_int ();
|
||||
else
|
||||
rtp_mux->ts_base = rtp_mux->ts_offset;
|
||||
GST_DEBUG_OBJECT (rtp_mux, "set clock-base to %u", rtp_mux->ts_base);
|
||||
GST_DEBUG_OBJECT (rtp_mux, "set clock-base to %u", rtp_mux->ts_base);
|
||||
|
||||
GST_OBJECT_UNLOCK (rtp_mux);
|
||||
}
|
||||
|
@ -635,10 +635,8 @@ gst_rtp_mux_change_state (GstElement * element, GstStateChange transition)
|
|||
gboolean
|
||||
gst_rtp_mux_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
GST_DEBUG_CATEGORY_INIT (gst_rtp_mux_debug, "rtpmux", 0,
|
||||
"rtp muxer");
|
||||
GST_DEBUG_CATEGORY_INIT (gst_rtp_mux_debug, "rtpmux", 0, "rtp muxer");
|
||||
|
||||
return gst_element_register (plugin, "rtpmux", GST_RANK_NONE,
|
||||
GST_TYPE_RTP_MUX);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,14 +29,12 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_RTP_MUX (gst_rtp_mux_get_type())
|
||||
#define GST_RTP_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_MUX, GstRTPMux))
|
||||
#define GST_RTP_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_MUX, GstRTPMux))
|
||||
#define GST_RTP_MUX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_MUX, GstRTPMuxClass))
|
||||
#define GST_IS_RTP_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_MUX))
|
||||
#define GST_IS_RTP_MUX_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_MUX))
|
||||
|
||||
typedef struct _GstRTPMux GstRTPMux;
|
||||
typedef struct _GstRTPMuxClass GstRTPMuxClass;
|
||||
|
||||
|
@ -55,28 +53,26 @@ struct _GstRTPMux
|
|||
/* sinkpads */
|
||||
gint numpads;
|
||||
|
||||
guint32 ts_base;
|
||||
guint16 seqnum_base;
|
||||
guint32 ts_base;
|
||||
guint16 seqnum_base;
|
||||
|
||||
gint32 ts_offset;
|
||||
gint16 seqnum_offset;
|
||||
guint16 seqnum; /* protected by object lock */
|
||||
guint ssrc;
|
||||
guint current_ssrc;
|
||||
gint32 ts_offset;
|
||||
gint16 seqnum_offset;
|
||||
guint16 seqnum; /* protected by object lock */
|
||||
guint ssrc;
|
||||
guint current_ssrc;
|
||||
};
|
||||
|
||||
struct _GstRTPMuxClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
|
||||
GstFlowReturn (* chain_func) (GstPad * pad, GstBuffer * buffer);
|
||||
gboolean (* sink_event_func) (GstPad * pad, GstEvent * event);
|
||||
GstFlowReturn (*chain_func) (GstPad * pad, GstBuffer * buffer);
|
||||
gboolean (*sink_event_func) (GstPad * pad, GstEvent * event);
|
||||
};
|
||||
|
||||
GType gst_rtp_mux_get_type (void);
|
||||
gboolean gst_rtp_mux_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_RTP_MUX_H__ */
|
||||
|
||||
|
|
|
@ -45,4 +45,4 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|||
GST_VERSION_MINOR,
|
||||
"rtpmuxer",
|
||||
"RTP Muxer plugins",
|
||||
plugin_init, "0.1" , "LGPL", "Farsight", "http://farsight.sf.net");
|
||||
plugin_init, "0.1", "LGPL", "Farsight", "http://farsight.sf.net");
|
||||
|
|
Loading…
Reference in a new issue