Changeset 2379
- Timestamp:
- Dec 17, 2008 11:36:22 AM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ioqueue_symbian.cpp
r2039 r2379 526 526 527 527 // Cancel pending async object 528 if (key->cbObj && key->cbObj->IsActive()) {528 if (key->cbObj) { 529 529 key->cbObj->Cancel(); 530 530 } -
pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp
r2039 r2379 90 90 CPjTimeoutTimer::~CPjTimeoutTimer() 91 91 { 92 if (IsActive()) 93 Cancel(); 92 Cancel(); 94 93 timer_.Close(); 95 94 } … … 116 115 void CPjTimeoutTimer::StartTimer(TUint miliSeconds) 117 116 { 118 if (IsActive()) 119 Cancel(); 117 Cancel(); 120 118 121 119 hasTimedOut_ = PJ_FALSE; … … 330 328 err = os->Initialize(); 331 329 if (err != KErrNone) 332 return status;330 return PJ_RETURN_OS_ERROR(err); 333 331 334 332 /* Initialize exception ID for the pool. … … 453 451 454 452 if (priority==-1) 455 priority = CActive::EPriorityStandard;453 priority = EPriorityNull; 456 454 457 455 if (ms_timeout >= 0) { … … 464 462 bool timer_is_active = timer->IsActive(); 465 463 466 if (timer_is_active) 467 timer->Cancel(); 464 timer->Cancel(); 468 465 469 466 delete timer; … … 623 620 { 624 621 User::After(msec*1000); 625 626 TInt aError; 627 while (CActiveScheduler::RunIfReady(aError, EPriorityMuchLess)) 628 ; 629 622 630 623 return PJ_SUCCESS; 631 624 } -
pjproject/trunk/pjlib/src/pj/os_symbian.h
r2039 r2379 348 348 { 349 349 TInt aError; 350 User::WaitForAnyRequest();350 CActiveScheduler::Current()->WaitForAnyRequest(); 351 351 CActiveScheduler::RunIfReady(aError, aPriority); 352 352 } -
pjproject/trunk/pjlib/src/pj/sock_symbian.cpp
r2327 r2379 102 102 { 103 103 if (sockReader_) { 104 if (sockReader_->IsActive()) 105 sockReader_->Cancel(); 104 sockReader_->Cancel(); 106 105 delete sockReader_; 107 106 sockReader_ = NULL; -
pjproject/trunk/pjlib/src/pj/timer_symbian.cpp
r2039 r2379 79 79 CPjTimerEntry::~CPjTimerEntry() 80 80 { 81 if (IsActive()) 82 Cancel(); 81 Cancel(); 83 82 rtimer_.Close(); 84 83 } -
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r2198 r2379 372 372 { 373 373 pjmedia_snd_port *snd_port; 374 pj_status_t status;375 unsigned ptime;376 374 377 375 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); … … 390 388 391 389 #if PJMEDIA_SOUND_USE_DELAYBUF 392 ptime = samples_per_frame * 1000 / (clock_rate * channel_count); 393 394 status = pjmedia_delay_buf_create(pool, "snd_buff", 395 clock_rate, samples_per_frame, 396 channel_count, 397 PJMEDIA_SOUND_BUFFER_COUNT * ptime, 398 0, &snd_port->delay_buf); 399 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 400 #else 401 PJ_UNUSED_ARG(status); 402 PJ_UNUSED_ARG(ptime); 390 do { 391 pj_status_t status; 392 unsigned ptime; 393 394 ptime = samples_per_frame * 1000 / (clock_rate * channel_count); 395 396 status = pjmedia_delay_buf_create(pool, "snd_buff", 397 clock_rate, samples_per_frame, 398 channel_count, 399 PJMEDIA_SOUND_BUFFER_COUNT * ptime, 400 0, &snd_port->delay_buf); 401 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 402 } while (0); 403 403 #endif 404 404 -
pjproject/trunk/pjmedia/src/pjmedia/symbian_sound.cpp
r2357 r2379 298 298 // Wait until it's actually stopped 299 299 while (lastError_ == KRequestPending) 300 pj_ thread_sleep(100);300 pj_symbianos_poll(-1, 100); 301 301 } 302 302 … … 534 534 // Wait until it's actually stopped 535 535 while (lastError_ == KRequestPending) 536 pj_ thread_sleep(100);536 pj_symbianos_poll(-1, 100); 537 537 } 538 538 -
pjproject/trunk/pjmedia/src/pjmedia/transport_adapter_sample.c
r2262 r2379 1 /* $Id :$ */1 /* $Id$ */ 2 2 /* 3 3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> … … 132 132 pj_ansi_strncpy(adapter->base.name, pool->obj_name, 133 133 sizeof(adapter->base.name)); 134 adapter->base.type = PJMEDIA_TRANSPORT_TYPE_USER + 1; 134 adapter->base.type = (pjmedia_transport_type) 135 (PJMEDIA_TRANSPORT_TYPE_USER + 1); 135 136 adapter->base.op = &tp_adapter_op; 136 137 -
pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
r2272 r2379 264 264 } 265 265 266 fport->fmt_tag = wave_hdr.fmt_hdr.fmt_tag;266 fport->fmt_tag = (pjmedia_wave_fmt_tag)wave_hdr.fmt_hdr.fmt_tag; 267 267 fport->bytes_per_sample = (pj_uint16_t) 268 268 (wave_hdr.fmt_hdr.bits_per_sample / 8); -
pjproject/trunk/pjsip-apps/src/symbian_ua/main_symbian.cpp
r2174 r2379 29 29 30 30 // Needed by APS 31 TPtrC APP_UID = _L("A000000 E");31 TPtrC APP_UID = _L("A000000D"); 32 32 33 34 ////////////////////////////////////////////////////////////////////////////35 class MyTask : public CActive36 {37 public:38 static MyTask *NewL(CActiveSchedulerWait *asw);39 ~MyTask();40 void Start();41 42 protected:43 MyTask(CActiveSchedulerWait *asw);44 void ConstructL();45 virtual void RunL();46 virtual void DoCancel();47 48 private:49 RTimer timer_;50 CActiveSchedulerWait *asw_;51 };52 53 MyTask::MyTask(CActiveSchedulerWait *asw)54 : CActive(EPriorityNormal), asw_(asw)55 {56 }57 58 MyTask::~MyTask()59 {60 timer_.Close();61 }62 63 void MyTask::ConstructL()64 {65 timer_.CreateLocal();66 CActiveScheduler::Add(this);67 }68 69 MyTask *MyTask::NewL(CActiveSchedulerWait *asw)70 {71 MyTask *self = new (ELeave) MyTask(asw);72 CleanupStack::PushL(self);73 74 self->ConstructL();75 76 CleanupStack::Pop(self);77 return self;78 }79 80 void MyTask::Start()81 {82 timer_.After(iStatus, 0);83 SetActive();84 }85 86 void MyTask::RunL()87 {88 ua_main();89 asw_->AsyncStop();90 }91 92 void MyTask::DoCancel()93 {94 95 }96 33 97 34 //////////////////////////////////////////////////////////////////////////// … … 103 40 CActiveScheduler::Install(scheduler); 104 41 105 CActiveSchedulerWait *asw = new CActiveSchedulerWait; 106 CleanupStack::PushL(asw); 107 108 MyTask *task = MyTask::NewL(asw); 109 task->Start(); 110 111 asw->Start(); 112 113 delete task; 114 115 CleanupStack::Pop(asw); 116 delete asw; 42 ua_main(); 117 43 118 44 CActiveScheduler::Install(NULL); -
pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
r2174 r2379 38 38 // Account 39 39 // 40 #define HAS_SIP_ACCOUNT 1 // 0 to disable registration40 #define HAS_SIP_ACCOUNT 0 // 1 to enable registration 41 41 #define SIP_DOMAIN "pjsip.lab" 42 42 #define SIP_USER "400" … … 54 54 // or STUN (for STUN see other settings below) 55 55 // 56 //#define NAMESERVER NULL57 #define NAMESERVER "192.168.0.2"56 #define NAMESERVER NULL 57 //#define NAMESERVER "192.168.0.2" 58 58 59 59 // … … 250 250 251 251 252 //#include<e32debug.h> 253 252 254 /* Logging callback */ 253 255 static void log_writer(int level, const char *buf, int len) … … 260 262 261 263 TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); 264 //RDebug::Print(aBuf); 262 265 console->Write(aBuf); 263 266 … … 436 439 { 437 440 public: 438 ConsoleUI(C ActiveSchedulerWait *asw, CConsoleBase *con);441 ConsoleUI(CConsoleBase *con); 439 442 440 443 // Run console UI … … 452 455 453 456 private: 454 CActiveSchedulerWait *asw_;455 457 CConsoleBase *con_; 456 458 }; 457 459 458 460 459 ConsoleUI::ConsoleUI(C ActiveSchedulerWait *asw, CConsoleBase *con)460 : CActive(EPriorityStandard), asw_(asw),con_(con)461 ConsoleUI::ConsoleUI(CConsoleBase *con) 462 : CActive(EPriorityStandard), con_(con) 461 463 { 462 464 CActiveScheduler::Add(this); … … 509 511 switch (kc) { 510 512 case 'w': 511 asw_->AsyncStop();513 CActiveScheduler::Stop(); 512 514 reschedule = PJ_FALSE; 513 515 break; … … 686 688 #include <es_sock.h> 687 689 690 #if 0 691 // Force network connection to use the first IAP, 692 // this is useful for debugging on emulator without GUI. 693 // Include commdb.lib & apengine.lib in symbian_ua.mmp file 694 // if this is enabled. 695 696 #include <apdatahandler.h> 697 698 inline void ForceUseFirstIAP() 699 { 700 TUint32 rank = 1; 701 TUint32 bearers; 702 TUint32 prompt; 703 TUint32 iap; 704 705 CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP); 706 CleanupStack::PushL(commDb); 707 708 CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb); 709 710 TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing; 711 apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers, prompt, iap); 712 prompt = ECommDbDialogPrefDoNotPrompt; 713 apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers, (TCommDbDialogPref)prompt, iap, ETrue); 714 CleanupStack::PopAndDestroy(2); // apDataHandler, commDb 715 } 716 717 static void SelectIAP() 718 { 719 ForceUseFirstIAP(); 720 } 721 722 #else 723 724 static void SelectIAP() 725 { 726 } 727 728 #endif 729 730 688 731 //////////////////////////////////////////////////////////////////////////// 689 732 int ua_main() 690 733 { 691 692 693 694 734 RSocketServ aSocketServer; 735 RConnection aConn; 736 TInt err; 737 pj_symbianos_params sym_params; 695 738 pj_status_t status; 739 740 SelectIAP(); 696 741 697 742 // Initialize RSocketServ … … 701 746 // Open up a connection 702 747 if ((err=aConn.Open(aSocketServer)) != KErrNone) { 703 704 748 aSocketServer.Close(); 749 return PJ_STATUS_FROM_OS(err); 705 750 } 706 751 … … 723 768 aConn.Close(); 724 769 aSocketServer.Close(); 725 770 return status; 726 771 } 727 772 728 773 // Run the UI 729 CActiveSchedulerWait *asw = new CActiveSchedulerWait; 730 ConsoleUI *con = new ConsoleUI(asw, console); 774 ConsoleUI *con = new ConsoleUI(console); 731 775 732 776 con->Run(); 733 734 777 PrintMenu(); 735 asw->Start(); 778 779 CActiveScheduler::Start(); 736 780 737 781 delete con; 738 delete asw;739 782 740 783 // Dump memory statistics 741 784 PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB", 742 743 785 pjsua_var.cp.peak_used_size / 1000000, 786 (pjsua_var.cp.peak_used_size % 1000000)/1000)); 744 787 745 788 // check max stack usage … … 747 790 pj_thread_t* this_thread = pj_thread_this(); 748 791 if (!this_thread) 749 792 return status; 750 793 751 794 const char* max_stack_file; … … 754 797 755 798 PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d", 756 757 799 pj_thread_get_stack_max_usage(this_thread), 800 max_stack_file, max_stack_line)); 758 801 #endif 759 802 … … 763 806 // Close connection and socket server 764 807 aConn.Close(); 765 808 aSocketServer.Close(); 766 809 767 810 return status; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r2315 r2379 828 828 static void busy_sleep(unsigned msec) 829 829 { 830 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0831 /* Ideally we shouldn't call pj_thread_sleep() and rather832 * CActiveScheduler::WaitForAnyRequest() here, but that will833 * drag in Symbian header and it doesn't look pretty.834 */835 pj_thread_sleep(msec);836 #else837 830 pj_time_val timeout, now; 838 831 … … 846 839 pj_gettimeofday(&now); 847 840 } while (PJ_TIME_VAL_LT(now, timeout)); 848 #endif849 841 } 850 842 … … 1204 1196 { 1205 1197 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 1206 /* Ideally we shouldn't call pj_thread_sleep() and rather 1207 * CActiveScheduler::WaitForAnyRequest() here, but that will 1208 * drag in Symbian header and it doesn't look pretty. 1209 */ 1210 pj_thread_sleep(msec_timeout); 1211 return msec_timeout; 1198 1199 return pj_symbianos_poll(-1, msec_timeout); 1200 1212 1201 #else 1213 1202 … … 1226 1215 1227 1216 return count; 1217 1228 1218 #endif 1229 1219 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r2273 r2379 777 777 uapres->expires = -1; 778 778 779 st_code = 200;779 st_code = (pjsip_status_code)200; 780 780 reason = pj_str("OK"); 781 781 pjsua_msg_data_init(&msg_data);
Note: See TracChangeset
for help on using the changeset viewer.