libs/gst/: Documentation updates.
[platform/upstream/gstreamer.git] / libs / gst / net / gstnettimeprovider.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_PROVIDER_H__
22 #define __GST_NET_TIME_PROVIDER_H__
23
24 #include <gst/gst.h>
25
26 G_BEGIN_DECLS
27
28 #include <errno.h>
29 #include <string.h>
30 #include <sys/types.h>
31 #include <netdb.h>
32 #include <sys/socket.h>
33 #include <netinet/in.h>
34 #include <arpa/inet.h>
35
36 #include <fcntl.h>
37
38 #define GST_TYPE_NET_TIME_PROVIDER \
39   (gst_net_time_provider_get_type())
40 #define GST_NET_TIME_PROVIDER(obj) \
41   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NET_TIME_PROVIDER,GstNetTimeProvider))
42 #define GST_NET_TIME_PROVIDER_CLASS(klass) \
43   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NET_TIME_PROVIDER,GstNetTimeProvider))
44 #define GST_IS_NET_TIME_PROVIDER(obj) \
45   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NET_TIME_PROVIDER))
46 #define GST_IS_NET_TIME_PROVIDER_CLASS(obj) \
47   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NET_TIME_PROVIDER))
48
49 typedef struct _GstNetTimeProvider GstNetTimeProvider;
50 typedef struct _GstNetTimeProviderClass GstNetTimeProviderClass;
51
52 /**
53  * GstNetTimeProvider:
54  * @parent: the parent object structure.
55  *
56  * Opaque #GstNetTimeProvider structure.
57  */
58 struct _GstNetTimeProvider {
59   GstObject parent;
60
61   /*< private >*/
62   gchar *address;
63   int port;
64
65   int sock;
66   int control_sock[2];
67
68   GThread *thread;
69
70   GstClock *clock;
71
72   union {
73     gpointer _gst_reserved1;
74     /* has to be a gint, we use atomic ops here */
75     gint active;
76   } active;
77   
78   /*< private >*/
79   gpointer _gst_reserved[GST_PADDING - 1];
80 };
81
82 struct _GstNetTimeProviderClass {
83   GstObjectClass parent_class;
84 };
85
86 GType                   gst_net_time_provider_get_type  (void);
87 GstNetTimeProvider*     gst_net_time_provider_new       (GstClock *clock,
88                                                          const gchar *address,
89                                                          gint port);
90
91 G_END_DECLS
92
93
94 #endif /* __GST_NET_TIME_PROVIDER_H__ */