[vlmc-devel] [PATCH 02/12] Remove WorkflowFileRenderer

Yikai Lu luyikei.qmltu at gmail.com
Wed Apr 6 09:58:15 CEST 2016


---
 src/CMakeLists.txt                    |   1 -
 src/Renderer/WorkflowFileRenderer.cpp | 103 ----------------------------------
 src/Renderer/WorkflowFileRenderer.h   |  67 ----------------------
 3 files changed, 171 deletions(-)
 delete mode 100644 src/Renderer/WorkflowFileRenderer.cpp
 delete mode 100644 src/Renderer/WorkflowFileRenderer.h

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 45927f2..4b34868 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -63,7 +63,6 @@ SET(VLMC_SRCS
     Project/RecentProjects.cpp
     Renderer/ClipRenderer.cpp
     Renderer/GenericRenderer.cpp
-    Renderer/WorkflowFileRenderer.cpp
     Renderer/WorkflowRenderer.cpp
     Services/AbstractSharingService.h
     Services/UploaderIODevice.cpp
diff --git a/src/Renderer/WorkflowFileRenderer.cpp b/src/Renderer/WorkflowFileRenderer.cpp
deleted file mode 100644
index dc883c5..0000000
--- a/src/Renderer/WorkflowFileRenderer.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*****************************************************************************
- * WorkflowFileRenderer.cpp: Output the workflow to a file
- *****************************************************************************
- * Copyright (C) 2008-2016 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "vlmc.h"
-#include "WorkflowFileRenderer.h"
-#include "Settings/Settings.h"
-
-#include <QTime>
-
-WorkflowFileRenderer::WorkflowFileRenderer( Backend::IBackend* backend, MainWorkflow* workflow )
-    : WorkflowRenderer( backend, workflow )
-    , m_renderVideoFrame( nullptr )
-{
-}
-
-void
-WorkflowFileRenderer::run( const QString& outputFileName, quint32 width,
-                            quint32 height, double fps, const QString& ar,
-                            quint32 vbitrate, quint32 abitrate )
-{
-    m_mainWorkflow->setCurrentFrame( 0, Vlmc::Renderer );
-
-    setupRenderer( width, height, fps, ar );
-    m_sourceRenderer->setOutputFile( qPrintable( outputFileName ) );
-    m_sourceRenderer->setOutputAudioBitrate( abitrate );
-    m_sourceRenderer->setOutputVideoBitrate( vbitrate );
-
-    connect( m_mainWorkflow, SIGNAL( mainWorkflowEndReached() ), this, SLOT( stop() ) );
-    connect( m_mainWorkflow, SIGNAL( frameChanged( qint64, Vlmc::FrameChangedReason ) ),
-             this, SLOT( __frameChanged( qint64,Vlmc::FrameChangedReason ) ) );
-    connect( this, SIGNAL( endReached() ), this, SIGNAL( renderComplete() ) );
-
-    m_isRendering = true;
-    m_stopping = false;
-    m_paused = false;
-    m_pts = 0;
-    m_audioPts = 0;
-
-    m_mainWorkflow->setFullSpeedRender( true );
-    m_mainWorkflow->startRender( width, height );
-    //Waiting for renderers to preload some frames:
-    SleepS( 1 );
-    m_sourceRenderer->start();
-}
-
-int
-WorkflowFileRenderer::lock( void *datas, const char* cookie, int64_t *dts, int64_t *pts,
-                            unsigned int *flags, size_t *bufferSize, const void **buffer )
-{
-    int         ret = WorkflowRenderer::lock( datas, cookie, dts, pts, flags, bufferSize, buffer );
-    EsHandler*  handler = reinterpret_cast<EsHandler*>( datas );
-    WorkflowFileRenderer* self = static_cast<WorkflowFileRenderer*>( handler->self );
-
-#ifdef WITH_GUI
-    if ( self->m_time.isValid() == false ||
-        self->m_time.elapsed() >= 1000 )
-    {
-        if ( self->m_renderVideoFrame == nullptr )
-            self->m_renderVideoFrame = new quint8[*bufferSize];
-        memcpy( self->m_renderVideoFrame, (uchar*)(*buffer), *bufferSize );
-        self->emit imageUpdated( self->m_renderVideoFrame );
-        self->m_time.restart();
-    }
-#endif
-    return ret;
-}
-
-void
-WorkflowFileRenderer::__frameChanged( qint64 frame, Vlmc::FrameChangedReason )
-{
-    emit frameChanged( frame );
-}
-
-Backend::ISourceRenderer::MemoryInputLockCallback
-WorkflowFileRenderer::getLockCallback()
-{
-    return &WorkflowFileRenderer::lock;
-}
-
-Backend::ISourceRenderer::MemoryInputUnlockCallback
-WorkflowFileRenderer::getUnlockCallback()
-{
-    return &WorkflowRenderer::unlock;
-}
diff --git a/src/Renderer/WorkflowFileRenderer.h b/src/Renderer/WorkflowFileRenderer.h
deleted file mode 100644
index 24e4ef0..0000000
--- a/src/Renderer/WorkflowFileRenderer.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*****************************************************************************
- * WorkflowFileRenderer.h: Output the workflow to a file
- *****************************************************************************
- * Copyright (C) 2008-2016 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef WORKFLOWFILERENDERER_H
-#define WORKFLOWFILERENDERER_H
-
-#include "config.h"
-#include "Backend/ISourceRenderer.h"
-#include "Workflow/MainWorkflow.h"
-#include "WorkflowRenderer.h"
-
-#include <QTime>
-
-class   WorkflowFileRenderer : public WorkflowRenderer
-{
-    Q_OBJECT
-
-public:
-    WorkflowFileRenderer( Backend::IBackend* backend , MainWorkflow* workflow );
-    virtual ~WorkflowFileRenderer() = default;
-
-    void                        run(const QString& outputFileName, quint32 width,
-                                    quint32 height, double fps, const QString& ar,
-                                    quint32 vbitrate, quint32 abitrate);
-    static int                  lock(void* datas, const char* cookie, int64_t *dts, int64_t *pts,
-                                      unsigned int *flags, size_t *bufferSize, const void **buffer );
-
-private:
-    quint8                      *m_renderVideoFrame;
-#ifdef WITH_GUI
-    QTime                       m_time;
-#endif
-
-protected:
-    virtual Backend::ISourceRenderer::MemoryInputLockCallback getLockCallback();
-    virtual Backend::ISourceRenderer::MemoryInputUnlockCallback getUnlockCallback();
-
-private slots:
-    void                        __frameChanged( qint64 frame,
-                                                Vlmc::FrameChangedReason reason );
-
-signals:
-    void                        imageUpdated( const uchar* image );
-    void                        frameChanged( qint64 );
-    void                        renderComplete();
-};
-
-#endif // WORKFLOWFILERENDERER_H
-- 
1.9.1



More information about the Vlmc-devel mailing list