|
|
@@ -20,7 +20,7 @@
|
|
|
#include <linux/videodev.h>
|
|
|
#include <linux/videodev2.h>
|
|
|
|
|
|
-#ifdef HAVE_JPEG
|
|
|
+#ifdef SUPPORT_WEBCAM_VIDEO_JPEG
|
|
|
extern "C" {
|
|
|
#include <jpeglib.h>
|
|
|
#include <jpegint.h>
|
|
|
@@ -59,7 +59,7 @@ INLINE static void yuyv_to_rgbargba(unsigned char *dest, const unsigned char *sr
|
|
|
dest[7] = (unsigned char) -1;
|
|
|
}
|
|
|
|
|
|
-#if defined(HAVE_JPEG) && !defined(CPPPARSER)
|
|
|
+#if defined(SUPPORT_WEBCAM_VIDEO_JPEG) && !defined(CPPPARSER)
|
|
|
|
|
|
struct my_error_mgr {
|
|
|
struct jpeg_error_mgr pub;
|
|
|
@@ -151,7 +151,7 @@ WebcamVideoCursorV4L(WebcamVideoV4L *src) : MovieVideoCursor(src) {
|
|
|
_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
|
|
pvector<uint32_t>::iterator it;
|
|
|
for (it = src->_pformats.begin(); it != src->_pformats.end(); ++it) {
|
|
|
-#ifdef HAVE_JPEG
|
|
|
+#ifdef SUPPORT_WEBCAM_VIDEO_JPEG
|
|
|
if (*it == V4L2_PIX_FMT_MJPEG) {
|
|
|
_format->fmt.pix.pixelformat = *it;
|
|
|
break;
|
|
|
@@ -238,7 +238,7 @@ WebcamVideoCursorV4L(WebcamVideoV4L *src) : MovieVideoCursor(src) {
|
|
|
vision_cat.error() << "Failed to stream from buffer!\n";
|
|
|
}
|
|
|
|
|
|
-#ifdef HAVE_JPEG
|
|
|
+#ifdef SUPPORT_WEBCAM_VIDEO_JPEG
|
|
|
// Initialize the JPEG library, if necessary
|
|
|
if (_format->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG) {
|
|
|
_cinfo = (struct jpeg_decompress_struct *) malloc(sizeof(struct jpeg_decompress_struct));
|
|
|
@@ -265,7 +265,7 @@ WebcamVideoCursorV4L(WebcamVideoV4L *src) : MovieVideoCursor(src) {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
WebcamVideoCursorV4L::
|
|
|
~WebcamVideoCursorV4L() {
|
|
|
-#ifdef HAVE_JPEG
|
|
|
+#ifdef SUPPORT_WEBCAM_VIDEO_JPEG
|
|
|
if (_cinfo != NULL) {
|
|
|
jpeg_destroy_decompress(_cinfo);
|
|
|
free(_cinfo);
|
|
|
@@ -316,7 +316,7 @@ fetch_into_buffer(double time, unsigned char *block, bool bgra) {
|
|
|
unsigned char *buf = (unsigned char *) _buffers[vbuf.index];
|
|
|
|
|
|
if (_format->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG) {
|
|
|
-#ifdef HAVE_JPEG
|
|
|
+#ifdef SUPPORT_WEBCAM_VIDEO_JPEG
|
|
|
nassertv(!bgra);
|
|
|
struct my_error_mgr jerr;
|
|
|
_cinfo->err = jpeg_std_error(&jerr.pub);
|