aboutsummaryrefslogtreecommitdiffstats
path: root/utils/qv4l2/capture-win-qt.h
blob: 15fca67ddb444ea0dd560c4277443ba9d7d23819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* qv4l2: a control panel controlling v4l2 devices.
 *
 * Copyright (C) 2006 Hans Verkuil <hverkuil@xs4all.nl>
 *
 * 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 CAPTURE_WIN_QT_H
#define CAPTURE_WIN_QT_H

#include "qv4l2.h"
#include "capture-win.h"

#include <QLabel>
#include <QImage>
#include <QResizeEvent>

class CaptureWinQt : public CaptureWin
{
public:
	CaptureWinQt(ApplicationWindow *aw);
	~CaptureWinQt();

	void stop();
	bool hasNativeFormat(__u32 format);
	static bool isSupported() { return true; }
	void setColorspace(unsigned colorspace, unsigned xfer_func,
			unsigned ycbcr_enc, unsigned quantization, bool is_sdtv) {}
	void setField(unsigned field) {}
	void setBlending(bool enable) {}
	void setLinearFilter(bool enable) {}

protected:
	void resizeEvent(QResizeEvent *event);
	void setRenderFrame();

private:
	bool findNativeFormat(__u32 format, QImage::Format &dstFmt);
	void paintFrame();

	QImage *m_image;
	unsigned char *m_data;
	QLabel *m_videoSurface;
	bool m_supportedFormat;
	bool m_filled;
	int m_cropBytes;
	int m_cropOffset;
};
#endif

Privacy Policy