- Timestamp:
- Dec 27, 2011 12:50:17 PM (13 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src/vidgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp
r3923 r3926 43 43 #define SIP_USERNAME "vidgui" 44 44 #define SIP_PASSWORD "secret" 45 #define SIP_PORT 508 445 #define SIP_PORT 5080 46 46 #define SIP_TCP 1 47 47 … … 109 109 /* Right pane */ 110 110 vbox_right->addWidget((localUri_ = new QLabel)); 111 vbox_right->addWidget((vidEnabled_ = new QCheckBox(tr("Enable &video")))); 111 112 vbox_right->addWidget((previewButton_=new QPushButton(tr("Start &Preview")))); 112 113 vbox_right->addWidget((callButton_=new QPushButton(tr("Call")))); 113 114 vbox_right->addWidget((hangupButton_=new QPushButton(tr("Hangup")))); 114 115 vbox_right->addWidget((quitButton_=new QPushButton(tr("Quit")))); 116 117 #if PJMEDIA_HAS_VIDEO 118 vidEnabled_->setCheckState(Qt::Checked); 119 #else 120 vidEnabled_->setCheckState(Qt::Unchecked); 121 vidEnabled_->setEnabled(false); 122 #endif 115 123 116 124 /* Outest layout */ … … 126 134 connect(quitButton_, SIGNAL(clicked()), this, SLOT(quit())); 127 135 //connect(this, SIGNAL(close()), this, SLOT(quit())); 136 connect(vidEnabled_, SIGNAL(stateChanged(int)), this, SLOT(onVidEnabledChanged(int))); 128 137 129 138 // UI updates must be done in the UI thread! … … 173 182 } 174 183 184 void MainWin::onVidEnabledChanged(int state) 185 { 186 pjsua_call_setting call_setting; 187 188 if (currentCall_ == -1) 189 return; 190 191 pjsua_call_setting_default(&call_setting); 192 call_setting.vid_cnt = (state == Qt::Checked); 193 194 pjsua_call_reinvite2(currentCall_, &call_setting, NULL); 195 } 196 175 197 void MainWin::onNewCall(int cid, bool incoming) 176 198 { … … 257 279 { 258 280 if (callButton_->text() == "Answer") { 281 pjsua_call_setting call_setting; 282 259 283 pj_assert(currentCall_ != -1); 260 pjsua_call_answer(currentCall_, 200, NULL, NULL); 284 285 pjsua_call_setting_default(&call_setting); 286 call_setting.vid_cnt = (vidEnabled_->checkState()==Qt::Checked); 287 288 pjsua_call_answer2(currentCall_, &call_setting, 200, NULL, NULL); 261 289 callButton_->setEnabled(false); 262 290 } else { … … 264 292 QString dst = url_->text(); 265 293 char uri[256]; 294 pjsua_call_setting call_setting; 266 295 267 296 pj_ansi_strncpy(uri, dst.toAscii().data(), sizeof(uri)); … … 270 299 pj_assert(currentCall_ == -1); 271 300 272 status = pjsua_call_make_call(accountId_, &uri2, 0, 301 pjsua_call_setting_default(&call_setting); 302 call_setting.vid_cnt = (vidEnabled_->checkState()==Qt::Checked); 303 304 status = pjsua_call_make_call(accountId_, &uri2, &call_setting, 273 305 NULL, NULL, ¤tCall_); 274 306 if (status != PJ_SUCCESS) { -
pjproject/trunk/pjsip-apps/src/vidgui/vidgui.h
r3726 r3926 21 21 22 22 #include <QApplication> 23 #include <QCheckBox> 23 24 #include <QFont> 24 25 #include <QLabel> … … 66 67 void hangup(); 67 68 void quit(); 69 void onVidEnabledChanged(int state); 68 70 69 71 void onNewCall(int cid, bool incoming); … … 83 85 *quitButton_, 84 86 *previewButton_; 87 QCheckBox *vidEnabled_; 85 88 QLineEdit *url_; 86 89 VidWin *video_;
Note: See TracChangeset
for help on using the changeset viewer.