|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TMS_H |
|
19 #define TMS_H |
|
20 |
|
21 // Include files |
|
22 #include <glib.h> |
|
23 #include <vector> |
|
24 |
|
25 namespace TMS { |
|
26 |
|
27 class TMSFormat; |
|
28 |
|
29 // Result codes |
|
30 #define TMS_RESULT_SUCCESS ((gint)0x00000000) |
|
31 #define TMS_RESULT_ALREADY_EXIST ((gint)0x00000001) |
|
32 #define TMS_RESULT_DOES_NOT_EXIST ((gint)0x00000002) |
|
33 #define TMS_RESULT_NULL_ARGUMENT ((gint)0x00000003) |
|
34 #define TMS_RESULT_INVALID_ARGUMENT ((gint)0x00000004) |
|
35 #define TMS_RESULT_INVALID_STATE ((gint)0x00000005) |
|
36 #define TMS_RESULT_UNINITIALIZED_OBJECT ((gint)0x00000006) |
|
37 #define TMS_RESULT_INSUFFICIENT_MEMORY ((gint)0x00000007) |
|
38 #define TMS_RESULT_GENERAL_ERROR ((gint)0x00000008) |
|
39 #define TMS_RESULT_FATAL_ERROR ((gint)0x00000009) |
|
40 #define TMS_RESULT_OPERATION_CANCELLED ((gint)0x0000000A) |
|
41 #define TMS_RESULT_ILLEGAL_OPERATION ((gint)0x0000000B) |
|
42 #define TMS_RESULT_BUFFER_LATENCY_ERROR ((gint)0x0000000C) |
|
43 #define TMS_RESULT_CALL_TYPE_NOT_SUPPORTED ((gint)0x0000000D) |
|
44 #define TMS_RESULT_BUFFER_TYPE_NOT_SUPPORTED ((gint)0x0000000E) |
|
45 #define TMS_RESULT_SOURCE_TYPE_NOT_SUPPORTED ((gint)0x0000000F) |
|
46 #define TMS_RESULT_SINK_TYPE_NOT_SUPPORTED ((gint)0x00000010) |
|
47 #define TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED ((gint)0x00000011) |
|
48 #define TMS_RESULT_FORMAT_TYPE_NOT_SUPPORTED ((gint)0x00000012) |
|
49 #define TMS_RESULT_EFFECT_TYPE_NOT_SUPPORTED ((gint)0x00000013) |
|
50 #define TMS_RESULT_VERSION_NOT_SUPPORTED ((gint)0x00000014) |
|
51 #define TMS_RESULT_FORMAT_TYPE_UNSPECIFIED ((gint)0x00000015) |
|
52 #define TMS_RESULT_FEATURE_NOT_SUPPORTED ((gint)0x00000016) |
|
53 |
|
54 // Reasons codes |
|
55 #define TMS_REASON_CLIENT_INITIATED ((gint)0x00000000) |
|
56 #define TMS_REASON_DEVICE_IN_USE ((gint)0x00000001) // Device not available |
|
57 #define TMS_REASON_DEVICE_TAKEN ((gint)0x00000002) // Preemption |
|
58 #define TMS_REASON_INSUFFICIENT_MEMORY ((gint)0x00000003) // Memory |
|
59 #define TMS_REASON_PERMISSION_DENIED ((gint)0x00000004) // Client app does not have perission |
|
60 #define TMS_REASON_EMERGENCY_CALL_ONGOING ((gint)0x00000005) // Already ongoing emergency call |
|
61 #define TMS_REASON_EMERGENCY_CALL_STARTED ((gint)0x00000006) // Preemption because of emergency call |
|
62 #define TMS_REASON_SOURCE_NULL ((gint)0x00000007) // Could be checked on client side |
|
63 #define TMS_REASON_SOURCE_NOT_SUPPORTED ((gint)0x00000008) |
|
64 #define TMS_REASON_FORMAT_NULL ((gint)0x00000009) // Could be checked on client side |
|
65 #define TMS_REASON_EFFECT_NOT_SUPPORTED ((gint)0x0000000A) |
|
66 #define TMS_REASON_SINK_NULL ((gint)0x0000000B) // Could be checked on client side |
|
67 #define TMS_REASON_SINK_NOT_SUPPORTED ((gint)0x0000000C) |
|
68 #define TMS_REASON_CALL_NOT_ACTIVE ((gint)0x0000000D) |
|
69 |
|
70 // Event codes |
|
71 #define TMS_EVENT_STREAM_STATE_CHANGED ((gint)0x00000000) |
|
72 #define TMS_EVENT_SOURCE_FILL_BUFFER ((gint)0x00000001) |
|
73 #define TMS_EVENT_SOURCE_PROCESSED_BUFFER ((gint)0x00000002) |
|
74 #define TMS_EVENT_SINK_PROCESS_BUFFER ((gint)0x00000003) |
|
75 #define TMS_EVENT_EFFECT_VOL_CHANGED ((gint)0x00000004) |
|
76 #define TMS_EVENT_EFFECT_GAIN_CHANGED ((gint)0x00000005) |
|
77 #define TMS_EVENT_ROUTING_AVAIL_OUTPUTS_CHANGED ((gint)0x00000006) |
|
78 #define TMS_EVENT_ROUTING_OUTPUT_CHANGED ((gint)0x00000007) |
|
79 #define TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE ((gint)0x00000008) |
|
80 #define TMS_EVENT_RINGTONE_OPEN_COMPLETE ((gint)0x00000009) |
|
81 #define TMS_EVENT_RINGTONE_PLAY_COMPLETE ((gint)0x0000000A) |
|
82 #define TMS_EVENT_DTMF_TONE_STARTED ((gint)0x0000000B) |
|
83 #define TMS_EVENT_DTMF_TONE_STOPPED ((gint)0x0000000C) |
|
84 |
|
85 // Stream states |
|
86 typedef gint TMSStreamState; |
|
87 #define TMS_STREAM_UNINITIALIZED ((gint)0x00000000) |
|
88 #define TMS_STREAM_INITIALIZED ((gint)0x00000001) |
|
89 #define TMS_STREAM_PAUSED ((gint)0x00000002) |
|
90 #define TMS_STREAM_STARTED ((gint)0x00000003) |
|
91 |
|
92 #define DEFAULT_CALL_CONTEXT ((gint)1) |
|
93 |
|
94 // TMS object types |
|
95 typedef gint TMSStreamType; |
|
96 #define TMS_STREAM_UPLINK ((gint)0) |
|
97 #define TMS_STREAM_DOWNLINK ((gint)1) |
|
98 |
|
99 typedef gint TMSBufferType; |
|
100 #define TMS_BUFFER_MEMORY ((gint)2) |
|
101 |
|
102 typedef gint TMSSourceType; |
|
103 #define TMS_SOURCE_CLIENT ((gint)3) |
|
104 #define TMS_SOURCE_MODEM ((gint)4) |
|
105 #define TMS_SOURCE_MIC ((gint)5) |
|
106 |
|
107 typedef gint TMSSinkType; |
|
108 #define TMS_SINK_CLIENT ((gint)6) |
|
109 #define TMS_SINK_MODEM ((gint)7) |
|
110 #define TMS_SINK_SPEAKER ((gint)8) |
|
111 |
|
112 typedef gint TMSEffectType; |
|
113 #define TMS_EFFECT_GLOBAL_VOL ((gint)9) |
|
114 #define TMS_EFFECT_GLOBAL_GAIN ((gint)10) |
|
115 #define TMS_EFFECT_VOLUME ((gint)11) |
|
116 #define TMS_EFFECT_GAIN ((gint)12) |
|
117 |
|
118 typedef gint TMSFormatType; |
|
119 #define TMS_FORMAT_PCM ((gint)13) |
|
120 #define TMS_FORMAT_AMR ((gint)14) |
|
121 #define TMS_FORMAT_G711 ((gint)15) |
|
122 #define TMS_FORMAT_G729 ((gint)16) |
|
123 #define TMS_FORMAT_ILBC ((gint)17) |
|
124 |
|
125 typedef gint TMSRTPSessionType; |
|
126 #define TMS_SESSION_RTP_PUSH ((gint)18) |
|
127 #define TMS_SESSION_RTP_PULL ((gint)19) |
|
128 |
|
129 // TMS vectors |
|
130 typedef std::vector<TMSFormat*> FormatVector; |
|
131 typedef std::vector<guint> BitRateVector; |
|
132 typedef std::vector<guint> OutputVector; |
|
133 |
|
134 // Call types |
|
135 typedef gint TMSCallType; |
|
136 #define TMS_CALL_CS ((gint)0) |
|
137 #define TMS_CALL_ECS ((gint)1) |
|
138 #define TMS_CALL_IP ((gint)2) |
|
139 #define TMS_CALL_RTP ((gint)3) |
|
140 |
|
141 // Codec modes |
|
142 typedef gint TMSG711CodecMode; |
|
143 #define TMS_G711_CODEC_MODE_ALAW ((gint)0) |
|
144 #define TMS_G711_CODEC_MODE_MULAW ((gint)1) |
|
145 |
|
146 typedef gint TMSILBCCodecMode; |
|
147 #define TMS_ILBC_CODEC_MODE_20MS_FRAME ((gint)0) |
|
148 #define TMS_ILBC_CODEC_MODE_30MS_FRAME ((gint)1) |
|
149 |
|
150 // Oudio output types |
|
151 typedef gint TMSAudioOutput; |
|
152 #define TMS_AUDIO_OUTPUT_NONE ((gint)0) |
|
153 #define TMS_AUDIO_OUTPUT_PUBLIC ((gint)1) |
|
154 #define TMS_AUDIO_OUTPUT_PRIVATE ((gint)2) |
|
155 #define TMS_AUDIO_OUTPUT_HANDSET ((gint)3) |
|
156 #define TMS_AUDIO_OUTPUT_LOUDSPEAKER ((gint)4) |
|
157 #define TMS_AUDIO_OUTPUT_WIRED_ACCESSORY ((gint)5) |
|
158 #define TMS_AUDIO_OUTPUT_ACCESSORY ((gint)6) |
|
159 #define TMS_AUDIO_OUTPUT_ETTY ((gint)7) |
|
160 |
|
161 // TMSSignalEvent structure for callback notifications |
|
162 struct TMSSignalEvent |
|
163 { |
|
164 guint type; |
|
165 guint reason; |
|
166 gpointer event_data; |
|
167 gpointer user_data; |
|
168 gint curr_state; |
|
169 gint prev_state; |
|
170 }; |
|
171 |
|
172 // TMSRTPStreamDescription for RTP |
|
173 struct TMSRTPStreamDescription |
|
174 { |
|
175 gint filler1; |
|
176 gint filler2; |
|
177 gint filler3; |
|
178 }; |
|
179 |
|
180 } //namespace TMS |
|
181 |
|
182 #endif // TMS_H |
|
183 |
|
184 // End of file |