Merge branch 'master' of https://github.com/pixlra/playuver
This commit is contained in:
+14
-7
@@ -2,18 +2,19 @@
|
|||||||
### CMakeLists for playuver
|
### CMakeLists for playuver
|
||||||
###
|
###
|
||||||
|
|
||||||
|
cmake_minimum_required( VERSION 2.8.9 )
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
# Project Definition
|
# Project Definition
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
SET( PROJECT_NAME playuver )
|
||||||
cmake_minimum_required( VERSION 2.8.9 )
|
SET( PLAYUVER_VERSION_MAJOR "0" )
|
||||||
|
SET( PLAYUVER_VERSION_MINOR "1" )
|
||||||
|
SET( PLAYUVER_VERSION_PATH "0" )
|
||||||
|
PROJECT( ${PROJECT_NAME} )
|
||||||
|
|
||||||
INCLUDE( cmake/CMakeMacros.cmake )
|
INCLUDE( cmake/CMakeMacros.cmake )
|
||||||
|
|
||||||
PROJECT( playuver )
|
|
||||||
|
|
||||||
SET( PROJECT_NAME playuver )
|
|
||||||
|
|
||||||
# Project directories
|
# Project directories
|
||||||
SET( SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source )
|
SET( SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source )
|
||||||
SET( LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source/lib )
|
SET( LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source/lib )
|
||||||
@@ -39,6 +40,8 @@ IF(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
|
|||||||
SET_PROPERTY( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
SET_PROPERTY( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
SET( CMAKE_CXX_FLAGS "" )
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
# Variables
|
# Variables
|
||||||
######################################################################################
|
######################################################################################
|
||||||
@@ -87,11 +90,14 @@ ENDIF()
|
|||||||
|
|
||||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
||||||
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g" )
|
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g" )
|
||||||
SET( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3" )
|
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3" )
|
||||||
|
|
||||||
IF( USE_WERROR )
|
IF( USE_WERROR )
|
||||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
|
||||||
|
|
||||||
ADD_EXECUTABLE( ${PROJECT_NAME} ${SOURCES_FILES} ${HEADERS_MOC_FILES} ${FORMS_HEADERS_FILES} ${RESOURCES_RCC_FILES} )
|
ADD_EXECUTABLE( ${PROJECT_NAME} ${SOURCES_FILES} ${HEADERS_MOC_FILES} ${FORMS_HEADERS_FILES} ${RESOURCES_RCC_FILES} )
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${PLAYUVER_LIBS} ${MODULES_LIBS} ${LINKER_LIBS} )
|
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${PLAYUVER_LIBS} ${MODULES_LIBS} ${LINKER_LIBS} )
|
||||||
@@ -107,6 +113,7 @@ INCLUDE(cmake/Install.cmake)
|
|||||||
######################################################################################
|
######################################################################################
|
||||||
status("Configuration:")
|
status("Configuration:")
|
||||||
status(" Build type:" ${CMAKE_BUILD_TYPE} )
|
status(" Build type:" ${CMAKE_BUILD_TYPE} )
|
||||||
|
status(" Build flags:" "${CMAKE_CXX_FLAGS}" )
|
||||||
status(" Warnings as errors:" USE_WERROR THEN YES ELSE NO)
|
status(" Warnings as errors:" USE_WERROR THEN YES ELSE NO)
|
||||||
status("Dependencies:")
|
status("Dependencies:")
|
||||||
status(" QT:" USE_QT4 THEN "QT4" ELSE "QT5" )
|
status(" QT:" USE_QT4 THEN "QT4" ELSE "QT5" )
|
||||||
|
|||||||
+10
-11
@@ -7,21 +7,20 @@ INSTALL(FILES resources/playuver.desktop DESTINATION share/applications )
|
|||||||
INSTALL(FILES resources/playuver.png DESTINATION share/icons )
|
INSTALL(FILES resources/playuver.png DESTINATION share/icons )
|
||||||
INSTALL(FILES resources/x-raw.xml DESTINATION share/mime/video )
|
INSTALL(FILES resources/x-raw.xml DESTINATION share/mime/video )
|
||||||
|
|
||||||
# # try to set up the menu system
|
|
||||||
# find_program(XDG-MIME_EXECUTABLE xdg-mime)
|
|
||||||
# # find_program(XDG-DESKTOP-MENU_EXECUTABLE xdg-desktop-menu)
|
|
||||||
# INSTALL(CODE "execute_process(COMMAND ${XDG-MIME_EXECUTABLE} install --novendor resources/)" )
|
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
# Create deb package
|
# Create deb package
|
||||||
######################################################################################
|
######################################################################################
|
||||||
SET(CPACK_GENERATOR "DEB")
|
SET(CPACK_GENERATOR "DEB")
|
||||||
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
|
SET(CPACK_PACKAGE_VERSION_MAJOR ${PLAYUVER_VERSION_MAJOR})
|
||||||
SET(CPACK_PACKAGE_VERSION_MINOR "1")
|
SET(CPACK_PACKAGE_VERSION_MINOR ${PLAYUVER_VERSION_MINOR})
|
||||||
SET(CPACK_PACKAGE_VERSION_PATCH "0")
|
SET(CPACK_PACKAGE_VERSION_PATCH ${PLAYUVER_VERSION_PATH})
|
||||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt4-core,libqt4-gui,libavformat53,libcodec53,libavutil51")
|
IF( USE_QT4 )
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS} libqtcore4,libqtgui4 ")
|
||||||
|
ENDIF()
|
||||||
|
IF( USE_FFMPEG )
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS} libavformat53,libcodec53,libavutil51")
|
||||||
|
ENDIF()
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION "plaYUVer is an open-source QT based raw video player")
|
SET(CPACK_PACKAGE_DESCRIPTION "plaYUVer is an open-source QT based raw video player")
|
||||||
SET(CPACK_PACKAGE_CONTACT "Joao Carreira (jfmcarreira@gmail.com)")
|
SET(CPACK_PACKAGE_CONTACT "Joao Carreira (jfmcarreira@gmail.com), Luis Lucas (luisfrlucas@gmail.com)")
|
||||||
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/Debian/postinst")
|
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/Debian/postinst")
|
||||||
|
|
||||||
INCLUDE(CPack)
|
INCLUDE(CPack)
|
||||||
+1
-1
@@ -32,7 +32,7 @@ IF( NOT USE_QT4 )
|
|||||||
QT5_ADD_RESOURCES( RESOURCES_RCC_FILES ${RESOURCES_FILES} )
|
QT5_ADD_RESOURCES( RESOURCES_RCC_FILES ${RESOURCES_FILES} )
|
||||||
|
|
||||||
# Add compiler flags for building executables (-fPIE)
|
# Add compiler flags for building executables (-fPIE)
|
||||||
SET( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS} )
|
LIST(APPEND CMAKE_CXX_FLAGS ${Qt5Core_EXECUTABLE_COMPILE_FLAGS} )
|
||||||
|
|
||||||
LIST(APPEND LINKER_LIBS ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} )
|
LIST(APPEND LINKER_LIBS ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} )
|
||||||
SET( CURR_QT_MODULES Core Gui Widgets )
|
SET( CURR_QT_MODULES Core Gui Widgets )
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ Void InputStream::getDuration( Int* duration_array )
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
secs = m_uiTotalFrameNum * m_uiFrameRate;
|
secs = m_uiTotalFrameNum / m_uiFrameRate;
|
||||||
}
|
}
|
||||||
mins = secs / 60;
|
mins = secs / 60;
|
||||||
secs %= 60;
|
secs %= 60;
|
||||||
|
|||||||
+52
-14
@@ -322,26 +322,35 @@ void plaYUVerApp::pause()
|
|||||||
{
|
{
|
||||||
m_pcCurrentSubWindow->pause();
|
m_pcCurrentSubWindow->pause();
|
||||||
}
|
}
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() );
|
updateCurrFrameNum();
|
||||||
}
|
}
|
||||||
setTimerStatus();
|
setTimerStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void plaYUVerApp::stop()
|
void plaYUVerApp::stop()
|
||||||
{
|
{
|
||||||
|
if( m_acPlayingSubWindows.size() > 0 )
|
||||||
|
{
|
||||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||||
{
|
{
|
||||||
m_acPlayingSubWindows.at( i )->stop();
|
m_acPlayingSubWindows.at( i )->stop();
|
||||||
}
|
}
|
||||||
m_acPlayingSubWindows.clear();
|
m_acPlayingSubWindows.clear();
|
||||||
setTimerStatus();
|
setTimerStatus();
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() );
|
updateCurrFrameNum();
|
||||||
|
|
||||||
if( m_uiAveragePlayInterval )
|
if( m_uiAveragePlayInterval )
|
||||||
qDebug( ) << "Real display time: "
|
qDebug( ) << "Real display time: "
|
||||||
<< QString::number( 1000 / m_uiAveragePlayInterval )
|
<< QString::number( 1000 / m_uiAveragePlayInterval )
|
||||||
<< " fps";
|
<< " fps";
|
||||||
m_uiAveragePlayInterval = 0;
|
m_uiAveragePlayInterval = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( m_pcCurrentSubWindow )
|
||||||
|
{
|
||||||
|
seekSliderEvent( 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plaYUVerApp::playEvent()
|
void plaYUVerApp::playEvent()
|
||||||
@@ -354,13 +363,13 @@ void plaYUVerApp::playEvent()
|
|||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
stop();
|
stop();
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow ? m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() : 0 );
|
updateCurrFrameNum();
|
||||||
break;
|
break;
|
||||||
case -2:
|
case -2:
|
||||||
if( !actionVideoLoop->isChecked() )
|
if( !actionVideoLoop->isChecked() )
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow ? m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() : 0 );
|
updateCurrFrameNum();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -374,12 +383,29 @@ void plaYUVerApp::playEvent()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( m_pcCurrentSubWindow )
|
updateCurrFrameNum();
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() );
|
|
||||||
|
|
||||||
m_uiAveragePlayInterval = ( m_uiAveragePlayInterval + time ) / 2;
|
m_uiAveragePlayInterval = ( m_uiAveragePlayInterval + time ) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Void plaYUVerApp::updateCurrFrameNum()
|
||||||
|
{
|
||||||
|
if( m_pcCurrentSubWindow )
|
||||||
|
{
|
||||||
|
Int frame_num = m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum();
|
||||||
|
m_pcFrameSlider->setValue( frame_num );
|
||||||
|
m_pcCurrFrameNumLabel->setText( QString( tr( "%1" ) ).arg( frame_num ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Void plaYUVerApp::updateTotalFrameNum( UInt total_frame_num )
|
||||||
|
{
|
||||||
|
if( m_pcCurrentSubWindow && total_frame_num == 0 )
|
||||||
|
{
|
||||||
|
total_frame_num = m_pcCurrentSubWindow->getInputStream()->getFrameNum();
|
||||||
|
}
|
||||||
|
m_pcFrameSlider->setMaximum( total_frame_num - 1 );
|
||||||
|
m_pcTotalFrameNumLabel->setText( QString( tr( "%1" ) ).arg( total_frame_num ) );
|
||||||
|
}
|
||||||
|
|
||||||
void plaYUVerApp::seekEvent( int direction )
|
void plaYUVerApp::seekEvent( int direction )
|
||||||
{
|
{
|
||||||
if( m_pcCurrentSubWindow )
|
if( m_pcCurrentSubWindow )
|
||||||
@@ -394,8 +420,9 @@ void plaYUVerApp::seekEvent( int direction )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_pcCurrentSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
m_pcCurrentSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() );
|
|
||||||
}
|
}
|
||||||
|
updateCurrFrameNum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,8 +440,8 @@ void plaYUVerApp::seekSliderEvent( int new_frame_num )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_pcCurrentSubWindow->seekAbsoluteEvent( ( UInt )new_frame_num );
|
m_pcCurrentSubWindow->seekAbsoluteEvent( ( UInt )new_frame_num );
|
||||||
m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() );
|
|
||||||
}
|
}
|
||||||
|
updateCurrFrameNum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,9 +503,10 @@ void plaYUVerApp::chageSubWindowSelection()
|
|||||||
// {
|
// {
|
||||||
// playingTimer->stop();
|
// playingTimer->stop();
|
||||||
// }
|
// }
|
||||||
m_pcFrameSlider->setMaximum( activeSubWindow()->getInputStream()->getFrameNum() - 1 );
|
|
||||||
m_pcFrameSlider->setValue( activeSubWindow()->getInputStream()->getCurrFrameNum() );
|
|
||||||
m_pcCurrentSubWindow = activeSubWindow();
|
m_pcCurrentSubWindow = activeSubWindow();
|
||||||
|
updateCurrFrameNum();
|
||||||
|
updateTotalFrameNum();
|
||||||
|
m_pcCurrFrameNumLabel->setText( QString( tr( "%1" ) ).arg( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() ) );
|
||||||
updateProperties();
|
updateProperties();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -615,8 +643,9 @@ Void plaYUVerApp::updateMenus()
|
|||||||
if( !hasSubWindow )
|
if( !hasSubWindow )
|
||||||
{
|
{
|
||||||
m_pcFrameSlider->setValue( 0 );
|
m_pcFrameSlider->setValue( 0 );
|
||||||
|
m_pcCurrFrameNumLabel->setText("-");
|
||||||
|
m_pcTotalFrameNumLabel->setText("-");
|
||||||
}
|
}
|
||||||
|
|
||||||
actionNavigationTool->setEnabled( hasSubWindow );
|
actionNavigationTool->setEnabled( hasSubWindow );
|
||||||
actionSelectionTool->setEnabled( hasSubWindow );
|
actionSelectionTool->setEnabled( hasSubWindow );
|
||||||
|
|
||||||
@@ -920,7 +949,16 @@ Void plaYUVerApp::createToolBars()
|
|||||||
toolbarVideo->addAction( actionVideoCenter );
|
toolbarVideo->addAction( actionVideoCenter );
|
||||||
*/
|
*/
|
||||||
toolbarVideo->addWidget( m_pcFrameSlider );
|
toolbarVideo->addWidget( m_pcFrameSlider );
|
||||||
|
toolbarVideo->addWidget( new QLabel );
|
||||||
|
m_pcCurrFrameNumLabel = new QLabel;
|
||||||
|
m_pcCurrFrameNumLabel->setText("-");
|
||||||
|
toolbarVideo->addWidget( m_pcCurrFrameNumLabel );
|
||||||
|
QLabel *forwardslash = new QLabel;
|
||||||
|
forwardslash->setText("/");
|
||||||
|
toolbarVideo->addWidget( forwardslash );
|
||||||
|
m_pcTotalFrameNumLabel = new QLabel;
|
||||||
|
m_pcTotalFrameNumLabel->setText("-");
|
||||||
|
toolbarVideo->addWidget( m_pcTotalFrameNumLabel );
|
||||||
}
|
}
|
||||||
|
|
||||||
Void plaYUVerApp::createDockWidgets()
|
Void plaYUVerApp::createDockWidgets()
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ private:
|
|||||||
Void loadFile( QString fileName );
|
Void loadFile( QString fileName );
|
||||||
//! Playing functions
|
//! Playing functions
|
||||||
Void setTimerStatus();
|
Void setTimerStatus();
|
||||||
|
Void updateCurrFrameNum();
|
||||||
|
Void updateTotalFrameNum( UInt total_frame_num = 0 );
|
||||||
|
|
||||||
Void updateMenus();
|
Void updateMenus();
|
||||||
Void updateProperties();
|
Void updateProperties();
|
||||||
@@ -135,6 +137,8 @@ private:
|
|||||||
Bool m_bIsPlaying;
|
Bool m_bIsPlaying;
|
||||||
QVector<SubWindowHandle*> m_acPlayingSubWindows;
|
QVector<SubWindowHandle*> m_acPlayingSubWindows;
|
||||||
QSlider *m_pcFrameSlider;
|
QSlider *m_pcFrameSlider;
|
||||||
|
QLabel *m_pcCurrFrameNumLabel;
|
||||||
|
QLabel *m_pcTotalFrameNumLabel;
|
||||||
|
|
||||||
|
|
||||||
QSignalMapper *mapperZoom;
|
QSignalMapper *mapperZoom;
|
||||||
|
|||||||
Reference in New Issue
Block a user