- Timestamp:
- Sep 9, 2011 9:51:10 AM (13 years ago)
- Location:
- pjproject/branches/1.x/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjmedia/include/pjmedia-audiodev/config.h
r3553 r3748 146 146 147 147 /** 148 * This setting controls whether the Symbian audio with built-in multimedia 149 * framework backend should be started synchronously. Note that synchronous 150 * start will block the application/UI, e.g: about 40ms for each direction 151 * on N95. While asynchronous start may cause invalid value (always zero) 152 * returned in input/output volume query, if the query is performed when 153 * the internal start procedure is not completely finished. 154 * 155 * Default: 1 (yes) 156 */ 157 #ifndef PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START 158 # define PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START 1 159 #endif 160 161 162 /** 148 163 * This setting controls whether the Audio Device API should support 149 164 * device implementation that is based on the old sound device API -
pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp
r3744 r3748 240 240 TInt lastError_; 241 241 pj_uint32_t timeStamp_; 242 CActiveSchedulerWait startAsw_; 242 243 243 244 // cache variable … … 364 365 iInputStream_->Open(&iStreamSettings); 365 366 367 #if defined(PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START) && \ 368 PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START != 0 369 370 startAsw_.Start(); 371 372 #endif 373 366 374 // Success 367 375 PJ_LOG(4,(THIS_FILE, "Sound capture started.")); … … 387 395 } 388 396 397 if (startAsw_.IsStarted()) { 398 startAsw_.AsyncStop(); 399 } 400 389 401 state_ = STATE_INACTIVE; 390 402 } … … 400 412 void CPjAudioInputEngine::MaiscOpenComplete(TInt aError) 401 413 { 414 if (startAsw_.IsStarted()) { 415 startAsw_.AsyncStop(); 416 } 417 402 418 lastError_ = aError; 403 419 if (aError != KErrNone) { … … 406 422 } 407 423 408 /* Apply output volume setting if specified */424 /* Apply input volume setting if specified */ 409 425 if (parentStrm_->param.flags & 410 426 PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING) … … 424 440 if (err2) { 425 441 PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); 426 } 442 lastError_ = err2; 443 return; 444 } 445 446 // input stream opened succesfully, set status to Active 447 state_ = STATE_ACTIVE; 427 448 } 428 449 … … 557 578 TInt lastError_; 558 579 unsigned timestamp_; 580 CActiveSchedulerWait startAsw_; 559 581 560 582 CPjAudioOutputEngine(struct mda_stream *parent_strm, … … 648 670 lastError_ = KRequestPending; 649 671 iOutputStream_->Open(&iStreamSettings); 672 673 #if defined(PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START) && \ 674 PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START != 0 675 676 startAsw_.Start(); 677 678 #endif 650 679 651 680 // Success … … 672 701 } 673 702 703 if (startAsw_.IsStarted()) { 704 startAsw_.AsyncStop(); 705 } 706 674 707 state_ = STATE_INACTIVE; 675 708 } … … 677 710 void CPjAudioOutputEngine::MaoscOpenComplete(TInt aError) 678 711 { 712 if (startAsw_.IsStarted()) { 713 startAsw_.AsyncStop(); 714 } 715 679 716 lastError_ = aError; 680 717 681 718 if (aError==KErrNone) { 682 // output stream opened succesfully, set status to Active683 state_ = STATE_ACTIVE;684 685 719 // set stream properties, 16bit 8KHz mono 686 720 TMdaAudioDataSettings iSettings; … … 737 771 frame_.Set(frameBuf_, frameBufSize_); 738 772 iOutputStream_->WriteL(frame_); 773 774 // output stream opened succesfully, set status to Active 775 state_ = STATE_ACTIVE; 739 776 } else { 740 777 snd_perror("Error in MaoscOpenComplete()", aError); … … 900 937 param->samples_per_frame = af->dev_info.default_samples_per_sec * 20 / 1000; 901 938 param->bits_per_sample = BITS_PER_SAMPLE; 902 param->flags = af->dev_info.caps; 939 // Don't set the flags without specifying the flags value. 940 //param->flags = af->dev_info.caps; 903 941 904 942 return PJ_SUCCESS; … … 974 1012 975 1013 pj_memcpy(pi, &strm->param, sizeof(*pi)); 1014 1015 /* Update the output volume setting */ 1016 if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, 1017 &pi->output_vol) == PJ_SUCCESS) 1018 { 1019 pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; 1020 } 1021 1022 /* Update the input volume setting */ 1023 if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING, 1024 &pi->input_vol) == PJ_SUCCESS) 1025 { 1026 pi->flags |= PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING; 1027 } 976 1028 977 1029 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.