From 3bb22528c369b9e82c7b81ef0d610c0ec341ce61 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 20 Nov 2015 23:29:24 +0000 Subject: [PATCH 01/11] Change ebuild files Fix some typos Fix variables names --- CMakeLists.txt | 12 ++++-------- app/CMakeLists.txt | 14 +++++++------- lib/CMakeLists.txt | 15 +++++++-------- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b76547..94f5ce9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,13 +23,13 @@ SET( PLAYUVER_VERSION "${PLAYUVER_VERSION_MAJOR}.${PLAYUVER_VERSION_MINOR}.${PLA OPTION( PLAYUVER_BUILD_APP "Build GUI Application" ON ) OPTION( PLAYUVER_BUILD_TOOLS "Build Command Line Application" ON ) -OPTION( PLAYUVER_BUILD_EXEMPLES "Build Examples" OFF ) +OPTION( PLAYUVER_BUILD_EXAMPLES "Build Examples" OFF ) OPTION( USE_SSE "Build with SSE support" OFF ) OPTION( USE_FERVOR "Add Fervor support" OFF ) OPTION( USE_WERROR "Warnings as errors" OFF ) OPTION( USE_STATIC "Use static libs" ON ) OPTION( USE_QT4 "Build with Qt4" OFF ) -OPTION( USE_QTDBUS "Build with Qt4" OFF ) +OPTION( USE_QTDBUS "Build with QtDBus" OFF ) OPTION( USE_DYNLOAD "Use dynamic load of modules" ON ) # To be switched on when releasing. OPTION(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON) @@ -126,8 +126,8 @@ SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g" ) SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" ) -ADD_FEATURE_INFO(PlaYUVerApp PLAYUVER_BUILD_TOOLS "Build Graphical Interface") -ADD_FEATURE_INFO(PlaYUVerTools PLAYUVER_BUILD_APP "Build Command line tool" ) +ADD_FEATURE_INFO(PlaYUVerApp PLAYUVER_BUILD_APP "Build Graphical Interface") +ADD_FEATURE_INFO(PlaYUVerTools PLAYUVER_BUILD_TOOLS "Build Command line tool" ) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h ) @@ -143,10 +143,6 @@ IF( ${PLAYUVER_BUILD_APP} ) ADD_SUBDIRECTORY( app ) ENDIF() -IF( ${PLAYUVER_BUILD_EXEMPLES} ) - ADD_SUBDIRECTORY( examples ) -ENDIF() - ###################################################################################### # Final information dump diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 333293f..9553aff 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -80,9 +80,9 @@ IF( USE_QTDBUS ) ENDIF() -set(plaYUver_App_UI "" ) +set(PlaYUVer_App_UI "" ) -set(plaYUver_App_RCC +set(PlaYUVer_App_RCC resources/playuver.qrc ) @@ -140,11 +140,11 @@ SET_PACKAGE_PROPERTIES(Fervor PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "F ADD_FEATURE_INFO(Fervor USE_FERVOR "Fervor lib includes check for updates feature.") IF( USE_QT4 ) - QT4_WRAP_UI( plaYUver_App_UI_Wrap ${plaYUver_App_UI} ) - QT4_ADD_RESOURCES( plaYUver_App_RCC ${plaYUver_App_RCC} ) + QT4_WRAP_UI( PlaYUVer_App_UI_Wrap ${PlaYUVer_App_UI} ) + QT4_ADD_RESOURCES( PlaYUVer_App_RCC ${PlaYUVer_App_RCC} ) ELSE() - QT5_WRAP_UI( plaYUver_App_UI_Wrap ${plaYUver_App_UI} ) - QT5_ADD_RESOURCES( plaYUver_App_RCC ${plaYUver_App_RCC} ) + QT5_WRAP_UI( PlaYUVer_App_UI_Wrap ${PlaYUVer_App_UI} ) + QT5_ADD_RESOURCES( PlaYUVer_App_RCC ${PlaYUVer_App_RCC} ) ENDIF() # Instruct CMake to run moc automatically when needed. @@ -167,7 +167,7 @@ IF( WIN32 ) ENDIF() -ADD_EXECUTABLE( ${PROJECT_NAME} ${plaYUVer_App_SRCS} ${HEADERS_MOC_FILES} ${plaYUver_App_UI_Wrap} ${plaYUver_App_RCC} ${WINDOWS_RES_FILE} ) +ADD_EXECUTABLE( ${PROJECT_NAME} ${plaYUVer_App_SRCS} ${HEADERS_MOC_FILES} ${PlaYUVer_App_UI_Wrap} ${PlaYUVer_App_RCC} ${WINDOWS_RES_FILE} ) TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PlaYUVerLib PlaYUVerModules ${APP_LINKER_LIBS} ${QT_LINKER_LIBS} ) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c812ad0..992bc92 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -4,7 +4,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) -set(plaYUver_Lib_SRCS +set(PlaYUVer_Lib_SRCS # Frame PlaYUVerFrame.cpp PlaYUVerFramePixelFormats.cpp @@ -17,18 +17,17 @@ set(plaYUver_Lib_SRCS ) IF( USE_FFMPEG ) - LIST( APPEND plaYUver_Lib_SRCS LibAvContextHandle.cpp ) + LIST( APPEND PlaYUVer_Lib_SRCS LibAvContextHandle.cpp ) ENDIF() IF( USE_OPENCV ) - LIST( APPEND plaYUver_Lib_SRCS LibOpenCVHandler.cpp ) + LIST( APPEND PlaYUVer_Lib_SRCS LibOpenCVHandler.cpp ) ENDIF() -set(plaYUver_Lib_HEADERS +set(PlaYUVer_Lib_HEADERS PlaYUVerDefs.h PlaYUVerProgramOptions.h - # PlaYUVerFrameStats.h PlaYUVerFrame.h PlaYUVerStream.h PlaYUVerModuleIf.h @@ -48,16 +47,16 @@ set(plaYUver_Lib_HEADERS CONFIGURE_FILE( PlaYUVerConfig.cmake.in PlaYUVerConfig.cmake @ONLY) IF( USE_STATIC ) - ADD_LIBRARY( PlaYUVerLib STATIC ${plaYUver_Lib_SRCS} ) + ADD_LIBRARY( PlaYUVerLib STATIC ${PlaYUVer_Lib_SRCS} ) ELSE() - ADD_LIBRARY( PlaYUVerLib SHARED ${plaYUver_Lib_SRCS} ) + ADD_LIBRARY( PlaYUVerLib SHARED ${PlaYUVer_Lib_SRCS} ) ENDIF() INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ) TARGET_LINK_LIBRARIES( PlaYUVerLib ${FFMPEG_LIBRARIES} ${OpenCV_LIBRARIES} ) IF( NOT USE_STATIC ) - INSTALL(FILES ${plaYUver_Lib_HEADERS} DESTINATION include ) + INSTALL(FILES ${PlaYUVer_Lib_HEADERS} DESTINATION include ) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PlaYUVerConfig.cmake DESTINATION share/PlaYUVer ) INSTALL(TARGETS PlaYUVerLib DESTINATION lib ) ENDIF() From 6fbe7697d9afa7c4542cc1fca6f431067a1a522d Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 20 Nov 2015 23:40:41 +0000 Subject: [PATCH 02/11] Remove redundant include dirs in lib --- lib/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 992bc92..f484eaa 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -2,8 +2,6 @@ ### CMakeLists for playuver lib component ### -INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) - set(PlaYUVer_Lib_SRCS # Frame PlaYUVerFrame.cpp From a3c288de29c1b80c842ebc3a26ef2a2ab42e58a8 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 21 Nov 2015 00:19:26 +0000 Subject: [PATCH 03/11] Fix warning --- lib/PlaYUVerStream.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index 9c2e83c..ece9d00 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -524,7 +524,7 @@ Void PlaYUVerStream::loadAll() Void PlaYUVerStream::getDuration( Int* duration_array ) { - Int hours, mins, secs; + Int hours, mins, secs = 0; #ifdef USE_FFMPEG if( m_iStreamHandler == FFMPEG ) { @@ -533,7 +533,6 @@ Void PlaYUVerStream::getDuration( Int* duration_array ) else #endif if( m_iStreamHandler == YUV_IO ) - { secs = m_uiTotalFrameNum / m_dFrameRate; } From 9c00812f03cf30235a2bfae54c6a9bfc2a1175be Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 21 Nov 2015 00:19:45 +0000 Subject: [PATCH 04/11] Add wait before re-run a module thread --- app/PlaYUVerAppModuleIf.cpp | 3 +++ app/PlaYUVerAppModuleIf.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/PlaYUVerAppModuleIf.cpp b/app/PlaYUVerAppModuleIf.cpp index 600900b..e71b17d 100644 --- a/app/PlaYUVerAppModuleIf.cpp +++ b/app/PlaYUVerAppModuleIf.cpp @@ -71,7 +71,10 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads ) { #ifdef PLAYUVER_THREADED_MODULES if( !disableThreads ) + { + wait(); start(); + } else #endif { diff --git a/app/PlaYUVerAppModuleIf.h b/app/PlaYUVerAppModuleIf.h index 817055b..3bfb424 100644 --- a/app/PlaYUVerAppModuleIf.h +++ b/app/PlaYUVerAppModuleIf.h @@ -40,7 +40,7 @@ class QAction; namespace plaYUVer { -//#define PLAYUVER_THREADED_MODULES +#define PLAYUVER_THREADED_MODULES class VideoSubWindow; From 766c4061466c780e5d88efcb225948a7df734fdf Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 24 Nov 2015 22:33:16 +0000 Subject: [PATCH 05/11] Fix code to work on Qt4 --- app/PlaYUVerSubWindowHandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/PlaYUVerSubWindowHandle.cpp index 530443a..b2e1248 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/PlaYUVerSubWindowHandle.cpp @@ -44,7 +44,7 @@ public: { m_acLogMessages.push_front( msg ); if( m_acLogMessages.size() > 5 ) - m_acLogMessages.removeLast(); + m_acLogMessages.remove( m_acLogMessages.size() - 1 ); update(); } protected: From 7997a5d1b8aa226b197b37f2f72f2e4543470176 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 28 Nov 2015 15:45:30 +0000 Subject: [PATCH 06/11] Enable QtDbus by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94f5ce9..cb0baee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ OPTION( USE_FERVOR "Add Fervor support" OFF ) OPTION( USE_WERROR "Warnings as errors" OFF ) OPTION( USE_STATIC "Use static libs" ON ) OPTION( USE_QT4 "Build with Qt4" OFF ) -OPTION( USE_QTDBUS "Build with QtDBus" OFF ) +OPTION( USE_QTDBUS "Build with QtDBus" ON ) OPTION( USE_DYNLOAD "Use dynamic load of modules" ON ) # To be switched on when releasing. OPTION(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON) From 0dcb528c0928a2a2b17c42688e32d68cbc7373a7 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 3 Dec 2015 16:27:27 +0000 Subject: [PATCH 07/11] Add H.264 and HEVC formats --- lib/LibAvContextHandle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/LibAvContextHandle.cpp b/lib/LibAvContextHandle.cpp index 9d44b2b..cc6c53a 100644 --- a/lib/LibAvContextHandle.cpp +++ b/lib/LibAvContextHandle.cpp @@ -35,7 +35,7 @@ namespace plaYUVer std::vector LibAvContextHandle::supportedReadFormats() { INI_REGIST_PLAYUVER_SUPPORTED_FMT; - REGIST_PLAYUVER_SUPPORTED_FMT( "Portable Grayscale Map ", "pgm" ); + REGIST_PLAYUVER_SUPPORTED_FMT( "Portable Grayscale Map", "pgm" ); REGIST_PLAYUVER_SUPPORTED_FMT( "Portable Network Graphics", "png" ); REGIST_PLAYUVER_SUPPORTED_FMT( "Joint Photographic Experts Group", "jpg" ); REGIST_PLAYUVER_SUPPORTED_FMT( "Windows Bitmap", "bmp" ); @@ -43,6 +43,8 @@ std::vector LibAvContextHandle::supportedReadFormats() REGIST_PLAYUVER_SUPPORTED_FMT( "Windows media video", "wmv" ); REGIST_PLAYUVER_SUPPORTED_FMT( "MPEG4", "mp4" ); REGIST_PLAYUVER_SUPPORTED_FMT( "Matroska Multimedia Container", "mkv" ); + REGIST_PLAYUVER_SUPPORTED_FMT( "H.264 streams", "h264" ); + REGIST_PLAYUVER_SUPPORTED_FMT( "HEVC streams", "hevc" ); END_REGIST_PLAYUVER_SUPPORTED_FMT; } From 51db6fd73924392478f83deae842d46d7eafdc88 Mon Sep 17 00:00:00 2001 From: Luis Lucas Date: Sun, 17 Jan 2016 01:07:52 +0000 Subject: [PATCH 08/11] Fix FrameShift module. --- modules/FrameShift.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/modules/FrameShift.cpp b/modules/FrameShift.cpp index 35b6ef1..9ef7bda 100644 --- a/modules/FrameShift.cpp +++ b/modules/FrameShift.cpp @@ -43,7 +43,8 @@ FrameShift::FrameShift() ( "ShiftVertical", m_iShiftVer, "Amount of pixels to shift in vertical direction" ); m_pcProcessedFrame = NULL; - m_iShiftHor = 10; + m_iShiftHor = 0; + m_iShiftVer = 0; } Bool FrameShift::create( std::vector apcFrameList ) @@ -52,6 +53,7 @@ Bool FrameShift::create( std::vector apcFrameList ) m_pcProcessedFrame = new PlaYUVerFrame( apcFrameList[0], false ); m_iShiftHor = ( ( m_iShiftHor + 1 ) >> 1 ) << 1; + m_iShiftVer = ( ( m_iShiftVer + 1 ) >> 1 ) << 1; return true; } @@ -64,11 +66,15 @@ PlaYUVerFrame* FrameShift::process( std::vector apcFrameList ) UInt xStartIn = m_iShiftHor >= 0 ? 0 : -m_iShiftHor; UInt xEndOut = m_iShiftHor >= 0 ? m_pcProcessedFrame->getWidth() : m_pcProcessedFrame->getWidth() + m_iShiftHor; + UInt yStartOut = m_iShiftVer >= 0 ? m_iShiftVer : 0; + UInt yStartIn = m_iShiftVer >= 0 ? 0 : -m_iShiftVer; + UInt yEndOut = m_iShiftVer >= 0 ? m_pcProcessedFrame->getHeight() : m_pcProcessedFrame->getHeight() + m_iShiftVer; + m_pcProcessedFrame->clear(); - for( UInt y = 0; y < m_pcProcessedFrame->getHeight(); y++ ) + for( UInt y = yStartOut, yIn = yStartIn; y < yEndOut; y++, yIn++ ) { - pPelInput = &( apcFrameList[0]->getPelBufferYUV()[LUMA][y][xStartIn] ); + pPelInput = &( apcFrameList[0]->getPelBufferYUV()[LUMA][yIn][xStartIn] ); pPelOut = &( m_pcProcessedFrame->getPelBufferYUV()[LUMA][y][xStartOut] ); for( UInt x = xStartOut; x < xEndOut; x++ ) { @@ -83,11 +89,17 @@ PlaYUVerFrame* FrameShift::process( std::vector apcFrameList ) xStartIn = iShiftHorChroma >= 0 ? 0 : -iShiftHorChroma; xEndOut = iShiftHorChroma >= 0 ? m_pcProcessedFrame->getChromaWidth() : m_pcProcessedFrame->getChromaWidth() + iShiftHorChroma; + Int iShiftVerChroma = CHROMASHIFT( m_iShiftVer, m_pcProcessedFrame->getChromaHeightRatio() ); + yStartOut = iShiftVerChroma >= 0 ? iShiftVerChroma : 0; + yStartIn = iShiftVerChroma >= 0 ? 0 : -iShiftVerChroma; + yEndOut = iShiftVerChroma >= 0 ? m_pcProcessedFrame->getChromaHeight() : m_pcProcessedFrame->getChromaHeight() + iShiftVerChroma; + + for( UInt c = 1; c < m_pcProcessedFrame->getNumberChannels(); c++ ) { - for( UInt y = 0; y < m_pcProcessedFrame->getChromaHeight(); y++ ) + for( UInt y = yStartOut, yIn = yStartIn; y < yEndOut; y++, yIn++ ) { - pPelInput = &( apcFrameList[0]->getPelBufferYUV()[c][y][xStartIn] ); + pPelInput = &( apcFrameList[0]->getPelBufferYUV()[c][yIn][xStartIn] ); pPelOut = &( m_pcProcessedFrame->getPelBufferYUV()[c][y][xStartOut] ); for( UInt x = xStartOut; x < xEndOut; x++ ) { @@ -112,6 +124,16 @@ Bool FrameShift::keyPressed( enum Module_Key_Supported value ) m_iShiftHor += 2; return true; } + if( value == MODULE_KEY_DOWN ) + { + m_iShiftVer -= 2; + return true; + } + if( value == MODULE_KEY_UP ) + { + m_iShiftVer += 2; + return true; + } return false; } From a6db350c586f4518cc6ebea6f4d606ae371f2df1 Mon Sep 17 00:00:00 2001 From: Luis Lucas Date: Sun, 17 Jan 2016 01:13:44 +0000 Subject: [PATCH 09/11] Fix keypress on FrameShift module and allow 1 pixel shift. --- modules/FrameShift.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/FrameShift.cpp b/modules/FrameShift.cpp index 9ef7bda..7c26967 100644 --- a/modules/FrameShift.cpp +++ b/modules/FrameShift.cpp @@ -52,8 +52,8 @@ Bool FrameShift::create( std::vector apcFrameList ) _BASIC_MODULE_API_2_CHECK_ m_pcProcessedFrame = new PlaYUVerFrame( apcFrameList[0], false ); - m_iShiftHor = ( ( m_iShiftHor + 1 ) >> 1 ) << 1; - m_iShiftVer = ( ( m_iShiftVer + 1 ) >> 1 ) << 1; +// m_iShiftHor = ( ( m_iShiftHor + 1 ) >> 1 ) << 1; +// m_iShiftVer = ( ( m_iShiftVer + 1 ) >> 1 ) << 1; return true; } @@ -116,22 +116,22 @@ Bool FrameShift::keyPressed( enum Module_Key_Supported value ) { if( value == MODULE_KEY_LEFT ) { - m_iShiftHor -= 2; + m_iShiftHor -= 1; return true; } if( value == MODULE_KEY_RIGHT ) { - m_iShiftHor += 2; - return true; - } - if( value == MODULE_KEY_DOWN ) - { - m_iShiftVer -= 2; + m_iShiftHor += 1; return true; } if( value == MODULE_KEY_UP ) { - m_iShiftVer += 2; + m_iShiftVer -= 1; + return true; + } + if( value == MODULE_KEY_DOWN ) + { + m_iShiftVer += 1; return true; } return false; From 717894f84a803a9cab36a4144cbb27894fee6bba Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 4 Feb 2016 16:19:42 +0000 Subject: [PATCH 10/11] Add support for more than 8 bits per pixel in ffmpeg --- lib/LibAvContextHandle.cpp | 15 ++++++++++++++- lib/LibAvContextHandle.h | 2 +- lib/PlaYUVerStream.cpp | 14 +++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/LibAvContextHandle.cpp b/lib/LibAvContextHandle.cpp index cc6c53a..f941cf4 100644 --- a/lib/LibAvContextHandle.cpp +++ b/lib/LibAvContextHandle.cpp @@ -112,7 +112,8 @@ Void LibAvContextHandle::closeAvFormat() m_bHasStream = false; } -Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, Double& frame_rate, UInt64& num_frames ) +Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, UInt& bits_pel, Double& frame_rate, + UInt64& num_frames ) { fmt_ctx = NULL; video_dec_ctx = NULL; @@ -211,6 +212,13 @@ Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& num_frames = num_frames == 0 ? 1 : num_frames; Int pix_fmt = video_dec_ctx->pix_fmt; + + // Set bits per pixel to default (8 bits) + bits_pel = 8; + + /** + * Auxiliar conversation to re-use similar pixfmt + */ switch( pix_fmt ) { case AV_PIX_FMT_YUVJ420P: @@ -222,6 +230,11 @@ Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& case AV_PIX_FMT_YUVJ444P: pix_fmt = AV_PIX_FMT_YUV444P; break; + case AV_PIX_FMT_GRAY16LE: + case AV_PIX_FMT_GRAY16BE: + bits_pel = 16; + pix_fmt = AV_PIX_FMT_GRAY8; + break; } width = video_dec_ctx->width; diff --git a/lib/LibAvContextHandle.h b/lib/LibAvContextHandle.h index 5a5506e..646c6a6 100644 --- a/lib/LibAvContextHandle.h +++ b/lib/LibAvContextHandle.h @@ -65,7 +65,7 @@ public: m_bHasStream( false ) { } - Bool initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, Double& frame_rate, UInt64& num_frames ); + Bool initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, UInt& bits_pel, Double& frame_rate, UInt64& num_frames ); Void closeAvFormat(); Bool decodeAvFormat(); diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index ece9d00..cb443fb 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -142,11 +142,11 @@ Void PlaYUVerStream::findHandler() { m_iStreamHandler = INVALID_HANDLER; - if( m_uiBitsPerPixel != 8 ) - { - m_iStreamHandler = YUV_IO; - return; - } +// if( m_uiBitsPerPixel != 8 ) +// { +// m_iStreamHandler = YUV_IO; +// return; +// } std::string currExt = m_cFilename.substr( m_cFilename.find_last_of( "." ) + 1 ); currExt = lowercase( currExt ); @@ -246,7 +246,7 @@ Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int in #ifdef USE_FFMPEG if( m_iStreamHandler == FFMPEG ) { - if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_dFrameRate, m_uiTotalFrameNum ) ) + if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiBitsPerPixel, m_dFrameRate, m_uiTotalFrameNum ) ) { throw "Cannot open file using FFmpeg libs"; } @@ -369,7 +369,7 @@ Bool PlaYUVerStream::reload() if( m_iStreamHandler == FFMPEG ) { m_cLibAvContext->closeAvFormat(); - if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_dFrameRate, m_uiTotalFrameNum ) ) + if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiBitsPerPixel, m_dFrameRate, m_uiTotalFrameNum ) ) { throw "Cannot open file using FFmpeg libs"; } From 2cd1c7f269fb3a79b85bc5d93bbbc86ff96f4eff Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 4 Feb 2016 16:25:45 +0000 Subject: [PATCH 11/11] Minor bugfix in the window title after disabling module --- app/VideoSubWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index d6aab36..771b9e5 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -579,6 +579,7 @@ Void VideoSubWindow::disableModule( PlaYUVerAppModuleIf* pcModule ) pcModule = m_pcCurrentDisplayModule; m_pcCurrentDisplayModule = 0; ModulesHandle::destroyModuleIf( pcModule ); + setWindowName( QFileInfo( m_cFilename ).fileName() ); bRefresh |= true; } }