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;
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);
+ 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);
+ 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;
}
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;
return FALSE;
if (lock)
- g_signal_emit (G_OBJECT (mux), gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM], 0, pad);
+ g_signal_emit (G_OBJECT (mux),
+ gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM], 0, pad);
GST_OBJECT_LOCK (mux);
if (lock)
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;
#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;
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__ */
#define DEFAULT_SEQNUM_OFFSET -1
#define DEFAULT_SSRC -1
-typedef struct {
+typedef struct
+{
gboolean have_ts_base;
guint clock_base;
} GstRTPMuxPadPrivate;
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);
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;
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);
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;
}
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);
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));
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",
}
static gboolean
-gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
+gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps)
{
GstRTPMux *rtp_mux;
GstStructure *structure;
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;
}
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;
}
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));
}
} 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);
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);
}
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);
}
-
#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;
/* 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__ */
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");