1 /***************************************************************************
2 * Copyright (C) 2010 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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. *
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. *
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 ***************************************************************************/
20 #ifndef __CAPTUREHANDLER_H__
21 #define __CAPTUREHANDLER_H__
27 class CaptureHandler : public QObject
31 explicit CaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
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);
48 QVBoxLayout *m_layout;
53 void gotTimeCode(ulong);
54 void gotMessage(const QString &);
55 void frameSaved(const QString &);
56 void gotFrame(QImage);