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;
|
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
|
static void
|
||||||
gst_udpsink_init (GstUDPSink *udpsink)
|
gst_udpsink_init (GstUDPSink *udpsink)
|
||||||
{
|
{
|
||||||
@ -175,6 +185,10 @@ gst_udpsink_init (GstUDPSink *udpsink)
|
|||||||
|
|
||||||
udpsink->host = g_strdup (UDP_DEFAULT_HOST);
|
udpsink->host = g_strdup (UDP_DEFAULT_HOST);
|
||||||
udpsink->port = UDP_DEFAULT_PORT;
|
udpsink->port = UDP_DEFAULT_PORT;
|
||||||
|
|
||||||
|
udpsink->clock = NULL;
|
||||||
|
|
||||||
|
GST_ELEMENT (udpsink)->setclockfunc = gst_udpsink_set_clock;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -182,6 +196,7 @@ gst_udpsink_chain (GstPad *pad, GstBuffer *buf)
|
|||||||
{
|
{
|
||||||
GstUDPSink *udpsink;
|
GstUDPSink *udpsink;
|
||||||
int tolen;
|
int tolen;
|
||||||
|
GstClockTimeDiff *jitter = NULL;
|
||||||
|
|
||||||
g_return_if_fail (pad != NULL);
|
g_return_if_fail (pad != NULL);
|
||||||
g_return_if_fail (GST_IS_PAD (pad));
|
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));
|
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);
|
tolen = sizeof(udpsink->theiraddr);
|
||||||
|
|
||||||
if (sendto (udpsink->sock, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), 0,
|
if (sendto (udpsink->sock, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), 0,
|
||||||
|
@ -73,6 +73,8 @@ struct _GstUDPSink {
|
|||||||
|
|
||||||
gint port;
|
gint port;
|
||||||
gchar *host;
|
gchar *host;
|
||||||
|
|
||||||
|
GstClock *clock;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstUDPSinkClass {
|
struct _GstUDPSinkClass {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user