1515#include < grabber/VideoStandard.h>
1616#include < utils/Components.h>
1717
18- #ifdef HAVE_JPEG
18+ // general JPEG decoder includes
19+ #ifdef HAVE_JPEG_DECODER
1920 #include < QImage>
2021 #include < QColor>
22+ #endif
23+
24+ // System JPEG decoder
25+ #ifdef HAVE_JPEG
2126 #include < jpeglib.h>
2227 #include < csetjmp>
2328#endif
2429
30+ // TurboJPEG decoder
31+ #ifdef HAVE_TURBO_JPEG
32+ #include < turbojpeg.h>
33+ #endif
34+
2535// / Capture class for V4L2 devices
2636// /
2737// / @see http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html
@@ -31,6 +41,9 @@ class V4L2Grabber : public Grabber
3141
3242public:
3343 V4L2Grabber (const QString & device,
44+ const unsigned width,
45+ const unsigned height,
46+ const unsigned fps,
3447 VideoStandard videoStandard,
3548 PixelFormat pixelFormat,
3649 int pixelDecimation
@@ -46,11 +59,6 @@ class V4L2Grabber : public Grabber
4659
4760 int grabFrame (Image<ColorRgb> &);
4861
49- // /
50- // / @brief overwrite Grabber.h implementation, as v4l doesn't use width/height
51- // /
52- virtual void setWidthHeight (){};
53-
5462 // /
5563 // / @brief set new PixelDecimation value to ImageResampler
5664 // / @param pixelDecimation The new pixelDecimation value
@@ -84,6 +92,16 @@ class V4L2Grabber : public Grabber
8492 // /
8593 virtual void setDeviceVideoStandard (QString device, VideoStandard videoStandard);
8694
95+ // /
96+ // / @brief overwrite Grabber.h implementation
97+ // /
98+ virtual bool setFramerate (int fps);
99+
100+ // /
101+ // / @brief overwrite Grabber.h implementation
102+ // /
103+ virtual bool setWidthHeight (int width, int height);
104+
87105public slots:
88106
89107 bool start ();
@@ -173,6 +191,11 @@ private slots:
173191 errorManager* _error;
174192#endif
175193
194+ #ifdef HAVE_TURBO_JPEG
195+ tjhandle _decompress = nullptr ;
196+ int _subsamp;
197+ #endif
198+
176199private:
177200 QString _deviceName;
178201 std::map<QString,QString> _v4lDevices;
0 commit comments