~ubuntu-branches/ubuntu/quantal/linphone/quantal

« back to all changes in this revision

Viewing changes to mediastreamer/mediastream.h

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2004-06-30 13:58:16 UTC
  • Revision ID: james.westby@ubuntu.com-20040630135816-wwx75gdlodkqbabb
Tags: upstream-0.12.2
ImportĀ upstreamĀ versionĀ 0.12.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "ms.h"
 
26
#include "msfilter.h"
 
27
#include "msrtprecv.h"
 
28
#include "msrtpsend.h"
 
29
#include "msosswrite.h"
 
30
#include "msossread.h"
 
31
#include "msread.h"
 
32
#include "mswrite.h"
 
33
#include "mstimer.h"
 
34
#include "mscodec.h"
 
35
#include "msspeexdec.h"
 
36
#include "msringplayer.h"
 
37
 
 
38
 
 
39
struct _AudioStream
 
40
{
 
41
        MSSync *timer;
 
42
        RtpSession *send_session;
 
43
        RtpSession *recv_session;
 
44
        MSFilter *soundread;
 
45
        MSFilter *soundwrite;
 
46
        MSFilter *encoder;
 
47
        MSFilter *decoder;
 
48
        MSFilter *rtprecv;
 
49
        MSFilter *rtpsend;
 
50
};
 
51
 
 
52
 
 
53
typedef struct _AudioStream AudioStream;
 
54
 
 
55
struct _RingStream
 
56
{
 
57
        MSSync *timer;
 
58
        MSFilter *source;
 
59
        MSFilter *sndwrite;
 
60
};
 
61
 
 
62
typedef struct _RingStream RingStream;
 
63
 
 
64
/* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */
 
65
AudioStream *audio_stream_start (RtpProfile * prof, int locport, char *remip4,
 
66
                                 int remport, int profile, int jitt_comp);
 
67
 
 
68
AudioStream *audio_stream_start_with_sndcard(RtpProfile * prof, int locport, char *remip4,
 
69
                                 int remport, int profile, int jitt_comp, SndCard *sndcard);
 
70
 
 
71
AudioStream *audio_stream_start_with_files (RtpProfile * prof, int locport,
 
72
                                            char *remip4, int remport,
 
73
                                            int profile, int jitt_comp,
 
74
                                            gchar * infile, gchar * outfile, SndCard *sndcard);
 
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 send_dtmf (AudioStream * stream, gchar dtmf);
 
89
 
 
90
/*****************
 
91
  Video Support
 
92
 *****************/
 
93
 
 
94
struct _VideoStream
 
95
{
 
96
        MSSync *timer;
 
97
        RtpSession *send_session;
 
98
        RtpSession *recv_session;
 
99
        MSFilter *source;
 
100
        MSFilter *dispatcher;
 
101
        MSFilter *mpegwrite;
 
102
        MSFilter *encoder;
 
103
        MSFilter *decoder;
 
104
        MSFilter *rtprecv;
 
105
        MSFilter *rtpsend;
 
106
};
 
107
 
 
108
 
 
109
typedef struct _VideoStream VideoStream;
 
110
 
 
111
VideoStream *video_stream_start_full (int locport, char *remip4, int remport,
 
112
                                      int profile, int jitt_comp,
 
113
                                      gchar * infile, gchar * outfile);
 
114
 
 
115
void video_stream_stop (VideoStream * stream);
 
116
 
 
117
 
 
118
#endif