12024
|
1 /*
|
|
2 The mediastreamer library aims at providing modular media processing and I/O
|
|
3 for linphone, but also for any telephony application.
|
|
4 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
|
|
5
|
|
6 This library is free software; you can redistribute it and/or
|
|
7 modify it under the terms of the GNU Lesser General Public
|
|
8 License as published by the Free Software Foundation; either
|
|
9 version 2.1 of the License, or (at your option) any later version.
|
|
10
|
|
11 This library is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14 Lesser General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU Lesser General Public
|
|
17 License along with this library; if not, write to the Free Software
|
|
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19 */
|
|
20
|
|
21
|
|
22 #ifndef MSRTPSEND_H
|
|
23 #define MSRTPSEND_H
|
|
24
|
|
25 #include "msfilter.h"
|
|
26 #include "mssync.h"
|
|
27
|
|
28 #undef PACKAGE
|
|
29 #undef VERSION
|
|
30 #include <ortp/ortp.h>
|
|
31
|
|
32
|
|
33 /*this is the class that implements a sending through rtp filter*/
|
|
34
|
|
35 #define MSRTPSEND_MAX_INPUTS 1 /* max input per filter*/
|
|
36
|
|
37 #define MSRTPSEND_DEF_GRAN 4096/* the default granularity*/
|
|
38
|
|
39 struct _MSRtpSend
|
|
40 {
|
|
41 /* the MSCopy derivates from MSFilter, so the MSFilter object MUST be the first of the MSCopy object
|
|
42 in order to the object mechanism to work*/
|
|
43 MSFilter filter;
|
|
44 MSFifo *f_inputs[MSRTPSEND_MAX_INPUTS];
|
|
45 MSQueue *q_inputs[MSRTPSEND_MAX_INPUTS];
|
|
46 MSSync *sync;
|
|
47 RtpSession *rtpsession;
|
|
48 guint32 ts;
|
|
49 guint32 ts_inc; /* the timestamp increment */
|
|
50 gint packet_size;
|
|
51 guint flags;
|
|
52 guint delay; /* number of _proccess call which must be skipped */
|
|
53 #define RTPSEND_CONFIGURED (1)
|
|
54 };
|
|
55
|
|
56 typedef struct _MSRtpSend MSRtpSend;
|
|
57
|
|
58 struct _MSRtpSendClass
|
|
59 {
|
|
60 /* the MSRtpSend derivates from MSFilter, so the MSFilter class MUST be the first of the MSCopy class
|
|
61 in order to the class mechanism to work*/
|
|
62 MSFilterClass parent_class;
|
|
63 };
|
|
64
|
|
65 typedef struct _MSRtpSendClass MSRtpSendClass;
|
|
66
|
|
67 /* PUBLIC */
|
|
68 #define MS_RTP_SEND(filter) ((MSRtpSend*)(filter))
|
|
69 #define MS_RTP_SEND_CLASS(klass) ((MSRtpSendClass*)(klass))
|
|
70 MSFilter * ms_rtp_send_new(void);
|
|
71 RtpSession * ms_rtp_send_set_session(MSRtpSend *obj,RtpSession *session);
|
|
72 #define ms_rtp_send_unset_session(obj) (ms_rtp_send_set_session((obj),NULL))
|
|
73 #define ms_rtp_send_get_session(obj) ((obj)->rtpsession)
|
|
74 void ms_rtp_send_set_timing(MSRtpSend *r, guint32 ts_inc, gint payload_size);
|
|
75 gint ms_rtp_send_dtmf(MSRtpSend *r, gchar dtmf);
|
|
76
|
|
77
|
|
78 /* FOR INTERNAL USE*/
|
|
79 void ms_rtp_send_init(MSRtpSend *r);
|
|
80 void ms_rtp_send_class_init(MSRtpSendClass *klass);
|
|
81 void ms_rtp_send_destroy( MSRtpSend *obj);
|
|
82 void ms_rtp_send_process(MSRtpSend *r);
|
|
83 void ms_rtp_send_setup(MSRtpSend *r, MSSync *sync);
|
|
84
|
|
85 #endif
|