Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / libs / gst / net / gstnettimepacket.h
1 /* GStreamer
2  * Copyright (C) 2005 Andy Wingo <wingo@pobox.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __GST_NET_TIME_PACKET_H__
22 #define __GST_NET_TIME_PACKET_H__
23
24 #include <gst/gst.h>
25 #include <gio/gio.h>
26
27 G_BEGIN_DECLS
28
29 /**
30  * GST_NET_TIME_PACKET_SIZE:
31  *
32  * The size of the packets sent between network clocks.
33  */
34 #define GST_NET_TIME_PACKET_SIZE 16
35
36 typedef struct _GstNetTimePacket GstNetTimePacket;
37
38 /**
39  * GstNetTimePacket:
40  * @local_time: the local time when this packet was sent
41  * @remote_time: the remote time observation
42  *
43  * Content of a #GstNetTimePacket.
44  */
45 struct _GstNetTimePacket {
46   GstClockTime local_time;
47   GstClockTime remote_time;
48 };
49
50 /* FIXME 0.11: get rid of the packet stuff? add an unref/free function? */
51 GstNetTimePacket*       gst_net_time_packet_new         (const guint8 *buffer);
52 guint8*                 gst_net_time_packet_serialize   (const GstNetTimePacket *packet);
53
54 GstNetTimePacket*       gst_net_time_packet_receive     (GSocket         * socket,
55                                                          GSocketAddress ** src_address,
56                                                          GError         ** error);
57
58 gboolean                gst_net_time_packet_send        (const GstNetTimePacket * packet,
59                                                          GSocket                * socket,
60                                                          GSocketAddress         * dest_address,
61                                                          GError                ** error);
62
63 G_END_DECLS
64
65
66 #endif /* __GST_NET_TIME_PACKET_H__ */