Merge branch 'master' into featurePelFormatsApi

This commit is contained in:
jfmcarreira committed 2014-10-26 12:23:12 +00:00
commit 9f525a28a6
20 files changed
+147 -80

No files matched your search

+24 -11
View File
@@ -172,6 +172,12 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
}
}
// Disable existing Module
for( UInt i = 0; i < numberOfFrames; i++ )
{
pcCurrModuleIf->m_pcSubWindow[i]->disableModule();
}
// Create Module
pcCurrModuleIf->create( pcCurrModuleIf->m_pcSubWindow[0]->getCurrFrame() );
@@ -256,7 +262,7 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerModuleIf *pcCurrModuleIf )
if( pcCurrModuleIf->m_pcModuleStream )
{
UInt numberOfWindows = pcCurrModuleIf->m_cModuleDef.m_uiNumberOfFrames;
UInt currFrames;
UInt64 currFrames = 0;
UInt64 numberOfFrames = INT_MAX;
for( UInt i = 0; i < numberOfWindows; i++ )
{
@@ -266,10 +272,10 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerModuleIf *pcCurrModuleIf )
pcCurrModuleIf->m_pcSubWindow[i]->stop();
}
QApplication::setOverrideCursor( Qt::WaitCursor );
for( UInt f = 0; f < numberOfFrames; f++ )
for( UInt f = 1; f < numberOfFrames; f++ )
{
applyModuleIf( pcCurrModuleIf, false, true );
//QCoreApplication::processEvents();
QCoreApplication::processEvents();
pcCurrModuleIf->m_pcModuleStream->writeFrame( pcCurrModuleIf->m_pcProcessedFrame );
for( UInt i = 0; i < numberOfWindows; i++ )
{
@@ -277,6 +283,10 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerModuleIf *pcCurrModuleIf )
pcCurrModuleIf->m_pcSubWindow[i]->playEvent();
}
}
for( UInt i = 0; i < numberOfWindows; i++ )
{
pcCurrModuleIf->m_pcSubWindow[i]->stop();
}
QApplication::restoreOverrideCursor();
}
}
@@ -334,14 +344,17 @@ Void ModulesHandle::openModuleIfStream( PlaYUVerModuleIf *pcCurrModuleIf )
Bool ModulesHandle::showModuleIf( PlaYUVerModuleIf *pcCurrModuleIf, PlaYUVerFrame* processedFrame )
{
Bool bRet = false;
if( pcCurrModuleIf->m_pcDisplaySubWindow )
//if( processedFrame )
{
pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( processedFrame );
bRet = true;
}
else
{
pcCurrModuleIf->m_pcSubWindow[0]->setCurrFrame( processedFrame );
if( pcCurrModuleIf->m_pcDisplaySubWindow )
{
pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( processedFrame );
bRet = true;
}
else
{
pcCurrModuleIf->m_pcSubWindow[0]->setCurrFrame( processedFrame );
}
}
return bRet;
}
@@ -349,7 +362,7 @@ Bool ModulesHandle::showModuleIf( PlaYUVerModuleIf *pcCurrModuleIf, PlaYUVerFram
Bool ModulesHandle::showModuleIf( PlaYUVerModuleIf *pcCurrModuleIf, Double moduleResult )
{
Bool bRet = false;
pcCurrModuleIf->m_pcModuleDock->setModulueReturnValue(moduleResult);
pcCurrModuleIf->m_pcModuleDock->setModulueReturnValue( moduleResult );
return bRet;
}
+1 -1
View File
@@ -65,7 +65,7 @@ Void PlaYUVerSettings::setLastOpenPath( const QString & path )
Int PlaYUVerSettings::getSelectedTool()
{
return m_settings.value( "MainWindow/SelectedTool", NavigationTool ).toInt();
return m_settings.value( "MainWindow/SelectedTool", ViewArea::NavigationTool ).toInt();
}
Void PlaYUVerSettings::setSelectedTool( Int tool )
+13 -1
View File
@@ -53,6 +53,12 @@ StreamPropertiesSideBar::StreamPropertiesSideBar( QWidget* parent ) :
// ----------------- GUI definition -----------------
QLabel *streamNameLabel = new QLabel( tr( "Name:" ) );
streamNameLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
labelNameValue = new QLabel;
labelNameValue->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
labelNameValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
QLabel *formatLabel = new QLabel( tr( "File Format:" ) );
formatLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
labelFormatValue = new QLabel;
@@ -83,6 +89,9 @@ StreamPropertiesSideBar::StreamPropertiesSideBar( QWidget* parent ) :
QGridLayout *propertiesLayout = new QGridLayout;
Int layout_line = 0;
// propertiesLayout->addWidget( streamNameLabel, layout_line, 0 );
// propertiesLayout->addWidget( labelNameValue, layout_line, 1 );
// layout_line++;
propertiesLayout->addWidget( formatLabel, layout_line, 0 );
propertiesLayout->addWidget( labelFormatValue, layout_line, 1 );
layout_line++;
@@ -126,6 +135,7 @@ QSize StreamPropertiesSideBar::sizeHint() const
Void StreamPropertiesSideBar::setData( PlaYUVerStream* pcStream )
{
// Clear information.
labelNameValue->clear();
labelFormatValue->clear();
labelCodecValue->clear();
labelDurationValueTime->clear();
@@ -143,11 +153,13 @@ Void StreamPropertiesSideBar::setData( PlaYUVerStream* pcStream )
m_pcStream = pcStream;
setEnabled( true );
QString value;
labelNameValue->setText( QFileInfo( m_pcStream->getFileName() ).fileName() );
labelFormatValue->setText( m_pcStream->getFormatName() );
labelCodecValue->setText( m_pcStream->getCodecName() );
Int duration[3];
m_pcStream->getDuration( duration );
QString value;
value = QString( tr( "%1h:%2m:%3s" ) ).arg( duration[0] ).arg( duration[1] ).arg( duration[2] );
labelDurationValueTime->setText( value );
value = QString( tr( "%1 frms" ) ).arg( m_pcStream->getFrameNum() );
+1
View File
@@ -55,6 +55,7 @@ private:
PlaYUVerStream* m_pcStream;
Bool m_bIsVisible;
QLabel* labelNameValue;
QLabel* labelFormatValue;
QLabel* labelCodecValue;
QLabel* labelDurationValueTime;
+18 -11
View File
@@ -48,13 +48,13 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, QMdiArea
RecLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
m_comboBoxMetric = new QComboBox;
m_comboBoxMetric->insertItems( 0, PlaYUVerFrame::supportedQualityMetricsList());
m_comboBoxMetric->insertItems( 0, PlaYUVerFrame::supportedQualityMetricsList() );
m_comboBoxMetric->setSizeAdjustPolicy( QComboBox::AdjustToContents );
m_comboBoxMetric->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
m_comboBoxMetric->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
m_comboBoxRef = new QComboBox;
m_comboBoxRef->setSizeAdjustPolicy( QComboBox::AdjustToMinimumContentsLength );
m_comboBoxRef->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
m_comboBoxRef->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
updateSubWindowList();
QGridLayout *mainLayout = new QGridLayout;
@@ -152,7 +152,16 @@ Void QualityMeasurementSidebar::updateSubWindowList()
Void QualityMeasurementSidebar::updateCurrentWindow( SubWindowHandle *subWindow )
{
m_pcCurrentSubWindow = subWindow;
updateSidebarData();
if( m_pcCurrentSubWindow )
{
Int index = -1;
if( SubWindowHandle* refSubWindow = m_pcCurrentSubWindow->getRefSubWindow() )
{
index = m_pcWindowListNames.indexOf( refSubWindow->getWindowName() );
}
m_comboBoxRef->setCurrentIndex( index );
updateSidebarData();
}
}
Void QualityMeasurementSidebar::updateSidebarData()
@@ -160,11 +169,9 @@ Void QualityMeasurementSidebar::updateSidebarData()
QString value( "0.00" );
if( m_pcCurrentSubWindow )
{
if( SubWindowHandle* refSubWindow = m_pcCurrentSubWindow->getRefSubWindow() )
SubWindowHandle* refSubWindow = m_pcCurrentSubWindow->getRefSubWindow();
if( refSubWindow )
{
Int index = m_pcWindowListNames.indexOf( refSubWindow->getWindowName() );
m_comboBoxRef->setCurrentIndex( index );
PlaYUVerFrame* currFrame = m_pcCurrentSubWindow->getCurrFrame();
PlaYUVerFrame* refFrame = refSubWindow->getCurrFrame();
Double quality;
@@ -213,9 +220,9 @@ Void QualityMeasurementSidebar::slotReferenceChanged( Int index )
Void QualityMeasurementSidebar::slotQualityMetricChanged()
{
QString labelQuality = PlaYUVerFrame::supportedQualityMetricsList().at( m_comboBoxMetric->currentIndex() );
m_ppcLabelQualityLabel[LUMA]->setText( labelQuality + " Y");
m_ppcLabelQualityLabel[CHROMA_U]->setText( labelQuality + " U");
m_ppcLabelQualityLabel[CHROMA_V]->setText( labelQuality + " V");
m_ppcLabelQualityLabel[LUMA]->setText( labelQuality + " Y" );
m_ppcLabelQualityLabel[CHROMA_U]->setText( labelQuality + " U" );
m_ppcLabelQualityLabel[CHROMA_V]->setText( labelQuality + " V" );
updateSidebarData();
}
} // NAMESPACE
+8 -4
View File
@@ -303,8 +303,10 @@ Void SubWindowHandle::seekAbsoluteEvent( UInt new_frame_num )
{
if( m_pCurrStream )
{
m_pCurrStream->seekInput( new_frame_num );
refreshFrame();
if( m_pCurrStream->seekInput( new_frame_num ) )
{
refreshFrame();
}
}
}
@@ -312,8 +314,10 @@ Void SubWindowHandle::seekRelativeEvent( Bool bIsFoward )
{
if( m_pCurrStream )
{
m_pCurrStream->seekInput( m_pCurrStream->getCurrFrameNum() + ( bIsFoward ? 1 : -1 ) );
refreshFrame();
if( m_pCurrStream->seekInput( m_pCurrStream->getCurrFrameNum() + ( bIsFoward ? 1 : -1 ) ) )
{
refreshFrame();
}
}
}
+11 -3
View File
@@ -53,6 +53,14 @@ public:
{
NormalMode, MaskMode,
};
typedef enum
{
NavigationTool,
NormalSelectionTool,
BlockSelectionTool,
MaskTool,
EraserTool
}eTool;
ViewArea( QWidget *parent = 0 );
@@ -90,7 +98,7 @@ public:
{
return m_mode;
}
enum eTool tool() const
eTool tool() const
{
return m_tool;
}
@@ -109,7 +117,7 @@ public:
Void zoomChangeEvent(Double factor, QPoint center);
void setTool( enum eTool tool );
void setTool( eTool tool );
// QSize sizeHint() const;
@@ -161,7 +169,7 @@ private:
QPoint m_lastWindowPos;
GridManager m_grid;
ViewMode m_mode;
enum eTool m_tool;
eTool m_tool;
QColor m_maskColor;
double m_zoomFactor;
int m_xOffset;
+16 -14
View File
@@ -53,6 +53,7 @@ plaYUVerApp::plaYUVerApp()
setCentralWidget( mdiArea );
//mdiArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
//mdiArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
connect( mdiArea, SIGNAL( subWindowActivated(QMdiSubWindow*) ), this, SLOT( chageSubWindowSelection() ) );
@@ -878,6 +879,7 @@ Void plaYUVerApp::chageSubWindowSelection()
if( activeSubWindow() )
{
m_pcCurrentSubWindow = new_window;
setWindowTitle( QApplication::applicationName() + " - " + m_pcCurrentSubWindow->getWindowName() );
if( !plaYUVerApp::findSubWindow( mdiArea, m_pcCurrentSubWindow->getRefSubWindow() ) )
{
m_pcCurrentSubWindow->setRefSubWindow( NULL );
@@ -888,7 +890,7 @@ Void plaYUVerApp::chageSubWindowSelection()
updateFrameProperties();
updateZoomFactorSBox();
if( m_acPlayingSubWindows.contains( m_pcCurrentSubWindow ) )
if( m_pcCurrentSubWindow->isPlaying() )
m_arrayActions[PLAY_ACT]->setIcon( style()->standardIcon( QStyle::SP_MediaPause ) );
else
m_arrayActions[PLAY_ACT]->setIcon( style()->standardIcon( QStyle::SP_MediaPlay ) );
@@ -981,15 +983,9 @@ SubWindowHandle* plaYUVerApp::findSubWindow( const QMdiArea* mdiArea, const SubW
return 0;
}
Void plaYUVerApp::setNavigationTool()
Void plaYUVerApp::setTool( Int idxTool )
{
m_appTool = NavigationTool;
setAllSubWindowTool();
}
Void plaYUVerApp::setSelectionTool()
{
m_appTool = NormalSelectionTool;
m_appTool = (ViewArea::eTool ) idxTool;
setAllSubWindowTool();
}
@@ -1271,19 +1267,25 @@ Void plaYUVerApp::createActions()
actionGroupTools = new QActionGroup( this );
actionGroupTools->setExclusive( true );
m_appTool = NavigationTool;
m_mapperTools = new QSignalMapper( this );
connect( m_mapperTools, SIGNAL( mapped(int) ), this, SLOT( setTool(int) ) );
m_appTool = ViewArea::NavigationTool;
m_arrayActions[NAVIGATION_TOOL_ACT] = new QAction( tr( "&Navigation Tool" ), this );
m_arrayActions[NAVIGATION_TOOL_ACT]->setCheckable( true );
m_arrayActions[NAVIGATION_TOOL_ACT]->setChecked( true );
actionGroupTools->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), this, SLOT( setNavigationTool() ) );
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
m_mapperTools->setMapping( m_arrayActions[NAVIGATION_TOOL_ACT], ViewArea::NavigationTool );
m_arrayActions[SELECTION_TOOL_ACT] = new QAction( "&Selection Tool", this );
m_arrayActions[SELECTION_TOOL_ACT]->setCheckable( true );
m_arrayActions[SELECTION_TOOL_ACT]->setChecked( false );
actionGroupTools->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), this, SLOT( setSelectionTool() ) );
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
m_mapperTools->setMapping( m_arrayActions[SELECTION_TOOL_ACT], ViewArea::NormalSelectionTool );
// ------------ Window ------------
@@ -1493,8 +1495,8 @@ Void plaYUVerApp::readSettings()
move( pos );
resize( size );
m_cLastOpenPath = settings.lastOpenPath();
m_appTool = ( enum eTool )settings.getSelectedTool();
setAllSubWindowTool();
//m_appTool = ( ViewArea::eTool )settings.getSelectedTool();
//setAllSubWindowTool();
m_arrayActions[VIDEO_LOOP_ACT]->setChecked( settings.getRepeat() );
m_arrayActions[VIDEO_LOCK_ACT]->setChecked( settings.getVideoLock() );
+10 -5
View File
@@ -113,8 +113,7 @@ private Q_SLOTS:
void updateZoomFactorSBox();
void setAllSubWindowTool();
void setNavigationTool();
void setSelectionTool();
void setTool( int idxTool );
private:
@@ -295,9 +294,15 @@ private:
// Tools Actions;
QActionGroup *actionGroupTools;
QAction *actionNavigationTool;
QAction *actionSelectionTool;
enum eTool m_appTool;
enum APP_TOOLS_ACTION_LIST
{
NAVIGATION_TOOL,
SELECTION_TOOL,
TOTAL_TOOLS,
};
QVector<QAction*> m_arrayTools;
QSignalMapper *m_mapperTools;
ViewArea::eTool m_appTool;
PlaYUVerStreamInfoVector m_aRecentFileStreamInfo;