Changeset 3726 for pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp
- Timestamp:
- Aug 26, 2011 4:30:18 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp
r3724 r3726 51 51 52 52 initLayout(); 53 onCallReleased();53 emit signalCallReleased(); 54 54 } 55 55 … … 102 102 connect(quitButton_, SIGNAL(clicked()), this, SLOT(quit())); 103 103 //connect(this, SIGNAL(close()), this, SLOT(quit())); 104 105 // UI updates must be done in the UI thread! 106 connect(this, SIGNAL(signalNewCall(int, bool)), 107 this, SLOT(onNewCall(int, bool))); 108 connect(this, SIGNAL(signalCallReleased()), 109 this, SLOT(onCallReleased())); 110 connect(this, SIGNAL(signalInitVideoWindow()), 111 this, SLOT(initVideoWindow())); 112 connect(this, SIGNAL(signalShowStatus(const QString&)), 113 this, SLOT(doShowStatus(const QString&))); 104 114 } 105 115 106 116 void MainWin::quit() 107 117 { 108 //if (preview_on)109 //preview();110 111 118 delete video_prev_; 112 119 video_prev_ = NULL; … … 120 127 void MainWin::showStatus(const char *msg) 121 128 { 129 PJ_LOG(3,(THIS_FILE, "%s", msg)); 130 131 QString msg_ = QString::fromUtf8(msg); 132 emit signalShowStatus(msg_); 133 } 134 135 void MainWin::doShowStatus(const QString& msg) 136 { 122 137 //statusBar_->showMessage(msg); 123 138 statusBar_->setText(msg); 124 PJ_LOG(3,(THIS_FILE, "%s", msg));125 139 } 126 140 … … 135 149 } 136 150 137 void MainWin::onNewCall( pjsua_call_idcid, bool incoming)151 void MainWin::onNewCall(int cid, bool incoming) 138 152 { 139 153 pjsua_call_info ci; … … 206 220 //X11 Display 207 221 //status = pjsua_vid_win_set_show(wid, PJ_TRUE); 208 video_prev_->show(); 222 //This is handled by VidWin now 223 //video_prev_->show(); 209 224 showStatus("Preview started"); 210 225 … … 224 239 pj_status_t status; 225 240 QString dst = url_->text(); 226 const char *uri = dst.toAscii().data(); 241 char uri[256]; 242 243 pj_ansi_strncpy(uri, dst.toAscii().data(), sizeof(uri)); 227 244 pj_str_t uri2 = pj_str((char*)uri); 228 245 … … 243 260 //pjsua_call_hangup(currentCall_, PJSIP_SC_BUSY_HERE, NULL, NULL); 244 261 pjsua_call_hangup_all(); 245 onCallReleased();246 } 247 248 249 void MainWin::init _video_window()262 emit signalCallReleased(); 263 } 264 265 266 void MainWin::initVideoWindow() 250 267 { 251 268 pjsua_call_info ci; … … 311 328 312 329 if (currentCall_ == -1 && ci.state < PJSIP_INV_STATE_DISCONNECTED) { 313 onNewCall(call_id, false);330 emit signalNewCall(call_id, false); 314 331 } 315 332 … … 320 337 ci.last_status_text.ptr); 321 338 showStatus(status); 322 onCallReleased();339 emit signalCallReleased(); 323 340 } else { 324 341 snprintf(status, sizeof(status), "Call is %s", pjsip_inv_state_name(ci.state)); … … 338 355 } 339 356 340 onNewCall(call_id, true);357 emit signalNewCall(call_id, true); 341 358 342 359 pjsua_call_info ci; … … 366 383 } 367 384 } else if (ci.media[i].type == PJMEDIA_TYPE_VIDEO) { 368 init_video_window();385 emit signalInitVideoWindow(); 369 386 } 370 387 }
Note: See TracChangeset
for help on using the changeset viewer.