Debian Codegraph @

Xpjproject/pjsip-apps/src/3rdparty_media_sample/alt_pjsua_aud.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 #include <pjsua-lib/pjsua.h>
19 #include <pjsua-lib/pjsua_internal.h>
20
21 #if defined(PJSUA_MEDIA_HAS_PJMEDIA) && PJSUA_MEDIA_HAS_PJMEDIA != 0
22 # error The PJSUA_MEDIA_HAS_PJMEDIA should be declared as zero
23 #endif
24
25
26 #define THIS_FILE "alt_pjsua_aud.c"
27 #define UNIMPLEMENTED(func) PJ_LOG(2,(THIS_FILE, "*** Call to unimplemented function %s ***", #func));
28
29
30 /*****************************************************************************
31 * Our dummy codecs. Since we won't use any PJMEDIA codecs, we need to declare
32 * our own codecs and register them to PJMEDIA's codec manager. We just need
33 * the info so that they can be listed in SDP. The encoding and decoding will
34 * happen in your third party media stream and will not use these codecs,
35 * hence the "dummy" name.
36 */
37 static struct alt_codec
38 {
39 pj_str_t encoding_name;
40 pj_uint8_t payload_type;
41 unsigned clock_rate;
42 unsigned channel_cnt;
43 unsigned frm_ptime;
44 unsigned avg_bps;
45 unsigned max_bps;
46 } codec_list[] =
47 {
48 /* G.729 */
49 { { "G729", 4 }, 18, 8000, 1, 10, 8000, 8000 },
50 /* PCMU */
51 { { "PCMU", 4 }, 0, 8000, 1, 10, 64000, 64000 },
52 /* Our proprietary high end low bit rate (5kbps) codec, if you wish */
53 { { "FOO", 3 }, PJMEDIA_RTP_PT_START+0, 16000, 1, 20, 5000, 5000 },
54 };
55
56 static struct alt_codec_factory
57 {
58 pjmedia_codec_factory base;
59 } alt_codec_factory;
60
61 static pj_status_t alt_codec_test_alloc( pjmedia_codec_factory *factory,
62 const pjmedia_codec_info *id )
63 {
64 unsigned i;
65 for (i=0; i<PJ_ARRAY_SIZE(codec_list); ++i) {
66 if (pj_stricmp(&id->encoding_name, &codec_list[i].encoding_name)==0)
67 return PJ_SUCCESS;
68 }
69 return PJ_ENOTSUP;
70 }
71
72 static pj_status_t alt_codec_default_attr( pjmedia_codec_factory *factory,
73 const pjmedia_codec_info *id,
74 pjmedia_codec_param *attr )
75 {
76 struct alt_codec *ac;
77 unsigned i;
78
79 PJ_UNUSED_ARG(factory);
80
81 for (i=0; i<PJ_ARRAY_SIZE(codec_list); ++i) {
82 if (pj_stricmp(&id->encoding_name, &codec_list[i].encoding_name)==0)
83 break;
84 }
85 if (i == PJ_ARRAY_SIZE(codec_list))
86 return PJ_ENOTFOUND;
87
88 ac = &codec_list[i];
89
90 pj_bzero(attr, sizeof(pjmedia_codec_param));
91 attr->info.clock_rate = ac->clock_rate;
92 attr->info.channel_cnt = ac->channel_cnt;
93 attr->info.avg_bps = ac->avg_bps;
94 attr->info.max_bps = ac->max_bps;
95 attr->info.pcm_bits_per_sample = 16;
96 attr->info.frm_ptime = ac->frm_ptime;
97 attr->info.pt = ac->payload_type;
98
99 attr->setting.frm_per_pkt = 1;
100 attr->setting.vad = 1;
101 attr->setting.plc = 1;
102
103 return PJ_SUCCESS;
104 }
105
106 static pj_status_t alt_codec_enum_codecs(pjmedia_codec_factory *factory,
107 unsigned *count,
108 pjmedia_codec_info codecs[])
109 {
110 unsigned i;
111
112 for (i=0; i<*count && i<PJ_ARRAY_SIZE(codec_list); ++i) {
113 struct alt_codec *ac = &codec_list[i];
114 pj_bzero(&codecs[i], sizeof(pjmedia_codec_info));
115 codecs[i].encoding_name = ac->encoding_name;
116 codecs[i].pt = ac->payload_type;
117 codecs[i].type = PJMEDIA_TYPE_AUDIO;
118 codecs[i].clock_rate = ac->clock_rate;
119 codecs[i].channel_cnt = ac->channel_cnt;
120 }
121
122 *count = i;
123
124 return PJ_SUCCESS;
125 }
126
127 static pj_status_t alt_codec_alloc_codec(pjmedia_codec_factory *factory,
128 const pjmedia_codec_info *id,
129 pjmedia_codec **p_codec)
130 {
131 /* This will never get called since we won't be using this codec */
132 UNIMPLEMENTED(alt_codec_alloc_codec)
133 return PJ_ENOTSUP;
134 }
135
136 static pj_status_t alt_codec_dealloc_codec( pjmedia_codec_factory *factory,
137 pjmedia_codec *codec )
138 {
139 /* This will never get called */
140 UNIMPLEMENTED(alt_codec_dealloc_codec)
141 return PJ_ENOTSUP;
142 }
143
144 static pj_status_t alt_codec_deinit(void)
145 {
146 pjmedia_codec_mgr *codec_mgr;
147 codec_mgr = pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt);
148 return pjmedia_codec_mgr_unregister_factory(codec_mgr,
149 &alt_codec_factory.base);
150
151 }
152
153 static pjmedia_codec_factory_op alt_codec_factory_op =
154 {
155 &alt_codec_test_alloc,
156 &alt_codec_default_attr,
157 &alt_codec_enum_codecs,
158 &alt_codec_alloc_codec,
159 &alt_codec_dealloc_codec,
160 &alt_codec_deinit
161 };
162
163
164 /*****************************************************************************
165 * API
166 */
167
168 /* Initialize third party media library. */
169 pj_status_t pjsua_aud_subsys_init()
170 {
171 pjmedia_codec_mgr *codec_mgr;
172 pj_status_t status;
173
174 /* Register our "dummy" codecs */
175 alt_codec_factory.base.op = &alt_codec_factory_op;
176 codec_mgr = pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt);
177 status = pjmedia_codec_mgr_register_factory(codec_mgr,
178 &alt_codec_factory.base);
179 if (status != PJ_SUCCESS)
180 return status;
181
182 /* TODO: initialize your evil library here */
183 return PJ_SUCCESS;
184 }
185
186 /* Start (audio) media library. */
187 pj_status_t pjsua_aud_subsys_start(void)
188 {
189 /* TODO: */
190 return PJ_SUCCESS;
191 }
192
193 /* Cleanup and deinitialize third party media library. */
194 pj_status_t pjsua_aud_subsys_destroy()
195 {
196 /* TODO: */
197 return PJ_SUCCESS;
198 }
199
200 /* Our callback to receive incoming RTP packets */
201 static void aud_rtp_cb(void *user_data, void *pkt, pj_ssize_t size)
202 {
203 pjsua_call_media *call_med = (pjsua_call_media*) user_data;
204
205 /* TODO: Do something with the packet */
206 PJ_LOG(4,(THIS_FILE, "RX %d bytes audio RTP packet", (int)size));
207 }
208
209 /* Our callback to receive RTCP packets */
210 static void aud_rtcp_cb(void *user_data, void *pkt, pj_ssize_t size)
211 {
212 pjsua_call_media *call_med = (pjsua_call_media*) user_data;
213
214 /* TODO: Do something with the packet here */
215 PJ_LOG(4,(THIS_FILE, "RX %d bytes audio RTCP packet", (int)size));
216 }
217
218 /* A demo function to send dummy "RTP" packets periodically. You would not
219 * need to have this function in the real app!
220 */
221 static void timer_to_send_aud_rtp(void *user_data)
222 {
223 pjsua_call_media *call_med = (pjsua_call_media*) user_data;
224 const char *pkt = "Not RTP packet";
225
226 if (!call_med->call || !call_med->call->inv || !call_med->tp) {
227 /* Call has been disconnected. There is race condition here as
228 * this cb may be called sometime after call has been disconnected */
229 return;
230 }
231
232 pjmedia_transport_send_rtp(call_med->tp, pkt, strlen(pkt));
233
234 pjsua_schedule_timer2(&timer_to_send_aud_rtp, call_med, 2000);
235 }
236
237 static void timer_to_send_aud_rtcp(void *user_data)
238 {
239 pjsua_call_media *call_med = (pjsua_call_media*) user_data;
240 const char *pkt = "Not RTCP packet";
241
242 if (!call_med->call || !call_med->call->inv || !call_med->tp) {
243 /* Call has been disconnected. There is race condition here as
244 * this cb may be called sometime after call has been disconnected */
245 return;
246 }
247
248 pjmedia_transport_send_rtcp(call_med->tp, pkt, strlen(pkt));
249
250 pjsua_schedule_timer2(&timer_to_send_aud_rtcp, call_med, 5000);
251 }
252
253 /* Stop the audio stream of a call. */
254 void pjsua_aud_stop_stream(pjsua_call_media *call_med)
255 {
256 /* Detach our RTP/RTCP callbacks from transport */
257 if (call_med->tp) {
258 pjmedia_transport_detach(call_med->tp, call_med);
259 }
260
261 /* TODO: destroy your audio stream here */
262 }
263
264 /*
265 * This function is called whenever SDP negotiation has completed
266 * successfully. Here you'd want to start your audio stream
267 * based on the info in the SDPs.
268 */
269 pj_status_t pjsua_aud_channel_update(pjsua_call_media *call_med,
270 pj_pool_t *tmp_pool,
271 pjmedia_stream_info *si,
272 const pjmedia_sdp_session *local_sdp,
273 const pjmedia_sdp_session *remote_sdp)
274 {
275 pj_status_t status = PJ_SUCCESS;
276
277 PJ_LOG(4,(THIS_FILE,"Alt audio channel update.."));
278 pj_log_push_indent();
279
280 /* Check if no media is active */
281 if (si->dir != PJMEDIA_DIR_NONE) {
282 /* Attach our RTP and RTCP callbacks to the media transport */
283 status = pjmedia_transport_attach(call_med->tp, call_med,
284 &si->rem_addr, &si->rem_rtcp,
285 pj_sockaddr_get_len(&si->rem_addr),
286 &aud_rtp_cb, &aud_rtcp_cb);
287
288 /* For a demonstration, let's use a timer to send "RTP" packet
289 * periodically.
290 */
291 pjsua_schedule_timer2(&timer_to_send_aud_rtp, call_med, 0);
292 pjsua_schedule_timer2(&timer_to_send_aud_rtcp, call_med, 2500);
293
294 /* TODO:
295 * - Create and start your media stream based on the parameters
296 * in si
297 */
298 }
299
300 on_return:
301 pj_log_pop_indent();
302 return status;
303 }
304
305 void pjsua_check_snd_dev_idle()
306 {
307 }
308
309 /*****************************************************************************
310 *
311 * Call API which MAY need to be re-implemented if different backend is used.
312 */
313
314 /* Check if call has an active media session. */
315 PJ_DEF(pj_bool_t) pjsua_call_has_media(pjsua_call_id call_id)
316 {
317 UNIMPLEMENTED(pjsua_call_has_media)
318 return PJ_TRUE;
319 }
320
321
322 /* Get the conference port identification associated with the call. */
323 PJ_DEF(pjsua_conf_port_id) pjsua_call_get_conf_port(pjsua_call_id call_id)
324 {
325 UNIMPLEMENTED(pjsua_call_get_conf_port)
326 return PJSUA_INVALID_ID;
327 }
328
329 /* Modify audio stream's codec parameters. */
330 PJ_DEF(pj_status_t)
331 pjsua_call_aud_stream_modify_codec_param(pjsua_call_id call_id,
332 int med_idx,
333 const pjmedia_codec_param *param)
334 {
335 UNIMPLEMENTED(pjsua_call_aud_stream_modify_codec_param)
336 return PJ_ENOTSUP;
337 }
338
339 /* Get media stream info for the specified media index. */
340 PJ_DEF(pj_status_t) pjsua_call_get_stream_info( pjsua_call_id call_id,
341 unsigned med_idx,
342 pjsua_stream_info *psi)
343 {
344 pj_bzero(psi, sizeof(*psi));
345 UNIMPLEMENTED(pjsua_call_get_stream_info)
346 return PJ_ENOTSUP;
347 }
348
349 /* Get media stream statistic for the specified media index. */
350 PJ_DEF(pj_status_t) pjsua_call_get_stream_stat( pjsua_call_id call_id,
351 unsigned med_idx,
352 pjsua_stream_stat *stat)
353 {
354 pj_bzero(stat, sizeof(*stat));
355 UNIMPLEMENTED(pjsua_call_get_stream_stat)
356 return PJ_ENOTSUP;
357 }
358
359 /*
360 * Send DTMF digits to remote using RFC 2833 payload formats.
361 */
362 PJ_DEF(pj_status_t) pjsua_call_dial_dtmf( pjsua_call_id call_id,
363 const pj_str_t *digits)
364 {
365 UNIMPLEMENTED(pjsua_call_dial_dtmf)
366 return PJ_ENOTSUP;
367 }
368
369 PJ_DEF(pj_status_t) pjsua_call_dial_dtmf2( pjsua_call_id call_id,
370 const pj_str_t *digits,
371 unsigned duration)
372 {
373 UNIMPLEMENTED(pjsua_call_dial_dtmf2)
374 return PJ_ENOTSUP;
375 }
376
377 /*****************************************************************************
378 * Below are auxiliary API that we don't support (feel free to implement them
379 * with the other media stack)
380 */
381
382 PJ_DEF(void) pjsua_conf_connect_param_default(pjsua_conf_connect_param *prm)
383 {
384 UNIMPLEMENTED(pjsua_conf_connect_param_default)
385 }
386
387 /* Get maximum number of conference ports. */
388 PJ_DEF(unsigned) pjsua_conf_get_max_ports(void)
389 {
390 UNIMPLEMENTED(pjsua_conf_get_max_ports)
391 return 0xFF;
392 }
393
394 /* Get current number of active ports in the bridge. */
395 PJ_DEF(unsigned) pjsua_conf_get_active_ports(void)
396 {
397 UNIMPLEMENTED(pjsua_conf_get_active_ports)
398 return 0;
399 }
400
401 /* Enumerate all conference ports. */
402 PJ_DEF(pj_status_t) pjsua_enum_conf_ports(pjsua_conf_port_id id[],
403 unsigned *count)
404 {
405 *count = 0;
406 UNIMPLEMENTED(pjsua_enum_conf_ports)
407 return PJ_ENOTSUP;
408 }
409
410 /* Get information about the specified conference port */
411 PJ_DEF(pj_status_t) pjsua_conf_get_port_info( pjsua_conf_port_id id,
412 pjsua_conf_port_info *info)
413 {
414 UNIMPLEMENTED(pjsua_conf_get_port_info)
415 return PJ_ENOTSUP;
416 }
417
418 /* Add arbitrary media port to PJSUA's conference bridge. */
419 PJ_DEF(pj_status_t) pjsua_conf_add_port( pj_pool_t *pool,
420 pjmedia_port *port,
421 pjsua_conf_port_id *p_id)
422 {
423 *p_id = PJSUA_INVALID_ID;
424 UNIMPLEMENTED(pjsua_conf_add_port)
425 /* We should return PJ_ENOTSUP here, but this API is needed by pjsua
426 * application or otherwise it will refuse to start.
427 */
428 return PJ_SUCCESS;
429 }
430
431 /* Remove arbitrary slot from the conference bridge. */
432 PJ_DEF(pj_status_t) pjsua_conf_remove_port(pjsua_conf_port_id id)
433 {
434 UNIMPLEMENTED(pjsua_conf_remove_port)
435 return PJ_ENOTSUP;
436 }
437
438 /* Establish unidirectional media flow from souce to sink. */
439 PJ_DEF(pj_status_t) pjsua_conf_connect( pjsua_conf_port_id source,
440 pjsua_conf_port_id sink)
441 {
442 UNIMPLEMENTED(pjsua_conf_connect)
443 return PJ_ENOTSUP;
444 }
445
446 /*
447 * Establish unidirectional media flow from souce to sink, with signal
448 * level adjustment.
449 */
450 PJ_DEF(pj_status_t) pjsua_conf_connect2( pjsua_conf_port_id source,
451 pjsua_conf_port_id sink,
452 const pjsua_conf_connect_param *prm)
453 {
454 UNIMPLEMENTED(pjsua_conf_connect2)
455 return PJ_ENOTSUP;
456 }
457
458 /* Disconnect media flow from the source to destination port. */
459 PJ_DEF(pj_status_t) pjsua_conf_disconnect( pjsua_conf_port_id source,
460 pjsua_conf_port_id sink)
461 {
462 UNIMPLEMENTED(pjsua_conf_disconnect)
463 return PJ_ENOTSUP;
464 }
465
466 /* Adjust the signal level to be transmitted from the bridge to the
467 * specified port by making it louder or quieter.
468 */
469 PJ_DEF(pj_status_t) pjsua_conf_adjust_tx_level(pjsua_conf_port_id slot,
470 float level)
471 {
472 UNIMPLEMENTED(pjsua_conf_adjust_tx_level)
473 return PJ_ENOTSUP;
474 }
475
476 /* Adjust the signal level to be received from the specified port (to
477 * the bridge) by making it louder or quieter.
478 */
479 PJ_DEF(pj_status_t) pjsua_conf_adjust_rx_level(pjsua_conf_port_id slot,
480 float level)
481 {
482 UNIMPLEMENTED(pjsua_conf_adjust_rx_level)
483 return PJ_ENOTSUP;
484 }
485
486
487 /* Get last signal level transmitted to or received from the specified port. */
488 PJ_DEF(pj_status_t) pjsua_conf_get_signal_level(pjsua_conf_port_id slot,
489 unsigned *tx_level,
490 unsigned *rx_level)
491 {
492 UNIMPLEMENTED(pjsua_conf_get_signal_level)
493 return PJ_ENOTSUP;
494 }
495
496 /* Create a file player, and automatically connect this player to
497 * the conference bridge.
498 */
499 PJ_DEF(pj_status_t) pjsua_player_create( const pj_str_t *filename,
500 unsigned options,
501 pjsua_player_id *p_id)
502 {
503 UNIMPLEMENTED(pjsua_player_create)
504 return PJ_ENOTSUP;
505 }
506
507 /* Create a file playlist media port, and automatically add the port
508 * to the conference bridge.
509 */
510 PJ_DEF(pj_status_t) pjsua_playlist_create( const pj_str_t file_names[],
511 unsigned file_count,
512 const pj_str_t *label,
513 unsigned options,
514 pjsua_player_id *p_id)
515 {
516 UNIMPLEMENTED(pjsua_playlist_create)
517 return PJ_ENOTSUP;
518 }
519
520 /* Get conference port ID associated with player. */
521 PJ_DEF(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id)
522 {
523 UNIMPLEMENTED(pjsua_player_get_conf_port)
524 return -1;
525 }
526
527 /* Get the media port for the player. */
528 PJ_DEF(pj_status_t) pjsua_player_get_port( pjsua_player_id id,
529 pjmedia_port **p_port)
530 {
531 UNIMPLEMENTED(pjsua_player_get_port)
532 return PJ_ENOTSUP;
533 }
534
535 /* Get number of bits per sample of the WAV payload */
536 PJ_DEF(pj_status_t) pjsua_player_get_info(pjsua_player_id id,
537 pjmedia_wav_player_info *info)
538 {
539 UNIMPLEMENTED(pjsua_player_get_info)
540 return PJ_ENOTSUP;
541 }
542
543 /* Get position in samples */
544 PJ_DEF(pj_ssize_t) pjsua_player_get_pos(pjsua_player_id id)
545 {
546 UNIMPLEMENTED(pjsua_player_get_pos)
547 return -PJ_ENOTSUP;
548 }
549
550 /* Set playback position. */
551 PJ_DEF(pj_status_t) pjsua_player_set_pos( pjsua_player_id id,
552 pj_uint32_t samples)
553 {
554 UNIMPLEMENTED(pjsua_player_set_pos)
555 return PJ_ENOTSUP;
556 }
557
558 /* Close the file, remove the player from the bridge, and free
559 * resources associated with the file player.
560 */
561 PJ_DEF(pj_status_t) pjsua_player_destroy(pjsua_player_id id)
562 {
563 UNIMPLEMENTED(pjsua_player_destroy)
564 return PJ_ENOTSUP;
565 }
566
567 /* Create a file recorder, and automatically connect this recorder to
568 * the conference bridge.
569 */
570 PJ_DEF(pj_status_t) pjsua_recorder_create( const pj_str_t *filename,
571 unsigned enc_type,
572 void *enc_param,
573 pj_ssize_t max_size,
574 unsigned options,
575 pjsua_recorder_id *p_id)
576 {
577 UNIMPLEMENTED(pjsua_recorder_create)
578 return PJ_ENOTSUP;
579 }
580
581
582 /* Get conference port associated with recorder. */
583 PJ_DEF(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id)
584 {
585 UNIMPLEMENTED(pjsua_recorder_get_conf_port)
586 return -1;
587 }
588
589 /* Get the media port for the recorder. */
590 PJ_DEF(pj_status_t) pjsua_recorder_get_port( pjsua_recorder_id id,
591 pjmedia_port **p_port)
592 {
593 UNIMPLEMENTED(pjsua_recorder_get_port)
594 return PJ_ENOTSUP;
595 }
596
597 /* Destroy recorder (this will complete recording). */
598 PJ_DEF(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id)
599 {
600 UNIMPLEMENTED(pjsua_recorder_destroy)
601 return PJ_ENOTSUP;
602 }
603
604 /* Enum sound devices. */
605 PJ_DEF(pj_status_t) pjsua_enum_aud_devs( pjmedia_aud_dev_info info[],
606 unsigned *count)
607 {
608 UNIMPLEMENTED(pjsua_enum_aud_devs)
609 return PJ_ENOTSUP;
610 }
611
612 PJ_DEF(pj_status_t) pjsua_enum_snd_devs( pjmedia_snd_dev_info info[],
613 unsigned *count)
614 {
615 UNIMPLEMENTED(pjsua_enum_snd_devs)
616 return PJ_ENOTSUP;
617 }
618
619 /* Select or change sound device. */
620 PJ_DEF(pj_status_t) pjsua_set_snd_dev( int capture_dev, int playback_dev)
621 {
622 UNIMPLEMENTED(pjsua_set_snd_dev)
623 return PJ_SUCCESS;
624 }
625
626 /* Get currently active sound devices. */
627 PJ_DEF(pj_status_t) pjsua_get_snd_dev(int *capture_dev, int *playback_dev)
628 {
629 *capture_dev = *playback_dev = PJSUA_INVALID_ID;
630 UNIMPLEMENTED(pjsua_get_snd_dev)
631 return PJ_ENOTSUP;
632 }
633
634 /* Get sound dev parameters such as playback & capture device IDs and mode. */
635 PJ_DEF(pj_status_t) pjsua_get_snd_dev2(pjsua_snd_dev_param *snd_param)
636 {
637 UNIMPLEMENTED(pjsua_get_snd_dev2)
638 return PJ_ENOTSUP;
639 }
640
641 /*
642 * Select or change sound device. Application may call this function at
643 * any time to replace current sound device.
644 */
645 PJ_DEF(pj_status_t) pjsua_set_snd_dev2(const pjsua_snd_dev_param *snd_param)
646 {
647 UNIMPLEMENTED(pjsua_set_snd_dev2)
648 return PJ_SUCCESS;
649 }
650
651 /* Use null sound device. Alt media backend has no real sound device,
652 * so this is a no-op that always succeeds. */
653 PJ_DEF(pj_status_t) pjsua_set_null_snd_dev(void)
654 {
655 return PJ_SUCCESS;
656 }
657
658 /* Use no device! */
659 PJ_DEF(pjmedia_port*) pjsua_set_no_snd_dev(void)
660 {
661 UNIMPLEMENTED(pjsua_set_no_snd_dev)
662 return NULL;
663 }
664
665 /* Configure the AEC settings of the sound port. */
666 PJ_DEF(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options)
667 {
668 UNIMPLEMENTED(pjsua_set_ec)
669 return PJ_ENOTSUP;
670 }
671
672 /* Get current AEC tail length. */
673 PJ_DEF(pj_status_t) pjsua_get_ec_tail(unsigned *p_tail_ms)
674 {
675 UNIMPLEMENTED(pjsua_get_ec_tail)
676 return PJ_ENOTSUP;
677 }
678
679 /* Check whether the sound device is currently active. */
680 PJ_DEF(pj_bool_t) pjsua_snd_is_active(void)
681 {
682 UNIMPLEMENTED(pjsua_snd_is_active)
683 return PJ_FALSE;
684 }
685
686 /* Configure sound device setting to the sound device being used. */
687 PJ_DEF(pj_status_t) pjsua_snd_set_setting( pjmedia_aud_dev_cap cap,
688 const void *pval, pj_bool_t keep)
689 {
690 UNIMPLEMENTED(pjsua_snd_set_setting)
691 return PJ_ENOTSUP;
692 }
693
694 /* Retrieve a sound device setting. */
695 PJ_DEF(pj_status_t) pjsua_snd_get_setting(pjmedia_aud_dev_cap cap, void *pval)
696 {
697 UNIMPLEMENTED(pjsua_snd_get_setting)
698 return PJ_ENOTSUP;
699 }
700
701 /* Create an extra sound device and register it to conference bridge. */
702 PJ_DEF(pj_status_t) pjsua_ext_snd_dev_create( pjmedia_snd_port_param *param,
703 pjsua_ext_snd_dev **p_snd)
704 {
705 UNIMPLEMENTED(pjsua_ext_snd_dev_create)
706 return PJ_ENOTSUP;
707 }
708
709 /* Destroy an extra sound device and unregister it from conference bridge. */
710 PJ_DEF(pj_status_t) pjsua_ext_snd_dev_destroy(pjsua_ext_snd_dev *snd)
711 {
712 UNIMPLEMENTED(pjsua_ext_snd_dev_destroy)
713 return PJ_ENOTSUP;
714 }
715
716 /* Get sound port instance of an extra sound device. */
717 PJ_DEF(pjmedia_snd_port*) pjsua_ext_snd_dev_get_snd_port(
718 pjsua_ext_snd_dev *snd)
719 {
720 UNIMPLEMENTED(pjsua_ext_snd_dev_get_snd_port)
721 return NULL;
722 }
723
724 /* Get conference port ID of an extra sound device. */
725 PJ_DEF(pjsua_conf_port_id) pjsua_ext_snd_dev_get_conf_port(
726 pjsua_ext_snd_dev *snd)
727 {
728 UNIMPLEMENTED(pjsua_ext_snd_dev_get_conf_port)
729 return PJSUA_INVALID_ID;
730 }