[vlmc-devel] [PATCH 5/5] RenderTarget: File

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Apr 15 12:44:48 CEST 2016


On 04/14/2016 10:50 AM, Yikai Lu wrote:
> ---
>   src/Backend/Target/FileTarget.cpp | 21 +++++++++++++++++++++
>   src/Backend/Target/FileTarget.h   | 19 +++++++++++++++++++
>   src/CMakeLists.txt                |  1 +
>   3 files changed, 41 insertions(+)
>   create mode 100644 src/Backend/Target/FileTarget.cpp
>   create mode 100644 src/Backend/Target/FileTarget.h
>
> diff --git a/src/Backend/Target/FileTarget.cpp b/src/Backend/Target/FileTarget.cpp
> new file mode 100644
> index 0000000..1ed1ea6
> --- /dev/null
> +++ b/src/Backend/Target/FileTarget.cpp
> @@ -0,0 +1,21 @@
> +#include "FileTarget.h"
> +
> +#include "Backend/ISourceRenderer.h"
> +
> +using namespace Backend;
> +
> +FileTarget::FileTarget( const char* filePath )
> +    : m_filePath( filePath )
> +{
> +}
> +
> +FileTarget::~FileTarget()
> +{
> +    delete m_filePath;
> +}
> +
> +void
> +FileTarget::configure( Backend::ISourceRenderer *renderer )
> +{
> +    renderer->setOutputFile( m_filePath );
> +}
> diff --git a/src/Backend/Target/FileTarget.h b/src/Backend/Target/FileTarget.h
> new file mode 100644
> index 0000000..9a4266c
> --- /dev/null
> +++ b/src/Backend/Target/FileTarget.h
> @@ -0,0 +1,19 @@
> +#ifndef FILETARGET_H
> +#define FILETARGET_H
> +
> +#include "Backend/IRenderTarget.h"
> +
> +namespace Backend
> +{
> +    class FileTarget : public IRenderTarget
> +    {
> +    public:
> +        FileTarget( const char* filePath );

Any specific reason you use a const char* instead of a std::string/QString ?

> +        ~FileTarget();
> +        virtual void configure( ISourceRenderer *renderer );
> +    private:
> +        const char* m_filePath;
> +    };
> +}
> +
> +#endif // FILETARGET_H
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index 4c59e63..a7cee9c 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -47,6 +47,7 @@ SET(VLMC_SRCS
>       Backend/VLC/VLCSource.cpp
>       Backend/VLC/VLCMemorySource.cpp
>       Backend/Target/WidgetTarget.cpp
> +    Backend/Target/FileTarget.cpp
>       EffectsEngine/EffectsEngine.cpp
>       EffectsEngine/Effect.cpp
>       EffectsEngine/EffectUser.cpp
>

LGTM otherwise, thanks!


More information about the Vlmc-devel mailing list