WorkflowFileRenderer.h 2.75 KB
Newer Older
1 2 3
/*****************************************************************************
 * WorkflowFileRenderer.h: Output the workflow to a file
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
 *
 * 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

26
#include "config.h"
27
#include "Workflow/MainWorkflow.h"
28
#include "WorkflowRenderer.h"
29
#ifdef WITH_GUI
30
#include "WorkflowFileRendererDialog.h"
31
#endif
32

33
#include <QTime>
34

35
class   WorkflowFileRenderer : public WorkflowRenderer
36 37 38 39
{
    Q_OBJECT

public:
40
#ifdef WITH_GUI
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
41
    WorkflowFileRenderer();
42
    virtual ~WorkflowFileRenderer();
43
#endif
44

45 46 47 48 49 50 51
    void                        run(const QString& outputFileName, quint32 width,
                                    quint32 height, double fps, quint32 vbitrate,
                                    quint32 abitrate);
    static int                  lock( void* datas, qint64 *dts, qint64 *pts,
                                      quint32 *flags, size_t *bufferSize, void **buffer );
    static void                 unlock( void* datas, size_t size, void* buff );
    virtual float               getFps() const;
52 53

private:
54
#ifdef WITH_GUI
55
    QImage*                     m_image;
56
    QTime                       m_time;
57
#endif
58 59

protected:
60 61
    virtual void*               getLockCallback();
    virtual void*               getUnlockCallback();
62 63
    virtual quint32             width() const;
    virtual quint32             height() const;
64 65
private slots:
    void                        stop();
66 67 68
    void                        __frameChanged( qint64 frame,
                                                MainWorkflow::FrameChangedReason reason );
    void                        __endReached();
69 70 71

signals:
    void                        imageUpdated( const uchar* image );
72
    void                        frameChanged( qint64 );
73
    void                        renderComplete();
74 75 76
};

#endif // WORKFLOWFILERENDERER_H