Ignore:
Timestamp:
Aug 25, 2011 11:59:39 AM (13 years ago)
Author:
bennylp
Message:

Re #1351: option to initially hide video preview window to avoid floating window. Also added pjsua_vid_preview_param_default()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp

    r3721 r3724  
    2929 
    3030#define LOG_FILE                "vidgui.log" 
     31#define THIS_FILE               "vidgui.cpp" 
    3132 
    3233// These configure SIP registration 
     
    8485    /* Right pane */ 
    8586    vbox_right->addWidget((localUri_ = new QLabel)); 
    86     vbox_right->addWidget((previewButton_=new QPushButton(tr("Start Preview")))); 
     87    vbox_right->addWidget((previewButton_=new QPushButton(tr("Start &Preview")))); 
    8788    vbox_right->addWidget((callButton_=new QPushButton(tr("Call")))); 
    8889    vbox_right->addWidget((hangupButton_=new QPushButton(tr("Hangup")))); 
     
    121122    //statusBar_->showMessage(msg); 
    122123    statusBar_->setText(msg); 
    123     PJ_LOG(3,("vidgui.cpp", "%s", msg)); 
     124    PJ_LOG(3,(THIS_FILE, "%s", msg)); 
    124125} 
    125126 
     
    177178        pjsua_vid_preview_stop(DEFAULT_CAP_DEV); 
    178179 
    179         previewButton_->setText(tr("Start Preview")); 
     180        showStatus("Preview stopped"); 
     181        previewButton_->setText(tr("Start &Preview")); 
    180182    } else { 
    181183        pjsua_vid_win_id wid; 
     
    184186        pj_status_t status; 
    185187 
    186         pj_bzero(&pre_param, sizeof(pre_param)); 
     188        pjsua_vid_preview_param_default(&pre_param); 
    187189        pre_param.rend_id = DEFAULT_REND_DEV; 
     190        pre_param.show = PJ_FALSE; 
    188191 
    189192        status = pjsua_vid_preview_start(DEFAULT_CAP_DEV, &pre_param); 
     
    199202        video_prev_ = new VidWin(&wi.hwnd); 
    200203        vbox_left->addWidget(video_prev_, 1); 
    201  
    202         previewButton_->setText(tr("Stop Preview")); 
     204        //Using this will cause SDL window to display blank 
     205        //screen sometimes, probably because it's using different 
     206        //X11 Display 
     207        //status = pjsua_vid_win_set_show(wid, PJ_TRUE); 
     208        video_prev_->show(); 
     209        showStatus("Preview started"); 
     210 
     211        previewButton_->setText(tr("Stop &Preview")); 
    203212    } 
    204213    preview_on = !preview_on; 
Note: See TracChangeset for help on using the changeset viewer.