~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/src/global.h

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-12-24 16:33:55 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101224163355-tkvvikqxbrbav6up
Tags: 0.9.11-1
* New upstream release
* Add new build dependencies on libwebkit-dev and libyaml-dev

* Bump Standards-Version up to 3.9.1
* Bump debhelper compatibility to 8
* Patch another typo in the upstream code (lintian notice)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
4
4
 *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
5
5
 *  Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
6
 
 *                                                                              
 
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
8
8
 *  it under the terms of the GNU General Public License as published by
9
9
 *  the Free Software Foundation; either version 3 of the License, or
10
10
 *  (at your option) any later version.
11
 
 *                                                                                
 
11
 *
12
12
 *  This program is distributed in the hope that it will be useful,
13
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
 *  GNU General Public License for more details.
16
 
 *                                                                              
 
16
 *
17
17
 *  You should have received a copy of the GNU General Public License
18
18
 *  along with this program; if not, write to the Free Software
19
19
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
71
71
#define SUCCESS                 0
72
72
 
73
73
#define ASSERT( expected , value)       if( value == expected ) return SUCCESS; \
74
 
                                        else return 1; 
 
74
                                        else return 1;
75
75
#define PIDFILE "sfl.pid"
76
76
 
77
77
#ifdef DATAFORMAT_IS_FLOAT
89
89
#define RINGDIR          "ringtones"            /** Ringtones directory */
90
90
#define CODECDIR         "codecs"               /** Codecs directory */
91
91
 
92
 
#define SIZEBUF                                 1024*1024
 
92
#define SIZEBUF                  400000 /** About 12 sec of buffering at 8000 Hz*/
93
93
#define STATIC_BUFSIZE   5000
94
94
 
95
95
#define ALSA_DFT_CARD_ID     0                  /** Index of the default soundcard */
96
96
 
97
 
#define PCM_PLUGHW      "plughw"                /** Alsa plugin */ 
 
97
#define PCM_PLUGHW      "plughw"                /** Alsa plugin */
98
98
#define PCM_DEFAULT     "default"               /** Default ALSA plugin */
99
99
#define PCM_DMIX        "plug:dmix"             /** Alsa plugin for software mixing */
 
100
#define PCM_DSNOOP      "plug:dsnoop"           /** Alsa plugin for microphone sharing */
 
101
#define PCM_DMIX_DSNOOP "dmix/dsnoop"           /** Audio profile using Alsa dmix/dsnoop */
100
102
 
101
 
#define SFL_CODEC_VALID_PREFIX  "libcodec_"     /** Valid prefix for codecs shared library */ 
 
103
#define SFL_CODEC_VALID_PREFIX  "libcodec_"     /** Valid prefix for codecs shared library */
102
104
#define SFL_CODEC_VALID_EXTEN   ".so"           /** Valid extension for codecs shared library */
103
105
#define CURRENT_DIR             "."             /** Current directory */
104
106
#define PARENT_DIR              ".."            /** Parent directory */
105
107
 
106
 
#define SFL_PCM_BOTH            0x0021          /** To open both playback and capture devices */ 
 
108
#define SFL_PCM_BOTH            0x0021          /** To open both playback and capture devices */
107
109
#define SFL_PCM_PLAYBACK        0x0022          /** To open playback device only */
108
110
#define SFL_PCM_CAPTURE         0x0023          /** To open capture device only */
 
111
#define SFL_PCM_RINGTONE        0x0024
109
112
 
110
113
#ifdef USE_IAX
111
114
#define IAX2_ENABLED  true                      /** IAX2 support */
130
133
#define NETWORK_UNREACHABLE           0x0011    /** Network unreachable */
131
134
#define PULSEAUDIO_NOT_RUNNING          0x0100  /** Pulseaudio is not running */
132
135
 
133
 
#define ALSA                      0 
 
136
#define ALSA                      0
134
137
#define PULSEAUDIO                1
135
 
#define CHECK_INTERFACE( layer , api )            (layer == api) 
 
138
#define CHECK_INTERFACE( layer , api )            (layer == api)
136
139
 
137
 
#define UNUSED          __attribute__((__unused__))      
 
140
#define UNUSED          __attribute__((__unused__))
138
141
 
139
142
#define DEFAULT_SIP_PORT    "5060"
140
143
#define DEFAULT_SIP_TLS_PORT "5061"
144
147
 
145
148
/** Enumeration that contains known audio payloads */
146
149
typedef enum {
147
 
  // http://www.iana.org/assignments/rtp-parameters
148
 
  // http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0
149
 
  // 0 PCMU A 8000 1 [RFC3551]
150
 
  PAYLOAD_CODEC_ULAW = 0, 
151
 
  // 3 GSM  A 8000 1 [RFC3551]
152
 
  PAYLOAD_CODEC_GSM = 3,
153
 
  // 8 PCMA A 8000 1 [RFC3551]
154
 
  PAYLOAD_CODEC_ALAW = 8,
155
 
  // 9 G722 A 8000 1 [RFC3551]
156
 
  PAYLOAD_CODEC_G722 = 9,
157
 
  // http://www.ietf.org/rfc/rfc3952.txt
158
 
  // 97 iLBC/8000
159
 
  PAYLOAD_CODEC_ILBC_20 = 97,
160
 
  PAYLOAD_CODEC_ILBC_30 = 98,
161
 
  // http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt
162
 
  //  97 speex/8000
163
 
  // http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e
164
 
  // 100 speex/16000
165
 
  PAYLOAD_CODEC_SPEEX_8000 = 110,
166
 
  PAYLOAD_CODEC_SPEEX_16000 = 111,
167
 
  PAYLOAD_CODEC_SPEEX_32000 = 112
 
150
    // http://www.iana.org/assignments/rtp-parameters
 
151
    // http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0
 
152
    // 0 PCMU A 8000 1 [RFC3551]
 
153
    PAYLOAD_CODEC_ULAW = 0,
 
154
    // 3 GSM  A 8000 1 [RFC3551]
 
155
    PAYLOAD_CODEC_GSM = 3,
 
156
    // 8 PCMA A 8000 1 [RFC3551]
 
157
    PAYLOAD_CODEC_ALAW = 8,
 
158
    // 9 G722 A 8000 1 [RFC3551]
 
159
    PAYLOAD_CODEC_G722 = 9,
 
160
    // http://www.ietf.org/rfc/rfc3952.txt
 
161
    // 97 iLBC/8000
 
162
    PAYLOAD_CODEC_ILBC_20 = 97,
 
163
    PAYLOAD_CODEC_ILBC_30 = 98,
 
164
    // http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt
 
165
    //  97 speex/8000
 
166
    // http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e
 
167
    // 100 speex/16000
 
168
    PAYLOAD_CODEC_SPEEX_8000 = 110,
 
169
    PAYLOAD_CODEC_SPEEX_16000 = 111,
 
170
    PAYLOAD_CODEC_SPEEX_32000 = 112
168
171
} AudioCodecType;
169
172
 
170
173
/** The struct to reflect the order the user wants to use the codecs */