Merge branch 'devel'

This commit is contained in:
jfmcarreira committed 2015-03-09 18:29:00 +00:00
commit e7bf821c2c
29 files changed
+1603 -477

No files matched your search

+35
View File
@@ -10,6 +10,41 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/../
${CMAKE_CURRENT_SOURCE_DIR}/../modules
${CMAKE_CURRENT_BINARY_DIR}/../modules )
#####################################################################################
# Qt library
######################################################################################
OPTION( USE_QT4 "Build with QT4" OFF )
IF( USE_QT4 )
FIND_PACKAGE( Qt4 REQUIRED COMPONENTS QtCore QtGui QtDBus QtNetwork QtWebKit )
SET( USE_QTDBUS TRUE )
IF( NOT QT4_FOUND )
SET(USE_QT4 FALSE)
ELSE()
INCLUDE( ${QT_USE_FILE} )
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
SET( QT_LINKER_LIBS ${QT_LIBRARIES} )
ENDIF()
ENDIF()
IF( NOT USE_QT4 )
FIND_PACKAGE( Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport Concurrent )
FIND_PACKAGE( Qt5DBus )
LIST(APPEND QT_LINKER_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Concurrent )
LIST(APPEND QT_MODULES Core Gui Widgets PrintSupport Concurrent )
IF( ${Qt5DBus_FOUND} )
SET( USE_QTDBUS ${Qt5DBus_FOUND} )
LIST(APPEND QT_LINKER_LIBS Qt5::DBus )
LIST(APPEND QT_MODULES DBus )
ENDIF()
#INCLUDE_DIRECTORIES( ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
#SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}" )
ENDIF()
set(plaYUver_App_SRCS
# Main
main.cpp
+12 -12
View File
@@ -164,16 +164,18 @@ Void ModulesHandle::updateMenus()
if( pcSubWindow )
{
QList<PlaYUVerAppModuleIf*> apcCurrentModule = pcSubWindow->getModuleArray();
if( pcSubWindow->getDisplayModule() )
{
m_arrayActions[APPLY_ALL_ACT]->setEnabled( true );
m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true );
apcCurrentModule.append( pcSubWindow->getDisplayModule() );
}
for( Int i = 0; i < apcCurrentModule.size(); i++ )
{
currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction;
currModuleAction->setChecked( true );
}
if( apcCurrentModule.size() )
{
m_arrayActions[APPLY_ALL_ACT]->setEnabled( true );
m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true );
}
}
}
@@ -194,10 +196,10 @@ Void ModulesHandle::processOpt( Int index )
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow *>( m_pcMainWindowManager->activeSubWindow() );
if( pcSubWindow )
{
QList<PlaYUVerAppModuleIf*> apcCurrentModule = pcSubWindow->getModuleArray();
if( apcCurrentModule.size() > 1 )
PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
if( pcCurrentModule )
{
PlaYUVerAppModuleIf* pcCurrModule = apcCurrentModule.at( 0 );
PlaYUVerAppModuleIf* pcCurrModule = pcCurrentModule;
switch( index )
{
case INVALID_OPT:
@@ -304,11 +306,10 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
pcModuleSubWindow->setWindowName( windowName );
connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) );
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo,
SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
pcCurrModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow;
}
@@ -468,7 +469,6 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
}
supported.append( " )" );
QStringList filter;
filter << supported
<< formatsList
+1 -3
View File
@@ -426,7 +426,7 @@ Void VideoHandle::play()
if( !m_pcCurrentVideoSubWindow->isPlaying() ) // Not playing
{
UInt frameRate;
Double frameRate;
UInt timeInterval;
if( m_acPlayingSubWindows.size() < 2 )
{
@@ -486,7 +486,6 @@ Void VideoHandle::stop()
}
}
emit changed();
//update();
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false );
}
@@ -523,7 +522,6 @@ Void VideoHandle::playEvent()
m_pcCurrentVideoSubWindow->close();
}
emit changed();
//update();
}
Void VideoHandle::seekEvent( Int direction )
+32 -6
View File
@@ -26,6 +26,9 @@
#include "ModulesHandle.h"
#include "SubWindowHandle.h"
#include "ConfigureFormatDialog.h"
#if( QT_VERSION_PLAYUVER == 5 )
#include "QtConcurrent/qtconcurrentrun.h"
#endif
namespace plaYUVer
{
@@ -401,7 +404,7 @@ Void VideoSubWindow::setCurrFrame( PlaYUVerFrame* pcCurrFrame )
m_cViewArea->setImage( m_pcCurrFrame );
}
Void VideoSubWindow::refreshFrame()
Void VideoSubWindow::refreshFrameOperation()
{
Bool bSetFrame = false;
if( m_pCurrStream )
@@ -424,6 +427,21 @@ Void VideoSubWindow::refreshFrame()
}
}
Void VideoSubWindow::refreshFrame( Bool bThreaded )
{
#ifndef QT_NO_CONCURRENT
m_cRefreshResult.waitForFinished();
if( bThreaded )
{
m_cRefreshResult = QtConcurrent::run( this, &VideoSubWindow::refreshFrameOperation );
}
else
#endif
{
refreshFrameOperation();
}
}
Bool VideoSubWindow::save( QString filename )
{
Bool iRet = false;
@@ -461,11 +479,19 @@ Bool VideoSubWindow::playEvent()
Bool bEndOfSeq = false;
if( m_pCurrStream && m_bIsPlaying )
{
#ifndef QT_NO_CONCURRENT
m_cRefreshResult.waitForFinished();
m_cReadResult.waitForFinished();
#endif
bEndOfSeq = m_pCurrStream->setNextFrame();
if( !bEndOfSeq )
{
refreshFrame();
m_pCurrStream->readFrame();
#ifndef QT_NO_CONCURRENT
m_cReadResult = QtConcurrent::run( m_pCurrStream, &PlaYUVerStream::readFrameFillRGBBuffer );
#else
m_pCurrStream->readFrameFillRGBBuffer();
#endif
}
}
return bEndOfSeq;
@@ -520,7 +546,7 @@ Void VideoSubWindow::normalSize()
Void VideoSubWindow::zoomToFit()
{
// Scale to a smaller size that the real to a nicer look
// Scale to a smaller size that the real to a nicer look
scaleView( getScrollSize() );
}
@@ -557,7 +583,7 @@ Void VideoSubWindow::scaleView( const QSize & size, QPoint center )
QSize newSize = imgViewSize;
newSize.scale( size, Qt::KeepAspectRatio );
// Calc the zoom factor
// Calc the zoom factor
Double wfactor = 1;
Double hfactor = 1;
Double factor;
@@ -642,8 +668,8 @@ QSize VideoSubWindow::sizeHint( const QSize & maxSize ) const
else if( m_pCurrStream )
isize = QSize( m_pCurrStream->getWidth() + 50, m_pCurrStream->getHeight() + 50 );
// If the VideoSubWindow needs more space that the avaiable, we'll give
// to the subwindow a reasonable size preserving the image aspect ratio.
// If the VideoSubWindow needs more space that the avaiable, we'll give
// to the subwindow a reasonable size preserving the image aspect ratio.
if( !( isize.width() < maxSize.width() && isize.height() < maxSize.height() ) )
{
isize.scale( maxSize, Qt::KeepAspectRatio );
+17 -2
View File
@@ -32,6 +32,7 @@
#elif( QT_VERSION_PLAYUVER == 4 )
#include <QtGui>
#endif
#include "QFuture"
#include "lib/PlaYUVerStream.h"
#include "SubWindowHandle.h"
#include "ViewArea.h"
@@ -84,6 +85,16 @@ private:
Bool m_bIsPlaying;
Bool m_bIsModule;
/**
* Threads variables
* QtConcurrent
*/
QFuture<Void> m_cRefreshResult;
QFuture<Void> m_cReadResult;
Void refreshFrame( Bool bThreaded = false );
Void refreshFrameOperation();
static Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate );
/**
@@ -105,7 +116,7 @@ public:
Bool loadFile( QString cFilename, Bool bForceDialog = false );
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
Void loadAll( );
Void loadAll();
Void reloadFile();
Bool save( QString filename );
@@ -122,7 +133,6 @@ public:
Void seekAbsoluteEvent( UInt new_frame_num );
Void seekRelativeEvent( Bool bIsFoward );
Void refreshFrame();
Void setCurrFrame( PlaYUVerFrame* pcCurrFrame );
PlaYUVerStreamInfo getStreamInfo()
@@ -170,6 +180,11 @@ public:
Void disableModule( PlaYUVerAppModuleIf* pcModule = NULL );
Void associateModule( PlaYUVerAppModuleIf* pcModule );
PlaYUVerAppModuleIf* getDisplayModule()
{
return m_pcCurrentDisplayModule;
}
QList<PlaYUVerAppModuleIf*> getModuleArray()
{
return m_apcCurrentModule;