Trying to make udp plugins work

Original commit message from CVS:
Trying to make udp plugins work
This commit is contained in:
Zeeshan Ali 2002-11-08 01:29:11 +00:00
parent 7da598dde5
commit 7b3955e369
3 changed files with 23 additions and 1 deletions

View file

@ -164,6 +164,16 @@ gst_udpsink_sinkconnect (GstPad *pad, GstCaps *caps)
return GST_PAD_CONNECT_OK;
}
static void
gst_udpsink_set_clock (GstElement *element, GstClock *clock)
{
GstUDPSink *udpsink;
udpsink = GST_UDPSINK (element);
udpsink->clock = clock;
}
static void
gst_udpsink_init (GstUDPSink *udpsink)
{
@ -175,6 +185,10 @@ gst_udpsink_init (GstUDPSink *udpsink)
udpsink->host = g_strdup (UDP_DEFAULT_HOST);
udpsink->port = UDP_DEFAULT_PORT;
udpsink->clock = NULL;
GST_ELEMENT (udpsink)->setclockfunc = gst_udpsink_set_clock;
}
static void
@ -182,6 +196,7 @@ gst_udpsink_chain (GstPad *pad, GstBuffer *buf)
{
GstUDPSink *udpsink;
int tolen;
GstClockTimeDiff *jitter = NULL;
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
@ -189,6 +204,11 @@ gst_udpsink_chain (GstPad *pad, GstBuffer *buf)
udpsink = GST_UDPSINK (GST_OBJECT_PARENT (pad));
if (udpsink->clock) {
GST_DEBUG (0, "udpsink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP (buf));
gst_element_clock_wait (GST_ELEMENT (udpsink), udpsink->clock, GST_BUFFER_TIMESTAMP (buf), jitter);
}
tolen = sizeof(udpsink->theiraddr);
if (sendto (udpsink->sock, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), 0,

View file

@ -73,6 +73,8 @@ struct _GstUDPSink {
gint port;
gchar *host;
GstClock *clock;
};
struct _GstUDPSinkClass {