[vlmc-devel] RenderTarget: File

Yikai Lu git at videolan.org
Sun Apr 17 09:20:14 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Fri Apr 15 21:28:27 2016 +0900| [083fc3091b658f1fc975415c62a77e6950779b12] | committer: Hugo Beauzée-Luyssen

RenderTarget: File

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/083fc3091b658f1fc975415c62a77e6950779b12
---

 src/Backend/Target/FileTarget.cpp | 21 +++++++++++++++++++++
 src/Backend/Target/FileTarget.h   | 19 +++++++++++++++++++
 src/CMakeLists.txt                |  1 +
 3 files changed, 41 insertions(+)

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..6d26a28
--- /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 );
+        ~FileTarget();
+        virtual void configure( ISourceRenderer *renderer ) override;
+    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



More information about the Vlmc-devel mailing list