From cd48ea2c3cb940e8001fe2f51bafbdc10d8a1765 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 01:46:57 +0000 Subject: [PATCH 1/2] Add seekRelative function into PlaYUVerStream and minor fix in ModulesHandle --- app/ModulesHandle.cpp | 2 +- app/VideoSubWindow.cpp | 2 +- lib/PlaYUVerStream.cpp | 19 +++++++++++++++++++ lib/PlaYUVerStream.h | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 86dbf2b..4e19ce7 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -282,7 +282,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) } else { - windowName.append( pcVideoSubWindow->windowTitle() ); + windowName.append( pcVideoSubWindow->getWindowName() ); videoSubWindowList.append( pcVideoSubWindow ); } diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 5c0f72d..3e27fa2 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -518,7 +518,7 @@ Void VideoSubWindow::seekRelativeEvent( Bool bIsFoward ) { if( m_pCurrStream ) { - if( m_pCurrStream->seekInput( m_pCurrStream->getCurrFrameNum() + ( bIsFoward ? 1 : -1 ) ) ) + if( m_pCurrStream->seekInputRelative( bIsFoward ) ) { refreshFrame(); } diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index b30012b..eb212e6 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -692,6 +692,25 @@ PlaYUVerFrame* PlaYUVerStream::getNextFrame() return m_pcNextFrame; } +Bool PlaYUVerStream::seekInputRelative( Bool bIsFoward ) +{ + if( !m_bInit || !m_bIsInput ) + return false; + + Bool bRet = false; + if( bIsFoward ) + { + readFrame(); + bRet = !setNextFrame(); + } + else + { + UInt64 newFrameNum = m_iCurrFrameNum - 1; + bRet = seekInput( newFrameNum ); + } + return bRet; +} + Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) { if( !m_bInit || new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || ( Int64 )new_frame_num == m_iCurrFrameNum ) diff --git a/lib/PlaYUVerStream.h b/lib/PlaYUVerStream.h index 57906fc..a9429ab 100644 --- a/lib/PlaYUVerStream.h +++ b/lib/PlaYUVerStream.h @@ -77,7 +77,6 @@ private: std::string m_cCodedName; std::string m_cPelFmtName; - FILE* m_pFile; /**< The input file pointer >*/ std::fstream m_fsIOStream; /**< The input file pointer >*/ @@ -146,6 +145,7 @@ public: PlaYUVerFrame* getCurrFrame( PlaYUVerFrame * ); PlaYUVerFrame* getNextFrame(); + Bool seekInputRelative( Bool bIsFoward ); Bool seekInput( UInt64 new_frame_num ); Bool isInit() From 746c6d5a9a63783db21a35b965da6c303db8e9e3 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 03:44:51 +0000 Subject: [PATCH 2/2] Improvements in PlaYUVerStream and QualityMeasurements --- app/QualityMeasurementSidebar.cpp | 4 ++++ app/SubWindowHandle.cpp | 3 --- app/VideoSubWindow.cpp | 3 +++ lib/PlaYUVerStream.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/QualityMeasurementSidebar.cpp b/app/QualityMeasurementSidebar.cpp index 3b2cf01..e140dd4 100644 --- a/app/QualityMeasurementSidebar.cpp +++ b/app/QualityMeasurementSidebar.cpp @@ -138,6 +138,10 @@ Void QualityMeasurementSidebar::updateSubWindowList() for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); + if( m_pcCurrentVideoSubWindow == pcVideoSubWindow ) + { + continue; + } if( m_pcCurrentVideoSubWindow ) { if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt( pcVideoSubWindow->getCurrFrame() ) ) diff --git a/app/SubWindowHandle.cpp b/app/SubWindowHandle.cpp index 0a304fb..7830ba9 100644 --- a/app/SubWindowHandle.cpp +++ b/app/SubWindowHandle.cpp @@ -42,9 +42,6 @@ SubWindowHandle::SubWindowHandle( QWidget * parent, UInt category ) : connect( horizontalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateCurScrollValues() ) ); connect( verticalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateCurScrollValues() ) ); - setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - setWidgetResizable( true ); m_uiCategory = category; diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 3e27fa2..f3c049b 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -97,6 +97,9 @@ VideoSubWindow::VideoSubWindow( enum VideoSubWindowCategories category, QWidget connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectedArea( QRect ) ) ); connect( m_cViewArea, SIGNAL( positionChanged( const QPoint & ) ), this, SLOT( updatePixelValueStatusBar( const QPoint & ) ) ); + setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + // Define the cViewArea as the widget inside the scroll area m_cViewArea->setMinimumSize( size() ); setWidget( m_cViewArea ); diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index eb212e6..48fafec 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -700,8 +700,8 @@ Bool PlaYUVerStream::seekInputRelative( Bool bIsFoward ) Bool bRet = false; if( bIsFoward ) { - readFrame(); bRet = !setNextFrame(); + readFrame(); } else {