]> git.sesse.net Git - kdenlive/blob - src/stopmotion/capturehandler.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / stopmotion / capturehandler.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #ifndef __CAPTUREHANDLER_H__
21 #define __CAPTUREHANDLER_H__
22
23 #include <QWidget>
24 #include <QObject>
25 #include <QLayout>
26
27 class CaptureHandler : public QObject
28 {
29     Q_OBJECT
30 public:
31     explicit CaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
32     ~CaptureHandler();
33     virtual void startPreview(int deviceId, int captureMode, bool audio = true) = 0;
34     virtual void stopPreview() = 0;
35     virtual void startCapture(const QString &path) = 0;
36     virtual void stopCapture();
37     virtual void captureFrame(const QString &fname) = 0;
38     virtual void showOverlay(QImage img, bool transparent = true) = 0;
39     virtual void hideOverlay() = 0;
40     virtual void hidePreview(bool hide) = 0;
41     virtual QStringList getDeviceName(QString input) = 0;
42     virtual void setDevice(const QString input, QString size = QString()) = 0;
43     void setAnalyse(bool isOn);
44     static void uyvy2rgb(unsigned char *yuv_buffer, unsigned char *rgb_buffer, int width, int height);
45     static void yuyv2rgb(unsigned char *yuv_buffer, unsigned char *rgb_buffer, int width, int height);
46
47 protected:
48     QVBoxLayout *m_layout;
49     QWidget *m_parent;
50     bool m_analyseFrame;
51
52 signals:
53     void gotTimeCode(ulong);
54     void gotMessage(const QString &);
55     void frameSaved(const QString &);
56     void gotFrame(QImage);
57 };
58
59
60 #endif