void Camera::init(){ getSupportedResolutions(); #ifdef MEEGO_EDITION_HARMATTAN m_lastScId = 0; m_lastEcId = 0; #endif }
bool CApplication::isValidResolution(unsigned int width, unsigned int height) { TVector2UI mode(width, height); std::vector<TVector2UI> modes; getSupportedResolutions(modes); for (std::vector<TVector2UI>::const_iterator it = modes.begin(); it != modes.end(); ++it) { if (*it == mode) { return true; } } return false; }
UIYabause::UIYabause( QWidget* parent ) : QMainWindow( parent ) { mInit = false; search.clear(); searchType = 0; // setup dialog setupUi( this ); toolBar->insertAction( aFileSettings, mFileSaveState->menuAction() ); toolBar->insertAction( aFileSettings, mFileLoadState->menuAction() ); toolBar->insertSeparator( aFileSettings ); setAttribute( Qt::WA_DeleteOnClose ); #ifdef USE_UNIFIED_TITLE_TOOLBAR setUnifiedTitleAndToolBarOnMac( true ); #endif fSound->setParent( 0, Qt::Popup ); fVideoDriver->setParent( 0, Qt::Popup ); fSound->installEventFilter( this ); fVideoDriver->installEventFilter( this ); // Get Screen res list getSupportedResolutions(); // fill combo driver cbVideoDriver->blockSignals( true ); for ( int i = 0; VIDCoreList[i] != NULL; i++ ) cbVideoDriver->addItem( VIDCoreList[i]->Name, VIDCoreList[i]->id ); cbVideoDriver->blockSignals( false ); // create glcontext mYabauseGL = new YabauseGL( this ); // and set it as central application widget setCentralWidget( mYabauseGL ); // create log widget teLog = new QTextEdit( this ); teLog->setReadOnly( true ); teLog->setWordWrapMode( QTextOption::NoWrap ); teLog->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); teLog->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); mLogDock = new QDockWidget( this ); mLogDock->setWindowTitle( "Log" ); mLogDock->setWidget( teLog ); addDockWidget( Qt::BottomDockWidgetArea, mLogDock ); mLogDock->setVisible( false ); mCanLog = true; oldMouseX = oldMouseY = 0; mouseCaptured = false; #ifndef SH2_TRACE aTraceLogging->setVisible(false); #endif // create emulator thread mYabauseThread = new YabauseThread( this ); // create hide mouse timer hideMouseTimer = new QTimer(); // create mouse cursor timer mouseCursorTimer = new QTimer(); // connections connect( mYabauseThread, SIGNAL( requestSize( const QSize& ) ), this, SLOT( sizeRequested( const QSize& ) ) ); connect( mYabauseThread, SIGNAL( requestFullscreen( bool ) ), this, SLOT( fullscreenRequested( bool ) ) ); connect( mYabauseThread, SIGNAL( requestVolumeChange( int ) ), this, SLOT( on_sVolume_valueChanged( int ) ) ); connect( aViewLog, SIGNAL( toggled( bool ) ), mLogDock, SLOT( setVisible( bool ) ) ); connect( mLogDock->toggleViewAction(), SIGNAL( toggled( bool ) ), aViewLog, SLOT( setChecked( bool ) ) ); connect( mYabauseThread, SIGNAL( error( const QString&, bool ) ), this, SLOT( errorReceived( const QString&, bool ) ) ); connect( mYabauseThread, SIGNAL( pause( bool ) ), this, SLOT( pause( bool ) ) ); connect( mYabauseThread, SIGNAL( reset() ), this, SLOT( reset() ) ); connect( hideMouseTimer, SIGNAL( timeout() ), this, SLOT( hideMouse() )); connect( mouseCursorTimer, SIGNAL( timeout() ), this, SLOT( cursorRestore() )); connect( mYabauseThread, SIGNAL( toggleEmulateMouse( bool ) ), this, SLOT( toggleEmulateMouse( bool ) ) ); // Load shortcuts VolatileSettings* vs = QtYabause::volatileSettings(); QList<QAction *> actions = findChildren<QAction *>(); foreach ( QAction* action, actions ) { if (action->text().isEmpty()) continue; QString text = vs->value(QString("Shortcuts/") + action->text(), "").toString(); if (text.isEmpty()) continue; action->setShortcut(text); } // retranslate widgets QtYabause::retranslateWidget( this ); QList<QAction *> actionList = menubar->actions(); for(int i = 0;i < actionList.size();i++) { addAction(actionList.at(i)); } restoreGeometry( vs->value("General/Geometry" ).toByteArray() ); mYabauseGL->setMouseTracking(true); setMouseTracking(true); mouseXRatio = mouseYRatio = 1.0; emulateMouse = false; mouseSensitivity = vs->value( "Input/GunMouseSensitivity", 100 ).toInt(); showMenuBarHeight = menubar->height(); translations = QtYabause::getTranslationList(); VIDSoftSetBilinear(QtYabause::settings()->value( "Video/Bilinear", false ).toBool()); }
int main(int argc, char **argv) { errStatus status = ERR_OK; char deviceAddress[50]; t_videoResolution newResolution; status = discoverDevices(deviceAddress); if(status != ERR_OK) goto exitLabel; printf("Received probe matches %s\n", deviceAddress); status = connectCamera(deviceAddress); if(status != ERR_OK) goto exitLabel; //printf("Media URL set to %s\n", mediaEP); status = getSupportedResolutions(); if(status != ERR_OK) goto exitLabel; newResolution.Encoding = tt__VideoEncoding__H264; newResolution.width = 1280; newResolution.height = 720; status = setResolution(newResolution); if(status == ERR_RESOLUTION_NOT_SUPPORTED) printf("Resolution not supported\n"); else printf("Resolution supported\n"); if(status != ERR_OK) goto exitLabel; #if 0 struct _trt__GetVideoSourceConfiguration getVideoSourceConfigurationRequest; getVideoSourceConfigurationRequest.ConfigurationToken = (char *)malloc(sizeof(videoSrcToken)); strcpy(getVideoSourceConfigurationRequest.ConfigurationToken, videoSrcToken); struct _trt__GetVideoSourceConfigurationResponse getVideoSourceConfigurationResponse; soap_call___trt__GetVideoSourceConfiguration(&soap, mediaEP, NULL, &getVideoSourceConfigurationRequest, &getVideoSourceConfigurationResponse); if(getVideoSourceConfigurationResponse.Configuration == NULL) { printf("No video src config for %s\n", videoSrcToken); status = 1; goto exit; } else { printf("Video config available\n"); } struct _trt__SetVideoSourceConfiguration setVideoSourceConfigurationRequest; getVideoSourceConfigurationResponse.Configuration->Bounds->width = 1280;//640; getVideoSourceConfigurationResponse.Configuration->Bounds->height = 720;//360; getVideoSourceConfigurationResponse.Configuration->Bounds->x = 0; getVideoSourceConfigurationResponse.Configuration->Bounds->y = 0; setVideoSourceConfigurationRequest.Configuration = getVideoSourceConfigurationResponse.Configuration; struct _trt__SetVideoSourceConfigurationResponse setVideoSourceConfigurationResponse; soap_call___trt__SetVideoSourceConfiguration(&soap, mediaEP, NULL, &setVideoSourceConfigurationRequest, &setVideoSourceConfigurationResponse); #endif exitLabel: cleanup(); return status; }
QList<QObject*> Camera::supportedResolutionObjects() { if (m_supportedResolutionObjects.isEmpty()) getSupportedResolutions(); return m_supportedResolutionObjects; }
QList<QSize> Camera::supportedResolutions() { if (m_supportedResolutions.isEmpty()) getSupportedResolutions(); return m_supportedResolutions; }