|
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 |
|
26 G_BEGIN_DECLS |
|
27 |
|
28 #include <errno.h> |
|
29 #include <string.h> |
|
30 #include <sys/types.h> |
|
31 |
|
32 #ifdef G_OS_WIN32 |
|
33 #include <winsock2.h> |
|
34 #include <ws2tcpip.h> |
|
35 #else |
|
36 #include <netdb.h> |
|
37 #include <sys/socket.h> |
|
38 #include <netinet/in.h> |
|
39 #include <arpa/inet.h> |
|
40 #endif |
|
41 |
|
42 /** |
|
43 * GST_NET_TIME_PACKET_SIZE: |
|
44 * |
|
45 * The size of the packets sent between network clocks. |
|
46 */ |
|
47 #define GST_NET_TIME_PACKET_SIZE 16 |
|
48 |
|
49 typedef struct _GstNetTimePacket GstNetTimePacket; |
|
50 |
|
51 /** |
|
52 * GstNetTimePacket: |
|
53 * @local_time: the local time when this packet was sent |
|
54 * @remote_time: the remote time observation |
|
55 * |
|
56 * Content of a #GstNetTimePacket. |
|
57 */ |
|
58 struct _GstNetTimePacket { |
|
59 GstClockTime local_time; |
|
60 GstClockTime remote_time; |
|
61 }; |
|
62 #ifdef __SYMBIAN32__ |
|
63 IMPORT_C |
|
64 #endif |
|
65 |
|
66 |
|
67 GstNetTimePacket* gst_net_time_packet_new (const guint8 *buffer); |
|
68 #ifdef __SYMBIAN32__ |
|
69 IMPORT_C |
|
70 #endif |
|
71 |
|
72 guint8* gst_net_time_packet_serialize (const GstNetTimePacket *packet); |
|
73 #ifdef __SYMBIAN32__ |
|
74 IMPORT_C |
|
75 #endif |
|
76 |
|
77 |
|
78 GstNetTimePacket* gst_net_time_packet_receive (gint fd, struct sockaddr *addr, |
|
79 socklen_t *len); |
|
80 #ifdef __SYMBIAN32__ |
|
81 IMPORT_C |
|
82 #endif |
|
83 |
|
84 gint gst_net_time_packet_send (const GstNetTimePacket *packet, |
|
85 gint fd, struct sockaddr *addr, |
|
86 socklen_t len); |
|
87 |
|
88 G_END_DECLS |
|
89 |
|
90 |
|
91 #endif /* __GST_NET_TIME_PACKET_H__ */ |