Changeset 837 for pjproject/trunk
- Timestamp:
- Nov 29, 2006 11:12:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/sndtest.c
r657 r837 131 131 132 132 133 static const char *get_dev_name(int dev_id)134 {135 const pjmedia_snd_dev_info *info;136 137 if (dev_id == -1)138 dev_id = 0;139 140 info = pjmedia_snd_get_dev_info(dev_id);141 if (info == NULL)142 return "????";143 144 return info->name;145 }146 147 148 133 static pj_status_t play_cb(void *user_data, pj_uint32_t timestamp, 149 134 void *output, unsigned size) … … 369 354 370 355 371 static int perform_test( const char *title,int dev_id, pjmedia_dir dir,356 static int perform_test(int dev_id, pjmedia_dir dir, 372 357 unsigned clock_rate, unsigned samples_per_frame, 373 358 unsigned nchannel, int verbose) … … 376 361 pjmedia_snd_stream *strm; 377 362 struct test_data test_data; 363 pjmedia_snd_stream_info si; 378 364 379 365 … … 390 376 * Open device. 391 377 */ 392 PJ_LOG(3,(THIS_FILE, "Testing %s", title));393 394 378 if (dir == PJMEDIA_DIR_CAPTURE) { 395 379 status = pjmedia_snd_open_rec( dev_id, clock_rate, nchannel, … … 409 393 app_perror("Unable to open device for capture", status); 410 394 return status; 395 } 396 397 pjmedia_snd_stream_get_info(strm, &si); 398 if (si.play_id >= 0) { 399 PJ_LOG(3,(THIS_FILE, "Testing playback device %s", 400 pjmedia_snd_get_dev_info(si.play_id)->name)); 401 } 402 if (si.rec_id >= 0) { 403 PJ_LOG(3,(THIS_FILE, "Testing capture device %s", 404 pjmedia_snd_get_dev_info(si.rec_id)->name)); 411 405 } 412 406 … … 595 589 596 590 597 status = perform_test( get_dev_name(id),id, PJMEDIA_DIR_CAPTURE_PLAYBACK,591 status = perform_test(id, PJMEDIA_DIR_CAPTURE_PLAYBACK, 598 592 clock_rate, frame, channel, verbose); 599 593 if (status != 0)
Note: See TracChangeset
for help on using the changeset viewer.