VideoClipWorkflow.h 2.63 KB
Newer Older
1 2 3
/*****************************************************************************
 * VideoClipWorkflow.h : Clip workflow. Will extract a single frame from a VLCMedia
 *****************************************************************************
4
 * Copyright (C) 2008-2014 VideoLAN
5
 *
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
6
 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *
 * 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 VIDEOCLIPWORKFLOW_H
#define VIDEOCLIPWORKFLOW_H

#include "ClipWorkflow.h"
27
#include "EffectsEngine/EffectsEngine.h"
28

29
#include <QQueue>
30

31 32
class   Clip;

33 34
class   VideoClipWorkflow : public ClipWorkflow
{
35 36
    Q_OBJECT

37
    public:
38
        VideoClipWorkflow( ClipHelper* ch );
39
        ~VideoClipWorkflow();
40
        virtual Workflow::OutputBuffer  *getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame );
41

42
        static const quint32    nbBuffers = 3 * 30; //3 seconds with an average fps of 30
43

44
    protected:
45
        virtual void            initializeInternals();
46 47
        virtual quint32         getNbComputedBuffers() const;
        virtual quint32         getMaxComputedBuffers() const;
48
        virtual void            flushComputedBuffers();
49 50
        /**
         *  \brief              Pre-allocate some image buffers.
51 52 53
         *
         *  This also computes m_width and m_height variables.
         *  This HAS to be called before createSoutChain()
54
         */
55
        virtual void            preallocate();
56
        virtual void            releasePrealocated();
57

58
    private:
59 60
        QQueue<Workflow::Frame*>    m_computedBuffers;
        QQueue<Workflow::Frame*>    m_availableBuffers;
61 62 63
        static void                 lock( void* data, uint8_t** pp_ret, size_t size );
        static void                 unlock(void *data, uint8_t* buffer, int width,
                                           int height, int bpp, size_t size, int64_t pts );
64
        Workflow::Frame             *m_lastReturnedBuffer;
65 66 67
};

#endif // VIDEOCLIPWORKFLOW_H