| 1 |
/* qv4l2: a control panel controlling v4l2 devices. |
| 2 |
* |
| 3 |
* Copyright (C) 2006 Hans Verkuil <[email protected]> |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU General Public License |
| 7 |
* as published by the Free Software Foundation; either version 2 |
| 8 |
* of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef CAPTURE_WIN_QT_H |
| 21 |
#define CAPTURE_WIN_QT_H |
| 22 |
|
| 23 |
#include "qv4l2.h" |
| 24 |
#include "capture-win.h" |
| 25 |
|
| 26 |
#include <QLabel> |
| 27 |
#include <QImage> |
| 28 |
#include <QResizeEvent> |
| 29 |
|
| 30 |
class CaptureWinQt : public CaptureWin |
| 31 |
{ |
| 32 |
public: |
| 33 |
CaptureWinQt(ApplicationWindow *aw); |
| 34 |
~CaptureWinQt(); |
| 35 |
|
| 36 |
void stop(); |
| 37 |
bool hasNativeFormat(__u32 format); |
| 38 |
static bool isSupported() { return true; } |
| 39 |
void setColorspace(unsigned colorspace, unsigned xfer_func, |
| 40 |
unsigned ycbcr_enc, unsigned quantization, bool is_sdtv) {} |
| 41 |
void setField(unsigned field) {} |
| 42 |
void setBlending(bool enable) {} |
| 43 |
void setLinearFilter(bool enable) {} |
| 44 |
|
| 45 |
protected: |
| 46 |
void resizeEvent(QResizeEvent *event); |
| 47 |
void setRenderFrame(); |
| 48 |
|
| 49 |
private: |
| 50 |
bool findNativeFormat(__u32 format, QImage::Format &dstFmt); |
| 51 |
void paintFrame(); |
| 52 |
|
| 53 |
QImage *m_image; |
| 54 |
unsigned char *m_data; |
| 55 |
QLabel *m_videoSurface; |
| 56 |
bool m_supportedFormat; |
| 57 |
bool m_filled; |
| 58 |
int m_cropBytes; |
| 59 |
int m_cropOffset; |
| 60 |
}; |
| 61 |
#endif |