a-oRTP  5.2.0
rtptransport.h
Go to the documentation of this file.
1 /*
2  The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
3  Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 /*
21  Copyright (C) 2011 Aymeric Moizard <amoizard@gmail.com>
22 */
23 
32 #ifndef RTPTRANSPORT_H
33 #define RTPTRANSPORT_H
34 
35 #include <ortp/port.h>
36 #include <ortp/rtp.h>
37 
38 struct _RtpSession;
39 
40 typedef struct _RtpModule {
41  char name[64];
42  void *data;
43  void *opts;
44  int (*t_global_init)(void);
45  int (*t_global_shutdown)(void);
46  int (*t_set_option)(struct _RtpModule *module, int opt, void *value);
47  int (*t_rtp_sendto)(struct _RtpSession *t, struct _RtpModule *module, mblk_t *msg);
48  int (*t_rtp_recvfrom)(struct _RtpSession *t, struct _RtpModule *module, mblk_t *msg);
49  int (*t_rtcp_sendto)(struct _RtpSession *t, struct _RtpModule *module, mblk_t *msg);
50  int (*t_rtcp_recvfrom)(struct _RtpSession *t, struct _RtpModule *module, mblk_t *msg);
51  void (*t_destroy)(struct _RtpModule *t);
52 } RtpModule;
53 
54 typedef struct _RtpTransport {
55  char name[64];
56  void *data;
57  void *opts;
58  int (*t_global_init)(void);
59  int (*t_global_shutdown)(void);
60  int (*t_set_option)(struct _RtpTransport *transport, int opt, void *value);
61  ortp_socket_t (*t_rtp_getsocket)(const struct _RtpSession *t);
62  ortp_socket_t (*t_rtcp_getsocket)(const struct _RtpSession *t);
63  int (*t_rtp_sendto)(struct _RtpSession *t, mblk_t *msg, int flags, const struct sockaddr *to, socklen_t tolen);
64  int (*t_rtp_recvfrom)(struct _RtpSession *t, int idx, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen);
65  int (*t_rtcp_sendto)(struct _RtpSession *t, mblk_t *msg, int flags, const struct sockaddr *to, socklen_t tolen);
66  int (*t_rtcp_recvfrom)(struct _RtpSession *t, int idx, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen);
67  int (*t_rtp_refresh)(struct _RtpSession *t);
68  int (*t_rtcp_refresh)(struct _RtpSession *t);
69 
70  void (*t_destroy)(struct _RtpTransport *t);
71 } RtpTransport;
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 /* public API */
78 RtpModule *ortp_module_new(const char *name);
79 void ortp_module_add(RtpModule *module);
80 int ortp_module_set_option(RtpModule *module, int opt, void *value);
81 void ortp_module_free(RtpModule *module);
82 bool_t ortp_module_is_supported(const char *name);
83 
84 /* private API */
85 void ortp_module_remove_all(void);
86 
87 /* public API */
88 RtpTransport *ortp_transport_new(const char *name);
89 void ortp_transport_add(RtpTransport *transport);
90 int ortp_transport_set_option(RtpTransport *transport, int opt, void *value);
91 void ortp_transport_free(RtpTransport *transport);
92 bool_t ortp_transport_is_supported(const char *name);
93 
94 /* private API */
95 void ortp_transport_remove_all(void);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
Definition: rtptransport.h:40
Definition: rtpsession.h:261
Definition: rtptransport.h:54
Definition: str_utils.h:25