entetes de cameraTool.h :
#ifndef CAMERATOOL_H
#define CAMERATOOL_H
#ifdef WIN32
#include <windows.h>
#include "../win32/dslibCamera.h"
#endif
#ifdef LINUX
#include <stdio.h>
#include <stdlib.h>
#include "../linux/linuxfwCamera.h"
#include "../linux/v4linuxCamera.h"
#endif
#ifdef __APPLE__
#include <stdio.h>
#include <stdlib.h>
#include "../macosx/macvdCamera.h"
#endif
#include <iostream>
la ligne 30 est celle ci :
#include "../linux/linuxfwCamera.h"
entêtes de cameraTool.cpp :
#include "cameraTool.h"
rien de grave ici, non ?
Par contre, les entêtes de linuxfwCamera.h :
#ifndef LINUXFWCAMERA_H
#define LINUXFWCAMERA_H
#include "../common/cameraEngine.h"
#include <string.h>
#include <libraw1394/raw1394.h>
#include <libdc1394/dc1394_control.h>
#include <math.h>
#include <unistd.h>
avec la ligne 26 :
#include <libdc1394/dc1394_control.h>
Ça rejoint ce que propose Chacual. J'ai déjà essayé cette piste, ça supprime la première erreur (sans que je sache si ça résout bien tout), mais ça bloque toujours sur la deuxième erreur. Voilà comment j'ai fait : je répète que je n'ai pas de répertoire /usr/include/libdc1394 (est-ce normal), j'ai juste le /usr/include/dc1394 avec le contenu suivant :
[blz@localhost linux]$ ls -l /usr/include/dc1394/
total 112
-rw-r--r-- 1 root root 8019 2008-01-15 04:18 camera.h
-rw-r--r-- 1 root root 3257 2008-01-15 04:18 capture.h
-rw-r--r-- 1 root root 14083 2008-01-15 04:18 control.h
-rw-r--r-- 1 root root 8817 2008-01-15 04:18 conversions.h
-rw-r--r-- 1 root root 1904 2008-01-15 04:18 dc1394.h
-rw-r--r-- 1 root root 7837 2008-01-15 04:18 format7.h
-rw-r--r-- 1 root root 6731 2008-01-15 04:18 iso.h
drwxr-xr-x 2 root root 4096 2008-01-20 00:38 juju
-rw-r--r-- 1 root root 11045 2008-01-04 09:21 log.h
-rw-r--r-- 1 root root 6450 2008-01-15 04:18 register.h
-rw-r--r-- 1 root root 5354 2008-01-15 04:18 types.h
-rw-r--r-- 1 root root 3443 2008-01-15 04:18 utils.h
drwxr-xr-x 2 root root 4096 2008-02-15 21:45 vendor
-rw-r--r-- 1 root root 10782 2008-01-15 04:18 video.h
[blz@localhost linux]$
Dans le ficier linuxfwCamera.h , j'ai donc remplacé la ligne 26 :
#include <libdc1394/dc1394_control.h>
par :
#include <dc1394/control.h>
Le make passe la première erreur mais plante toujours sur la seconde :
[blz@localhost linux]$ make
g++ -Wall -O3 -finline-functions -ffast-math -funroll-all-loops -fomit-frame-pointer -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I../ext/oscpack -I../ext/libfidtrack -I../ext/libdtouch -I../ext/ccvt -I../common -I../ext/portmidi/pm_common -I../ext/portmidi/porttime -I../ext/tinyxml -DLINUX -DOSC_HOST_LITTLE_ENDIAN -DNDEBUG -DPMALSA -c -o ../common/cameraTool.o ../common/cameraTool.cpp
../common/../linux/linuxfwCamera.h:47: error: 'dc1394_cameracapture' does not name a type
make: *** [../common/cameraTool.o] Error 1
[blz@localhost linux]$
Cette solution pour la première erreur est-elle valide ? Je me pose la question, d'autant plus que je n'arrive pas à me débarasser de la seconde erreur. J'ai un peu essayé mais je me perds vite.
Voilà le contenu du fichier linuxfwCamera.h avec la pour la première erreur :
#ifndef LINUXFWCAMERA_H
#define LINUXFWCAMERA_H
#include "../common/cameraEngine.h"
#include <string.h>
#include <libraw1394/raw1394.h>
#include <dc1394/control.h>
#include <math.h>
#include <unistd.h>
class linuxfwCamera : public cameraEngine
{
public:
linuxfwCamera(void);
~linuxfwCamera(void);
bool findCamera();
bool initCamera(int width, int height, bool colour);
bool startCamera();
unsigned char* getFrame();
bool stopCamera();
bool stillRunning();
bool resetCamera();
bool closeCamera();
void showSettingsDialog();
private:
dc1394_cameracapture camera;
int numNodes;
int numCameras;
raw1394handle_t handle;
nodeid_t * camera_nodes;
//dc1394_feature_set *features;
//dc1394_camerainfo *cameraInfo;
bool use_dma;
int image_mode_;
int frame_rate_;
};
#endif
La ligne du plantage (47) est :
dc1394_cameracapture camera;
que je comprends comme le nom d'une fonction "privée" dans la déclaration de la classe linuxfwCamera, mais je maitrise très peu les objets en C++, donc je ne sais pas s'il y a une faute grossière de syntaxe ou quelque chose qui manque dans cette ligne. Une idée ?
J'ai donc l'erreur :
error: 'dc1394_cameracapture' does not name a type
Encore une fois, je ne comprends pas tout ce qui se passe lors de compilations avec bibliothèques et dépendances, et je ne sais pas bien si le type "dc1394_cameracapture" est défini ou non, mal nommé ou autre...
Comme listé plus haut, il y a un fichier types.h dans /usr/include/dc1394; voici son contenu :
#ifndef __DC1394_TYPES_H__
#define __DC1394_TYPES_H__
/*! \file types.h
\brief Various types that must be defined here
More details soon
*/
#include <stdint.h>
/**
* Enumeration of video modes. Note that the notion of IIDC "format" is not present here, except in the format_7 name.
*/
typedef enum {
DC1394_VIDEO_MODE_160x120_YUV444= 64,
DC1394_VIDEO_MODE_320x240_YUV422,
DC1394_VIDEO_MODE_640x480_YUV411,
DC1394_VIDEO_MODE_640x480_YUV422,
DC1394_VIDEO_MODE_640x480_RGB8,
DC1394_VIDEO_MODE_640x480_MONO8,
DC1394_VIDEO_MODE_640x480_MONO16,
DC1394_VIDEO_MODE_800x600_YUV422,
DC1394_VIDEO_MODE_800x600_RGB8,
DC1394_VIDEO_MODE_800x600_MONO8,
DC1394_VIDEO_MODE_1024x768_YUV422,
DC1394_VIDEO_MODE_1024x768_RGB8,
DC1394_VIDEO_MODE_1024x768_MONO8,
DC1394_VIDEO_MODE_800x600_MONO16,
DC1394_VIDEO_MODE_1024x768_MONO16,
DC1394_VIDEO_MODE_1280x960_YUV422,
DC1394_VIDEO_MODE_1280x960_RGB8,
DC1394_VIDEO_MODE_1280x960_MONO8,
DC1394_VIDEO_MODE_1600x1200_YUV422,
DC1394_VIDEO_MODE_1600x1200_RGB8,
DC1394_VIDEO_MODE_1600x1200_MONO8,
DC1394_VIDEO_MODE_1280x960_MONO16,
DC1394_VIDEO_MODE_1600x1200_MONO16,
DC1394_VIDEO_MODE_EXIF,
DC1394_VIDEO_MODE_FORMAT7_0,
DC1394_VIDEO_MODE_FORMAT7_1,
DC1394_VIDEO_MODE_FORMAT7_2,
DC1394_VIDEO_MODE_FORMAT7_3,
DC1394_VIDEO_MODE_FORMAT7_4,
DC1394_VIDEO_MODE_FORMAT7_5,
DC1394_VIDEO_MODE_FORMAT7_6,
DC1394_VIDEO_MODE_FORMAT7_7
} dc1394video_mode_t;
#define DC1394_VIDEO_MODE_MIN DC1394_VIDEO_MODE_160x120_YUV444
#define DC1394_VIDEO_MODE_MAX DC1394_VIDEO_MODE_FORMAT7_7
#define DC1394_VIDEO_MODE_NUM (DC1394_VIDEO_MODE_MAX - DC1394_VIDEO_MODE_MIN + 1)
/* Special min/max are defined for Format_7 */
#define DC1394_VIDEO_MODE_FORMAT7_MIN DC1394_VIDEO_MODE_FORMAT7_0
#define DC1394_VIDEO_MODE_FORMAT7_MAX DC1394_VIDEO_MODE_FORMAT7_7
#define DC1394_VIDEO_MODE_FORMAT7_NUM (DC1394_VIDEO_MODE_FORMAT7_MAX - DC1394_VIDEO_MODE_FORMAT7_MIN + 1)
/**
* Enumeration of colour codings. For details on the data format please read the IIDC specifications.
*/
typedef enum {
DC1394_COLOR_CODING_MONO8= 352,
DC1394_COLOR_CODING_YUV411,
DC1394_COLOR_CODING_YUV422,
DC1394_COLOR_CODING_YUV444,
DC1394_COLOR_CODING_RGB8,
DC1394_COLOR_CODING_MONO16,
DC1394_COLOR_CODING_RGB16,
DC1394_COLOR_CODING_MONO16S,
DC1394_COLOR_CODING_RGB16S,
DC1394_COLOR_CODING_RAW8,
DC1394_COLOR_CODING_RAW16
} dc1394color_coding_t;
#define DC1394_COLOR_CODING_MIN DC1394_COLOR_CODING_MONO8
#define DC1394_COLOR_CODING_MAX DC1394_COLOR_CODING_RAW16
#define DC1394_COLOR_CODING_NUM (DC1394_COLOR_CODING_MAX - DC1394_COLOR_CODING_MIN + 1)
/**
* RAW sensor filters. These elementary tiles tesselate the image plane in RAW modes. RGGB should be interpreted in 2D as
*
* RG
* GB
*
* and similarly for other filters.
*/
typedef enum {
DC1394_COLOR_FILTER_RGGB = 512,
DC1394_COLOR_FILTER_GBRG,
DC1394_COLOR_FILTER_GRBG,
DC1394_COLOR_FILTER_BGGR
} dc1394color_filter_t;
#define DC1394_COLOR_FILTER_MIN DC1394_COLOR_FILTER_RGGB
#define DC1394_COLOR_FILTER_MAX DC1394_COLOR_FILTER_BGGR
#define DC1394_COLOR_FILTER_NUM (DC1394_COLOR_FILTER_MAX - DC1394_COLOR_FILTER_MIN + 1)
/**
* Byte order for YUV formats (may be expanded to RGB in the future)
*
* IIDC cameras always return data in UYVY order, but conversion functions can change this if requested.
*/
typedef enum {
DC1394_BYTE_ORDER_UYVY=800,
DC1394_BYTE_ORDER_YUYV
} dc1394byte_order_t;
#define DC1394_BYTE_ORDER_MIN DC1394_BYTE_ORDER_UYVY
#define DC1394_BYTE_ORDER_MAX DC1394_BYTE_ORDER_YUYV
#define DC1394_BYTE_ORDER_NUM (DC1394_BYTE_ORDER_MAX - DC1394_BYTE_ORDER_MIN + 1)
/**
* A struct containing a list of color codings
*/
typedef struct
{
uint32_t num;
dc1394color_coding_t codings[DC1394_COLOR_CODING_NUM];
} dc1394color_codings_t;
/**
* A struct containing a list of video modes
*/
typedef struct
{
uint32_t num;
dc1394video_mode_t modes[DC1394_VIDEO_MODE_NUM];
} dc1394video_modes_t;
/**
* Yet another boolean data type
*/
typedef enum {
DC1394_FALSE= 0,
DC1394_TRUE
} dc1394bool_t;
/**
* Yet another boolean data type, a bit more oriented towards electrical-engineers
*/
typedef enum {
DC1394_OFF= 0,
DC1394_ON
} dc1394switch_t;
#endif
... aucune référence à "dc1394_cameracapture".
Une recherche de cette chaine "dc1394_cameracapture" dans tous les fichiers et sous dossiers de /usr/include/dc1394 ne donne rien, ainsi que dans le répertoire d'installation mis à part la seule à la ligne 47 du fichier linuxfwCamera.h et qui provoque l'erreur.
Voilà, merci pour les pistes, je suis toujours preneur, je cherche toujours, et je me pose toujours la question de savoir si la résolution de la première erreur est bien valide. Pourquoi le make original cherche-t-il dans /usr/include/libdc1394 et pourquoi je n'ai pas ce répertoire avec Fedora 8. Je vais voir si j'arrive à savoir si c'était bien l'emplacement des entêtes de la bibliothèque de libbdc1394-devel avec Fedora 6. Vous n'avez pas une Fedora 6 sous la main avec cette bibliothèque installée pour voir ?
Je répète que le projet n'est pas trop prévu pour les webcams, mais j'ai cru voir que certaines personnes étaient arrivées à le faire fonctionner avec des webcams de la même famille que la mienne (Logitech QuickCam); je pense donc que c'est un problème avec cette libdc1394.
Pour info, voici le "uname -a" :
Linux localhost.localdomain 2.6.23.15-137.fc8 #1 SMP Sun Feb 10 17:48:34 EST 2008 i686 i686 i386 GNU/Linux