Trying to make udp plugins work
Original commit message from CVS: Trying to make udp plugins work
This commit is contained in:
parent
7da598dde5
commit
7b3955e369
@ -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,12 +196,18 @@ 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));
|
||||
g_return_if_fail (buf != NULL);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -73,6 +73,8 @@ struct _GstUDPSink {
|
||||
|
||||
gint port;
|
||||
gchar *host;
|
||||
|
||||
GstClock *clock;
|
||||
};
|
||||
|
||||
struct _GstUDPSinkClass {
|
||||
|
@ -266,7 +266,7 @@ gst_udpsrc_init_receive (GstUDPSrc *src)
|
||||
fcntl (src->control_sock, F_SETFL, O_NONBLOCK);
|
||||
|
||||
GST_FLAG_SET (src, GST_UDPSRC_OPEN);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user