From bf686359ddbcbdc984fab9d42cd2cc1fa870c4d6 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 13 Jan 2015 22:36:47 +0000 Subject: [PATCH 1/2] Fix problems with modules --- modules/FilterComponent.cpp | 8 ++++---- modules/FilterComponent.h | 17 ++++++++++------- modules/PlaYUVerModuleIf.h | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/FilterComponent.cpp b/modules/FilterComponent.cpp index 4030fa8..8340384 100644 --- a/modules/FilterComponent.cpp +++ b/modules/FilterComponent.cpp @@ -28,18 +28,18 @@ namespace plaYUVer { -FilterComponent::FilterComponent() +FilterComponentModule::FilterComponentModule() { m_pcFilteredFrame = NULL; } -Void FilterComponent::createFilter( UInt uiWidth, UInt uiHeight ) +Void FilterComponentModule::createFilter( UInt uiWidth, UInt uiHeight ) { m_pcFilteredFrame = NULL; m_pcFilteredFrame = new PlaYUVerFrame( uiWidth, uiHeight, PlaYUVerFrame::GRAY ); } -PlaYUVerFrame* FilterComponent::filterComponent( PlaYUVerFrame* InputFrame, Int Component ) +PlaYUVerFrame* FilterComponentModule::filterComponent( PlaYUVerFrame* InputFrame, Int Component ) { Pel*** pppOutputPelYUV = m_pcFilteredFrame->getPelBufferYUV(); Pel*** pppInputPelYUV = InputFrame->getPelBufferYUV(); @@ -47,7 +47,7 @@ PlaYUVerFrame* FilterComponent::filterComponent( PlaYUVerFrame* InputFrame, Int return m_pcFilteredFrame; } -Void FilterComponent::destroy() +Void FilterComponentModule::destroy() { if( m_pcFilteredFrame ) delete m_pcFilteredFrame; diff --git a/modules/FilterComponent.h b/modules/FilterComponent.h index b8182c3..cc625ed 100644 --- a/modules/FilterComponent.h +++ b/modules/FilterComponent.h @@ -30,21 +30,24 @@ namespace plaYUVer { -class FilterComponent +class FilterComponentModule: public PlaYUVerModuleIf { private: PlaYUVerFrame* m_pcFilteredFrame; public: - FilterComponent(); - virtual ~FilterComponent() + FilterComponentModule(); + virtual ~FilterComponentModule() { } + Void create( PlaYUVerFrame* ) = 0; + PlaYUVerFrame* process( PlaYUVerFrame* ) = 0; + Void destroy(); + Void createFilter( UInt uiWidth, UInt uiHeight ); PlaYUVerFrame* filterComponent( PlaYUVerFrame* InputFrame, Int Component ); - Void destroy(); }; -class FilterComponentLuma: public FilterComponent, public PlaYUVerModuleIf +class FilterComponentLuma: public FilterComponentModule { REGISTER_CLASS_FACTORY( FilterComponentLuma ) public: @@ -56,7 +59,7 @@ public: PlaYUVerFrame* process( PlaYUVerFrame* InputFrame ); }; -class FilterComponentChromaU: public FilterComponent, public PlaYUVerModuleIf +class FilterComponentChromaU: public FilterComponentModule { REGISTER_CLASS_FACTORY( FilterComponentChromaU ) public: @@ -68,7 +71,7 @@ public: PlaYUVerFrame* process( PlaYUVerFrame* InputFrame ); }; -class FilterComponentChromaV: public FilterComponent, public PlaYUVerModuleIf +class FilterComponentChromaV: public FilterComponentModule { REGISTER_CLASS_FACTORY( FilterComponentChromaV ) public: diff --git a/modules/PlaYUVerModuleIf.h b/modules/PlaYUVerModuleIf.h index ddc2722..fdf732d 100644 --- a/modules/PlaYUVerModuleIf.h +++ b/modules/PlaYUVerModuleIf.h @@ -100,7 +100,7 @@ public: virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; } virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; } - virtual Void destroy() { } + virtual Void destroy() = 0; }; From 789d0f29eb219f2f89a5512d73789ab0b99505a9 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 13 Jan 2015 22:54:13 +0000 Subject: [PATCH 2/2] Minor changes in filenames --- app/CMakeLists.txt | 23 ++++++++++--------- ...Sidebar.cpp => FramePropertiesSidebar.cpp} | 21 +++++++---------- ...tiesSidebar.h => FramePropertiesSidebar.h} | 8 +++---- app/VideoHandle.h | 2 +- app/plaYUVerApp.h | 1 - lib/PlaYUVerFrameStats.cpp | 2 +- lib/PlaYUVerStream.cpp | 1 + 7 files changed, 27 insertions(+), 31 deletions(-) rename app/{PropertiesSidebar.cpp => FramePropertiesSidebar.cpp} (98%) rename app/{PropertiesSidebar.h => FramePropertiesSidebar.h} (95%) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index e87fd12..c29aac2 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -9,24 +9,25 @@ set(plaYUver_App_SRCS # Main main.cpp plaYUVerApp.cpp - VideoHandle.cpp - QualityHandle.cpp - ModulesHandle.cpp - PlaYUVerAppModuleIf.cpp - GridManager.cpp - Settings.cpp -# Sub Window SubWindowHandle.cpp + Settings.cpp +# Module Video VideoSubWindow.cpp ViewArea.cpp + VideoHandle.cpp + FramePropertiesSidebar.cpp +# Module Quality + QualityHandle.cpp + QualityMeasurementSidebar.cpp +# Module Plugins + ModulesHandle.cpp + ModuleHandleDock.cpp + PlaYUVerAppModuleIf.cpp + GridManager.cpp # Dialogs AboutDialog.cpp ConfigureFormatDialog.cpp DialogSubWindowSelector.cpp -# Docks / Sidebars - ModuleHandleDock.cpp - PropertiesSidebar.cpp - QualityMeasurementSidebar.cpp # Widgets HistogramWidget.cpp WidgetFrameNumber.cpp diff --git a/app/PropertiesSidebar.cpp b/app/FramePropertiesSidebar.cpp similarity index 98% rename from app/PropertiesSidebar.cpp rename to app/FramePropertiesSidebar.cpp index 9b17a6f..f6b18b9 100644 --- a/app/PropertiesSidebar.cpp +++ b/app/FramePropertiesSidebar.cpp @@ -18,27 +18,18 @@ */ /** - * \file PropertiesSidebar.cpp + * \file FramePropertiesSideBar.cpp * \brief Main side bar definition */ #include #include #include -#include "PropertiesSidebar.h" +#include "FramePropertiesSidebar.h" namespace plaYUVer { -static inline QSize bestSize( QSize currSize ) -{ - QSize bestSize( 180, currSize.height() ); - if( currSize.width() < bestSize.width() ) - return bestSize; - else - return currSize; -} - FramePropertiesSideBar::FramePropertiesSideBar( QWidget* parent, Bool* pbMainPlaySwitch ) : QWidget( parent ), pbMainPlaySwitch( pbMainPlaySwitch ) @@ -262,7 +253,11 @@ FramePropertiesSideBar::~FramePropertiesSideBar() QSize FramePropertiesSideBar::sizeHint() const { - return bestSize( size() ); + QSize currSize = size(); + QSize bestSize( 180, currSize.height() ); + if( currSize.width() < bestSize.width() ) + return bestSize; + return currSize; } Void FramePropertiesSideBar::setData( PlaYUVerFrame* pcFrame, Bool isPlaying ) @@ -392,7 +387,7 @@ Void FramePropertiesSideBar::updateDataHistogram() // image is the same in Image Viewer, then compute too the histogram // for this selection. // New frame required to separate from the thread - histogramWidget->updateData( new PlaYUVerFrame(m_pcFrame), NULL ); + histogramWidget->updateData( m_pcFrame, NULL ); fullImageButton->hide(); selectionImageButton->hide(); } diff --git a/app/PropertiesSidebar.h b/app/FramePropertiesSidebar.h similarity index 95% rename from app/PropertiesSidebar.h rename to app/FramePropertiesSidebar.h index 1baf5ad..86e4969 100644 --- a/app/PropertiesSidebar.h +++ b/app/FramePropertiesSidebar.h @@ -18,12 +18,12 @@ */ /** - * \file PropertiesSidebar.h + * \file FramePropertiesSidebar.h * \brief Main side bar definition */ -#ifndef __PROPERTIESSIDEBAR_H__ -#define __PROPERTIESSIDEBAR_H__ +#ifndef __FRAMEPROPERTIESSIDEBAR_H__ +#define __FRAMEPROPERTIESSIDEBAR_H__ #include "config.h" #include "lib/PlaYUVerDefs.h" @@ -132,4 +132,4 @@ private Q_SLOTS: } // NAMESPACE -#endif // __PROPERTIESSIDEBAR_H__ +#endif // __FRAMEPROPERTIESSIDEBAR_H__ diff --git a/app/VideoHandle.h b/app/VideoHandle.h index edb3d90..b88bbc1 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -34,7 +34,7 @@ #endif #include "VideoSubWindow.h" #include "WidgetFrameNumber.h" -#include "PropertiesSidebar.h" +#include "FramePropertiesSidebar.h" namespace plaYUVer { diff --git a/app/plaYUVerApp.h b/app/plaYUVerApp.h index b02fa76..9160046 100644 --- a/app/plaYUVerApp.h +++ b/app/plaYUVerApp.h @@ -41,7 +41,6 @@ #include "VideoHandle.h" #include "QualityHandle.h" #include "ModulesHandle.h" -#include "PropertiesSidebar.h" #include "AboutDialog.h" #include "WidgetFrameNumber.h" diff --git a/lib/PlaYUVerFrameStats.cpp b/lib/PlaYUVerFrameStats.cpp index 44619f7..7822254 100644 --- a/lib/PlaYUVerFrameStats.cpp +++ b/lib/PlaYUVerFrameStats.cpp @@ -43,7 +43,7 @@ PlaYUVerFrameStats::PlaYUVerFrameStats() : PlaYUVerFrameStats::~PlaYUVerFrameStats() { if( m_pdHistogram ) - delete[] m_pdHistogram; + freeMem1D( m_pdHistogram ); } diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index ee743ff..7256f5a 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -254,6 +254,7 @@ Void PlaYUVerStream::close() #ifdef USE_FFMPEG if( m_uiStreamHandler == FFMPEG ) m_cLibAvContext->closeAvFormat(); + delete m_cLibAvContext; #endif if( m_ppcFrameBuffer )