libs/gst/: Documentation updates.
[platform/upstream/gstreamer.git] / libs / gst / net / gstnetclientclock.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2005 Wim Taymans <wim@fluendo.com>
4  *                    2005 Andy Wingo <wingo@pobox.com>
5  *
6  * gstnetclientclock.h: clock that synchronizes itself to a time provider over
7  * the network
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25
26 #ifndef __GST_NET_CLIENT_CLOCK_H__
27 #define __GST_NET_CLIENT_CLOCK_H__
28
29 #include <gst/gst.h>
30 #include <gst/gstsystemclock.h>
31
32 G_BEGIN_DECLS
33
34 #include <errno.h>
35 #include <string.h>
36 #include <sys/types.h>
37 #include <netdb.h>
38 #include <sys/socket.h>
39 #include <netinet/in.h>
40 #include <arpa/inet.h>
41
42 #include <fcntl.h>
43
44 #define GST_TYPE_NET_CLIENT_CLOCK \
45   (gst_net_client_clock_get_type())
46 #define GST_NET_CLIENT_CLOCK(obj) \
47   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NET_CLIENT_CLOCK,GstNetClientClock))
48 #define GST_NET_CLIENT_CLOCK_CLASS(klass) \
49   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NET_CLIENT_CLOCK,GstNetClientClockClass))
50 #define GST_IS_NET_CLIENT_CLOCK(obj) \
51   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NET_CLIENT_CLOCK))
52 #define GST_IS_NET_CLIENT_CLOCK_CLASS(obj) \
53   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NET_CLIENT_CLOCK))
54
55 typedef struct _GstNetClientClock GstNetClientClock;
56 typedef struct _GstNetClientClockClass GstNetClientClockClass;
57
58 /**
59  * GstNetClientClock:
60  * @clock: the parent clock structure.
61  *
62  * Opaque #GstNetClientClock structure.
63  */
64 struct _GstNetClientClock {
65   GstSystemClock clock;
66
67   /*< protected >*/
68   gchar *address;
69   gint port;
70   
71   /*< private >*/
72   int sock;
73   int control_sock[2];
74
75   GstClockTime current_timeout;
76
77   struct sockaddr_id *servaddr;
78
79   GThread *thread;
80
81   /*< private >*/
82   gpointer _gst_reserved[GST_PADDING];
83 };
84
85 struct _GstNetClientClockClass {
86   GstSystemClockClass parent_class;
87
88   /*< private >*/
89   gpointer _gst_reserved[GST_PADDING];
90 };
91
92 GType           gst_net_client_clock_get_type   (void);
93 GstClock*       gst_net_client_clock_new        (gchar *name, const gchar *remote_address,
94                                                  gint remote_port, GstClockTime base_time);
95
96 G_END_DECLS
97
98 #endif /* __GST_NET_CLIENT_CLOCK_H__ */