- Timestamp:
- Nov 24, 2009 12:24:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp
r2833 r3025 246 246 TInt GetMaxGain() { TInt gain;iVoIPUplink->GetMaxGain(gain);return gain; } 247 247 248 TBool IsStarted(); 249 248 250 private: 249 251 CPjAudioEngine(struct vas_stream *parent_strm, … … 261 263 262 264 // From MVoIPDownlinkObserver 263 v irtual void FillBuffer(const CVoIPAudioDownlinkStream& aSrc,265 void FillBuffer(const CVoIPAudioDownlinkStream& aSrc, 264 266 CVoIPDataBuffer* aBuffer); 265 v irtual void Event(const CVoIPAudioDownlinkStream& aSrc,267 void Event(const CVoIPAudioDownlinkStream& aSrc, 266 268 TInt aEventType, 267 269 TInt aError); 268 270 269 271 // From MVoIPUplinkObserver 270 v irtual void EmptyBuffer(const CVoIPAudioUplinkStream& aSrc,272 void EmptyBuffer(const CVoIPAudioUplinkStream& aSrc, 271 273 CVoIPDataBuffer* aBuffer); 272 v irtual void Event(const CVoIPAudioUplinkStream& aSrc,274 void Event(const CVoIPAudioUplinkStream& aSrc, 273 275 TInt aEventType, 274 276 TInt aError); 275 277 276 278 // From MVoIPFormatObserver 277 v irtual void Event(const CVoIPFormatIntfc& aSrc, TInt aEventType);279 void Event(const CVoIPFormatIntfc& aSrc, TInt aEventType); 278 280 279 281 State dn_state_; … … 370 372 } 371 373 374 TBool CPjAudioEngine::IsStarted() 375 { 376 return ((((parentStrm_->param.dir & PJMEDIA_DIR_CAPTURE) == 0) || 377 up_state_ == STATE_STREAMING) && 378 (((parentStrm_->param.dir & PJMEDIA_DIR_PLAYBACK) == 0) || 379 dn_state_ == STATE_STREAMING)); 380 } 381 372 382 TInt CPjAudioEngine::InitPlay() 373 383 { … … 669 679 // Callback from MVoIPFormatObserver 670 680 void CPjAudioEngine::Event(const CVoIPFormatIntfc& /*aSrc*/, 671 TInt /*aEventType*/) 672 { 681 TInt aEventType) 682 { 683 snd_perror("Format event", aEventType); 673 684 } 674 685 … … 1310 1321 { 1311 1322 struct vas_factory *af = (struct vas_factory*)f; 1312 CVoIPUtilityFactory *vas_factory ;1323 CVoIPUtilityFactory *vas_factory_; 1313 1324 CVoIPAudioUplinkStream *vas_uplink; 1314 1325 CVoIPAudioDownlinkStream *vas_dnlink; … … 1333 1344 1334 1345 /* Enumerate supported formats */ 1335 err = CVoIPUtilityFactory::CreateFactory(vas_factory );1346 err = CVoIPUtilityFactory::CreateFactory(vas_factory_); 1336 1347 if (err != KErrNone) 1337 1348 goto on_error; … … 1340 1351 * querying formats. 1341 1352 */ 1342 err = vas_factory ->CreateUplinkStream(vas_version,1353 err = vas_factory_->CreateUplinkStream(vas_version, 1343 1354 CVoIPUtilityFactory::EVoIPCall, 1344 1355 vas_uplink); … … 1346 1357 goto on_error; 1347 1358 1348 err = vas_factory ->CreateDownlinkStream(vas_version,1359 err = vas_factory_->CreateDownlinkStream(vas_version, 1349 1360 CVoIPUtilityFactory::EVoIPCall, 1350 1361 vas_dnlink); … … 1353 1364 1354 1365 uplink_formats.Reset(); 1355 err = vas_factory ->GetSupportedUplinkFormats(uplink_formats);1366 err = vas_factory_->GetSupportedUplinkFormats(uplink_formats); 1356 1367 if (err != KErrNone) 1357 1368 goto on_error; 1358 1369 1359 1370 dnlink_formats.Reset(); 1360 err = vas_factory ->GetSupportedDownlinkFormats(dnlink_formats);1371 err = vas_factory_->GetSupportedDownlinkFormats(dnlink_formats); 1361 1372 if (err != KErrNone) 1362 1373 goto on_error; … … 1367 1378 delete vas_dnlink; 1368 1379 vas_dnlink = NULL; 1380 delete vas_factory_; 1381 vas_factory_ = NULL; 1369 1382 1370 1383 for (TInt i = 0; i < dnlink_formats.Count(); i++) { … … 1884 1897 1885 1898 if (stream->engine) { 1899 enum { VAS_WAIT_START = 2000 }; /* in msecs */ 1900 TTime start, now; 1886 1901 TInt err = stream->engine->Start(); 1902 1887 1903 if (err != KErrNone) 1888 1904 return PJ_RETURN_OS_ERROR(err); 1889 } 1890 1891 return PJ_SUCCESS; 1905 1906 /* Perform synchronous start, timeout after VAS_WAIT_START ms */ 1907 start.UniversalTime(); 1908 do { 1909 pj_symbianos_poll(-1, 100); 1910 now.UniversalTime(); 1911 } while (!stream->engine->IsStarted() && 1912 (now.MicroSecondsFrom(start) < VAS_WAIT_START * 1000)); 1913 1914 if (stream->engine->IsStarted()) 1915 return PJ_SUCCESS; 1916 else 1917 return PJ_ETIMEDOUT; 1918 } 1919 1920 return PJ_EINVALIDOP; 1892 1921 } 1893 1922
Note: See TracChangeset
for help on using the changeset viewer.