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 MEDIASTREAM_H
|
|
23 #define MEDIASTREAM_H
|
|
24
|
|
25 #include "msrtprecv.h"
|
|
26 #include "msrtpsend.h"
|
|
27 #include "ms.h"
|
|
28 #include "msosswrite.h"
|
|
29 #include "msossread.h"
|
|
30 #include "msread.h"
|
|
31 #include "mswrite.h"
|
|
32 #include "mstimer.h"
|
|
33 #include "mscodec.h"
|
|
34 #include "msspeexdec.h"
|
|
35 #include "msringplayer.h"
|
|
36
|
|
37
|
|
38 struct _AudioStream
|
|
39 {
|
|
40 MSSync *timer;
|
|
41 RtpSession *send_session;
|
|
42 RtpSession *recv_session;
|
|
43 MSFilter *soundread;
|
|
44 MSFilter *soundwrite;
|
|
45 MSFilter *encoder;
|
|
46 MSFilter *decoder;
|
|
47 MSFilter *rtprecv;
|
|
48 MSFilter *rtpsend;
|
|
49 };
|
|
50
|
|
51
|
|
52 typedef struct _AudioStream AudioStream;
|
|
53
|
|
54 struct _RingStream
|
|
55 {
|
|
56 MSSync *timer;
|
|
57 MSFilter *source;
|
|
58 MSFilter *sndwrite;
|
|
59 };
|
|
60
|
|
61 typedef struct _RingStream RingStream;
|
|
62
|
|
63 /* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */
|
|
64 AudioStream *audio_stream_start (RtpProfile * prof, int locport, char *remip,
|
|
65 int remport, int profile, int jitt_comp);
|
|
66
|
|
67 AudioStream *audio_stream_start_with_sndcards(RtpProfile * prof, int locport, char *remip4,
|
|
68 int remport, int profile, int jitt_comp, SndCard *playcard, SndCard *captcard);
|
|
69
|
|
70 AudioStream *audio_stream_start_with_files (RtpProfile * prof, int locport,
|
|
71 char *remip4, int remport,
|
|
72 int profile, int jitt_comp,
|
|
73 gchar * infile, gchar * outfile);
|
|
74 void audio_stream_set_rtcp_information(AudioStream *st, const char *cname);
|
|
75
|
|
76
|
|
77 /* stop the above process*/
|
|
78 void audio_stream_stop (AudioStream * stream);
|
|
79
|
|
80 RingStream *ring_start (gchar * file, gint interval, SndCard *sndcard);
|
|
81 RingStream *ring_start_with_cb(gchar * file, gint interval, SndCard *sndcard, MSFilterNotifyFunc func,gpointer user_data);
|
|
82 void ring_stop (RingStream * stream);
|
|
83
|
|
84 /* returns the latency in samples if the audio device with id dev_id is openable in full duplex mode, else 0 */
|
|
85 gint test_audio_dev (int dev_id);
|
|
86
|
|
87 /* send a dtmf */
|
|
88 gint audio_stream_send_dtmf (AudioStream * stream, gchar dtmf);
|
|
89
|
|
90 void audio_stream_set_default_card(int cardindex);
|
|
91
|
|
92
|
|
93 #ifdef VIDEO_ENABLED
|
|
94
|
|
95 /*****************
|
|
96 Video Support
|
|
97 *****************/
|
|
98
|
|
99
|
|
100
|
|
101 struct _VideoStream
|
|
102 {
|
|
103 MSSync *timer;
|
|
104 RtpSession *send_session;
|
|
105 RtpSession *recv_session;
|
|
106 MSFilter *source;
|
|
107 MSFilter *output;
|
|
108 MSFilter *encoder;
|
|
109 MSFilter *decoder;
|
|
110 MSFilter *rtprecv;
|
|
111 MSFilter *rtpsend;
|
|
112 gboolean show_local;
|
|
113 };
|
|
114
|
|
115
|
|
116 typedef struct _VideoStream VideoStream;
|
|
117
|
|
118 VideoStream *video_stream_start(RtpProfile *profile, int locport, char *remip4, int remport,
|
|
119 int payload, int jitt_comp, gboolean show_local, const gchar *source, const gchar *device);
|
|
120 void video_stream_set_rtcp_information(VideoStream *st, const char *cname);
|
|
121 void video_stream_stop (VideoStream * stream);
|
|
122
|
|
123 VideoStream * video_preview_start(const gchar *source, const gchar *device);
|
|
124 void video_preview_stop(VideoStream *stream);
|
|
125
|
|
126 #endif
|
|
127
|
|
128 #endif
|