coriander-devel Mailing List for Coriander
Control and capture GUI for IIDC compliant cameras
Brought to you by:
ddouxchamps
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(10) |
Apr
(12) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(22) |
Dec
(8) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(37) |
Feb
(37) |
Mar
(8) |
Apr
(2) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(30) |
Sep
(6) |
Oct
(1) |
Nov
(7) |
Dec
(3) |
| 2006 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(23) |
Sep
(10) |
Oct
(6) |
Nov
(1) |
Dec
(3) |
| 2007 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
|
May
(4) |
Jun
(7) |
Jul
(5) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(13) |
| 2008 |
Jan
(1) |
Feb
|
Mar
(26) |
Apr
(4) |
May
(2) |
Jun
(1) |
Jul
(3) |
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(1) |
| 2010 |
Jan
(9) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(15) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2014 |
Jan
(3) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: max d. <ma...@ya...> - 2014-04-21 18:39:34
|
Hi all,
First of all, thanks for the great job.
I have a problem using a USB3.0 camera with Coriander. My camera is from Point Grey (Grasshopper3, GS3-U3-23S6M-C). I use a (not so recent) HP computer, with i5 CPU, and Orico PCI USB3.0 card (with Fresco Logic FL1009 USB 3.0 Host Controller), and Ubuntu 14.04, freshly installed.
FlyCapture2 works fine : it detects the camera, and can go up to 125fps (the camera is supposed to go to 160fps, with a newer computer I guess). I can start Coriander, using libdc1394 v2. I just had to add the ID of this camera in /USB/control.c before compiling.
The ID is the following :
{ 0x1e10, 0x3103 }, // Point Grey Grasshopper 3
This ID was given by lsusb, when the camera is plugged in a USB2.0 port.
Coriander detects the camera : right vendor and model names are given, and the settings (gain, framerate, etc) have the values that I assigned with FlyCapture2 just before starting Coriander (I exited FlyCapture2 before starting Coriander).
But when I press "Display", I get these error messages in the terminal :
libdc1394 error: usb: Bulk transfer 0 failed with code 6
libdc1394 error: usb: Bulk transfer 1 failed with code 6
libdc1394 error: usb: Bulk transfer 2 failed with code 6
libdc1394 error: usb: Bulk transfer 3 failed with code 6
libdc1394 error: usb: Bulk transfer 4 failed with code 6
libdc1394 error: usb: Bulk transfer 5 failed with code 6
libdc1394 error: usb: Bulk transfer 6 failed with code 6
libdc1394 error: usb: Bulk transfer 7 failed with code 6
libdc1394 error: usb: Bulk transfer 8 failed with code 6
libdc1394 error: usb: Bulk transfer 9 failed with code 6
And then Coriander freezes.
Do you have any idea about this "Bulk transfer" failure ? What is code 6 ? What could I do ?
Thanks for you help.
Maxime Deforet
|
|
From: Caleb K. <ck...@gm...> - 2014-01-02 19:28:30
|
Hopefully this works!
(As an aside, in the meantime, I've also gotten the mpeg compression
working again.)
Patches for thread_v4l.c and thread_v4l.h
diff -ur coriander/src/thread_v4l.c coriander-v42l/src/thread_v4l.c
--- coriander/src/thread_v4l.c 2014-01-02 12:50:47.485932724 -0600
+++ coriander-v42l/src/thread_v4l.c 2014-01-02 12:51:09.629932142 -0600
@@ -18,6 +18,7 @@
*/
#include "coriander.h"
+#include <stdio.h>
gint
V4lStartThread(camera_t* cam)
@@ -105,8 +106,10 @@
v4lthread_info_t *info=NULL;
long int skip_counter;
float tmp;
- struct video_picture p;
-
+ //struct video_picture p;
+
+ struct v4l2_format pf;
+
v4l_service=(chain_t*)arg;
pthread_mutex_lock(&v4l_service->mutex_data);
info=(v4lthread_info_t*)v4l_service->data;
@@ -142,15 +145,40 @@
/* IF we have mono data then set V4L for mono(grey) output */
/* Only do this ONCE before writing the first frame */
- if (((v4l_service->current_buffer->frame.color_coding ==
DC1394_COLOR_CODING_MONO8) ||
- (v4l_service->current_buffer->frame.color_coding ==
DC1394_COLOR_CODING_RAW8)) && v4l_service->processed_frames==0) {
- Warning("Setting V4L device to GREY palette");
- if (ioctl(info->v4l_dev,VIDIOCGPICT,&p) < 0)
- Error("ioctl(VIDIOCGPICT) error");
+ if ((v4l_service->current_buffer->frame.color_coding ==
DC1394_COLOR_CODING_MONO8) && v4l_service->processed_frames==0) {
+ Warning("Setting V4L device to GREY pix_fmt");
+ pf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&pf) < 0)
+ Error("ioctl(VIDIOC_G_FMT) error");
else {
- p.palette = VIDEO_PALETTE_GREY;
- if (ioctl(info->v4l_dev,VIDIOCSPICT,&p) < 0)
- Error("ioctl(VIDIOCSPICT) Error");
+ pf.fmt.pix.pixelformat = V4L2_PIX_FMT_GREY;
+ pf.fmt.pix.sizeimage =
v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1];
+ if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&pf) < 0)
+ Error("ioctl(VIDIOC_S_FMT) Error");
+ }
+ }
+ else if ((v4l_service->current_buffer->frame.color_coding ==
DC1394_COLOR_CODING_RAW8) && v4l_service->processed_frames==0) {
+ Warning("Setting V4L device to RGGB pix_fmt");
+ pf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&pf) < 0)
+ Error("ioctl(VIDIOC_G_FMT) error");
+ else {
+ pf.fmt.pix.pixelformat = V4L2_PIX_FMT_SRGGB8;
+ pf.fmt.pix.sizeimage =
v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1];
+ if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&pf) < 0)
+ Error("ioctl(VIDIOC_S_FMT) Error");
+ }
+ }
+ else if (v4l_service->processed_frames==0) { // Default is RGB24
+ Warning("Setting V4L device to RGB24 pix_fmt");
+ pf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&pf) < 0)
+ Error("ioctl(VIDIOC_G_FMT) error");
+ else {
+ pf.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
+ pf.fmt.pix.sizeimage =
v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]*3;
+ if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&pf) < 0)
+ Error("ioctl(VIDIOC_S_FMT) Error");
}
}
@@ -158,7 +186,7 @@
if ((v4l_service->current_buffer->frame.color_coding !=
DC1394_COLOR_CODING_MONO8) &&
(v4l_service->current_buffer->frame.color_coding !=
DC1394_COLOR_CODING_RAW8)) {
convert_to_rgb(&v4l_service->current_buffer->frame, &info->frame);
- swap_rb(info->frame.image,
v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]*3);
+ //swap_rb(info->frame.image,
v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]*3);
}
if (v4l_service->current_buffer->frame.size[0]!=-1) {
@@ -257,6 +285,7 @@
{
v4lthread_info_t *info;
+
info=(v4lthread_info_t*)v4l_service->data;
// if some parameters changed, we need to re-allocate the local
buffers and restart the v4l
@@ -266,23 +295,20 @@
// STOPING THE PIPE MIGHT BE NECESSARY HERE
// "start pipe"
- if (ioctl (info->v4l_dev, VIDIOCGCAP, &info->vid_caps) == -1) {
- perror ("ioctl (VIDIOCGCAP)");
+ if (ioctl (info->v4l_dev, VIDIOC_QUERYCAP, &info->vid_caps) == -1) {
+ perror ("ioctl (VIDIOC_QUERYCAP)");
}
- if (ioctl (info->v4l_dev, VIDIOCGPICT, &info->vid_pic)== -1) {
- perror ("ioctl VIDIOCGPICT");
- }
- info->vid_pic.palette = VIDEO_PALETTE_RGB24;
- if (ioctl (info->v4l_dev, VIDIOCSPICT, &info->vid_pic)== -1) {
- perror ("ioctl VIDIOCSPICT");
- }
- if (ioctl (info->v4l_dev, VIDIOCGWIN, &info->vid_win)== -1) {
- perror ("ioctl VIDIOCGWIN");
+
+ info->vid_format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ if (ioctl (info->v4l_dev,VIDIOC_G_FMT,&info->vid_format) == -1) {
+ perror ("ioctl(VIDIOC_G_FMT)");
}
- info->vid_win.width=v4l_service->current_buffer->frame.size[0];
- info->vid_win.height=v4l_service->current_buffer->frame.size[1];
- if (ioctl (info->v4l_dev, VIDIOCSWIN, &info->vid_win)== -1) {
- perror ("ioctl VIDIOCSWIN");
+ info->vid_format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ info->vid_format.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; //
default-changes before data gets sent out
+ info->vid_format.fmt.pix.width=v4l_service->current_buffer->frame.size[0];
+ info->vid_format.fmt.pix.height=v4l_service->current_buffer->frame.size[1];
+ if (ioctl (info->v4l_dev, VIDIOC_S_FMT, &info->vid_format)== -1) {
+ perror ("ioctl VIDIOC_S_FMT");
}
}
diff -ur coriander/src/thread_v4l.h coriander-v42l/src/thread_v4l.h
--- coriander/src/thread_v4l.h 2014-01-02 12:50:47.485932724 -0600
+++ coriander-v42l/src/thread_v4l.h 2014-01-02 12:51:09.629932142 -0600
@@ -20,6 +20,8 @@
#ifndef __THREAD_V4L_H__
#define __THREAD_V4L_H__
+#include <linux/videodev2.h>
+
typedef struct
{
//long int period;
@@ -30,9 +32,12 @@
dc1394video_frame_t frame;
//unsigned char *v4l_buffer;
- struct video_capability vid_caps;
- struct video_window vid_win;
- struct video_picture vid_pic;
+ //struct video_capability vid_caps;
+ //struct video_window vid_win;
+ //struct video_picture vid_pic;
+
+ struct v4l2_capability vid_caps;
+ struct v4l2_format vid_format;
} v4lthread_info_t;
– caleb
On Wed, Jan 1, 2014 at 9:54 PM, Damien Douxchamps <dd...@do...> wrote:
> Hi Caleb,
>
> On Tue, 2013-12-17 at 11:07 -0600, Caleb Kemere wrote:
>> Hey folks,
>>
>> With my Ubuntu 12.04 system, I had trouble finding a reliable source
>> for a v4lloopback pacakge, so I modified the coriander code to work
>> with v4l2loopback. I'm too lazy to figure out to diff the changes in
>> thread-v4l.*, so I created a github repository for my modified version
>> here: https://github.com/ckemere/coriander-v42l
>
> It's been a long time, but I don't remember seeing a v4l2loopback
> package. This is good news!
>
>> If there's positive feedback, I suppose I can try to figure out the
>> diff/patch syntax...
>
> Try this:
>
> diff -ur original_directory/ my_new_directory/ > v4l2.patch
>
> then share the v4l2.patch file.
>
> Thanks,
>
> --
> Damien 高原 Douxchamps http://damien.douxchamps.net/
>
|
|
From: Caleb K. <ck...@gm...> - 2014-01-02 18:58:53
|
Hopefully useful! Note that the raw / mono formats will probably not work. If you convert to color before enabling the V4L service, things seem to be happy. (As an aside, in the meantime, I've also gotten the mpeg compression working again. The most recent version on my github.com/ckemere repository also includes that.) Patches for thread_v4l.c and thread_v4l.h: diff -ur coriander/src/thread_v4l.c coriander-v42l/src/thread_v4l.c --- coriander/src/thread_v4l.c 2014-01-02 12:50:47.485932724 -0600 +++ coriander-v42l/src/thread_v4l.c 2014-01-02 12:51:09.629932142 -0600 @@ -18,6 +18,7 @@ */ #include "coriander.h" +#include <stdio.h> gint V4lStartThread(camera_t* cam) @@ -105,8 +106,10 @@ v4lthread_info_t *info=NULL; long int skip_counter; float tmp; - struct video_picture p; - + //struct video_picture p; + + struct v4l2_format pf; + v4l_service=(chain_t*)arg; pthread_mutex_lock(&v4l_service->mutex_data); info=(v4lthread_info_t*)v4l_service->data; @@ -142,15 +145,40 @@ /* IF we have mono data then set V4L for mono(grey) output */ /* Only do this ONCE before writing the first frame */ - if (((v4l_service->current_buffer->frame.color_coding == DC1394_COLOR_CODING_MONO8) || - (v4l_service->current_buffer->frame.color_coding == DC1394_COLOR_CODING_RAW8)) && v4l_service->processed_frames==0) { - Warning("Setting V4L device to GREY palette"); - if (ioctl(info->v4l_dev,VIDIOCGPICT,&p) < 0) - Error("ioctl(VIDIOCGPICT) error"); + if ((v4l_service->current_buffer->frame.color_coding == DC1394_COLOR_CODING_MONO8) && v4l_service->processed_frames==0) { + Warning("Setting V4L device to GREY pix_fmt"); + pf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&pf) < 0) + Error("ioctl(VIDIOC_G_FMT) error"); else { - p.palette = VIDEO_PALETTE_GREY; - if (ioctl(info->v4l_dev,VIDIOCSPICT,&p) < 0) - Error("ioctl(VIDIOCSPICT) Error"); + pf.fmt.pix.pixelformat = V4L2_PIX_FMT_GREY; + pf.fmt.pix.sizeimage = v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]; + if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&pf) < 0) + Error("ioctl(VIDIOC_S_FMT) Error"); + } + } + else if ((v4l_service->current_buffer->frame.color_coding == DC1394_COLOR_CODING_RAW8) && v4l_service->processed_frames==0) { + Warning("Setting V4L device to RGGB pix_fmt"); + pf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&pf) < 0) + Error("ioctl(VIDIOC_G_FMT) error"); + else { + pf.fmt.pix.pixelformat = V4L2_PIX_FMT_SRGGB8; + pf.fmt.pix.sizeimage = v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]; + if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&pf) < 0) + Error("ioctl(VIDIOC_S_FMT) Error"); + } + } + else if (v4l_service->processed_frames==0) { // Default is RGB24 + Warning("Setting V4L device to RGB24 pix_fmt"); + pf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&pf) < 0) + Error("ioctl(VIDIOC_G_FMT) error"); + else { + pf.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; + pf.fmt.pix.sizeimage = v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]*3; + if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&pf) < 0) + Error("ioctl(VIDIOC_S_FMT) Error"); } } @@ -158,7 +186,7 @@ if ((v4l_service->current_buffer->frame.color_coding != DC1394_COLOR_CODING_MONO8) && (v4l_service->current_buffer->frame.color_coding != DC1394_COLOR_CODING_RAW8)) { convert_to_rgb(&v4l_service->current_buffer->frame, &info->frame); - swap_rb(info->frame.image, v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]*3); + //swap_rb(info->frame.image, v4l_service->current_buffer->frame.size[0]*v4l_service->current_buffer->frame.size[1]*3); } if (v4l_service->current_buffer->frame.size[0]!=-1) { @@ -257,6 +285,7 @@ { v4lthread_info_t *info; + info=(v4lthread_info_t*)v4l_service->data; // if some parameters changed, we need to re-allocate the local buffers and restart the v4l @@ -266,23 +295,20 @@ // STOPING THE PIPE MIGHT BE NECESSARY HERE // "start pipe" - if (ioctl (info->v4l_dev, VIDIOCGCAP, &info->vid_caps) == -1) { - perror ("ioctl (VIDIOCGCAP)"); + if (ioctl (info->v4l_dev, VIDIOC_QUERYCAP, &info->vid_caps) == -1) { + perror ("ioctl (VIDIOC_QUERYCAP)"); } - if (ioctl (info->v4l_dev, VIDIOCGPICT, &info->vid_pic)== -1) { - perror ("ioctl VIDIOCGPICT"); - } - info->vid_pic.palette = VIDEO_PALETTE_RGB24; - if (ioctl (info->v4l_dev, VIDIOCSPICT, &info->vid_pic)== -1) { - perror ("ioctl VIDIOCSPICT"); - } - if (ioctl (info->v4l_dev, VIDIOCGWIN, &info->vid_win)== -1) { - perror ("ioctl VIDIOCGWIN"); + + info->vid_format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + if (ioctl (info->v4l_dev,VIDIOC_G_FMT,&info->vid_format) == -1) { + perror ("ioctl(VIDIOC_G_FMT)"); } - info->vid_win.width=v4l_service->current_buffer->frame.size[0]; - info->vid_win.height=v4l_service->current_buffer->frame.size[1]; - if (ioctl (info->v4l_dev, VIDIOCSWIN, &info->vid_win)== -1) { - perror ("ioctl VIDIOCSWIN"); + info->vid_format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + info->vid_format.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; // default-changes before data gets sent out + info->vid_format.fmt.pix.width=v4l_service->current_buffer->frame.size[0]; + info->vid_format.fmt.pix.height=v4l_service->current_buffer->frame.size[1]; + if (ioctl (info->v4l_dev, VIDIOC_S_FMT, &info->vid_format)== -1) { + perror ("ioctl VIDIOC_S_FMT"); } } diff -ur coriander/src/thread_v4l.h coriander-v42l/src/thread_v4l.h --- coriander/src/thread_v4l.h 2014-01-02 12:50:47.485932724 -0600 +++ coriander-v42l/src/thread_v4l.h 2014-01-02 12:51:09.629932142 -0600 @@ -20,6 +20,8 @@ #ifndef __THREAD_V4L_H__ #define __THREAD_V4L_H__ +#include <linux/videodev2.h> + typedef struct { //long int period; @@ -30,9 +32,12 @@ dc1394video_frame_t frame; //unsigned char *v4l_buffer; - struct video_capability vid_caps; - struct video_window vid_win; - struct video_picture vid_pic; + //struct video_capability vid_caps; + //struct video_window vid_win; + //struct video_picture vid_pic; + + struct v4l2_capability vid_caps; + struct v4l2_format vid_format; } v4lthread_info_t; – caleb On Wed, Jan 1, 2014 at 9:54 PM, Damien Douxchamps <dd...@do...> wrote: > Hi Caleb, > > On Tue, 2013-12-17 at 11:07 -0600, Caleb Kemere wrote: >> Hey folks, >> >> With my Ubuntu 12.04 system, I had trouble finding a reliable source >> for a v4lloopback pacakge, so I modified the coriander code to work >> with v4l2loopback. I'm too lazy to figure out to diff the changes in >> thread-v4l.*, so I created a github repository for my modified version >> here: https://github.com/ckemere/coriander-v42l > > It's been a long time, but I don't remember seeing a v4l2loopback > package. This is good news! > >> If there's positive feedback, I suppose I can try to figure out the >> diff/patch syntax... > > Try this: > > diff -ur original_directory/ my_new_directory/ > v4l2.patch > > then share the v4l2.patch file. > > Thanks, > > -- > Damien 高原 Douxchamps http://damien.douxchamps.net/ > |
|
From: Damien D. <dd...@do...> - 2014-01-02 03:54:53
|
Hi Caleb, On Tue, 2013-12-17 at 11:07 -0600, Caleb Kemere wrote: > Hey folks, > > With my Ubuntu 12.04 system, I had trouble finding a reliable source > for a v4lloopback pacakge, so I modified the coriander code to work > with v4l2loopback. I'm too lazy to figure out to diff the changes in > thread-v4l.*, so I created a github repository for my modified version > here: https://github.com/ckemere/coriander-v42l It's been a long time, but I don't remember seeing a v4l2loopback package. This is good news! > If there's positive feedback, I suppose I can try to figure out the > diff/patch syntax... Try this: diff -ur original_directory/ my_new_directory/ > v4l2.patch then share the v4l2.patch file. Thanks, -- Damien 高原 Douxchamps http://damien.douxchamps.net/ |
|
From: Caleb K. <ck...@gm...> - 2013-12-17 17:08:00
|
Hey folks, With my Ubuntu 12.04 system, I had trouble finding a reliable source for a v4lloopback pacakge, so I modified the coriander code to work with v4l2loopback. I'm too lazy to figure out to diff the changes in thread-v4l.*, so I created a github repository for my modified version here: https://github.com/ckemere/coriander-v42l If there's positive feedback, I suppose I can try to figure out the diff/patch syntax... – caleb |
|
From: Damien D. <dd...@do...> - 2013-02-23 12:00:00
|
Hi all, It's been a long time since the last release of Coriander! There's nothing ground breaking, but some overdue minor updates were necessary. The only new feature is TIFF image output (16bit too!). On feature that was removed is the RAM buffering. These days It's trivial to use /dev/shm for this purpose so the code was binned. Cheers, Damien -- Damien 高原 Douxchamps http://damien.douxchamps.net/ |
|
From: <pea...@sh...> - 2012-06-18 20:27:03
|
From: Stefan Richter <st...@s5...> Date: Mon, 18 Jun 2012 22:18:17 +0200 > Could be that vloopback no longer provides a proc interface, > I don't know. If the question can not be answered here, is there a better place to ask? For me to unravel this by studying the source code will be infeasible. Thanks, ... Peter E. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " |
|
From: Stefan R. <st...@s5...> - 2012-06-18 20:18:28
|
On Jun 18 pea...@sh... wrote: > From: Stefan Richter <st...@s5...> > Date: Mon, 11 Jun 2012 22:50:51 +0200 > > ... look up in /proc/video/vloopback/ which two video devices belong to one > > pipe. > > peter@joule:~$ ls /proc/v* > /proc/version /proc/vmallocinfo /proc/vmstat > > No /proc/video/? How should the directory be created? > Any ideas why creation fails? I took that from an old webpage. Could be that vloopback no longer provides a proc interface, I don't know. Or it is simply broken already on the kernel version that you are using. -- Stefan Richter -=====-===-- -==- =--=- http://arcgraph.de/sr/ |
|
From: <pea...@sh...> - 2012-06-18 19:53:07
|
From: Stefan Richter <st...@s5...> Date: Mon, 11 Jun 2012 22:50:51 +0200 > ... look up in /proc/video/vloopback/ which two video devices belong to one > pipe. peter@joule:~$ ls /proc/v* /proc/version /proc/vmallocinfo /proc/vmstat No /proc/video/? How should the directory be created? Any ideas why creation fails? Thanks, ... Peter E. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " |
|
From: Stefan R. <st...@s5...> - 2012-06-11 20:51:02
|
On Jun 11 pea...@sh... wrote: > By the way, the Coriander manual has no mention of JuJu or udev and > I wonder which of the instructions apply to my Debian Squeeze system. > > peter@joule:/dev$ uname -rv > 2.6.32-5-686 #1 SMP Sat May 5 01:33:08 UTC 2012 > > http://damien.douxchamps.net/ieee1394/coriander/manual/ states, > "... you should create the proper 1394 devices. There > are two devices to create: raw1394 and video1394." This is outdated. These devices have been managed by udev for a long time now. Nowadays they are replaced by /dev/fw* files though. However, since Coriander captures video, everything is alright on that side. > I would have expected udev to create these devices. In any case, > this is what exists when Coriander is running. > > peter@joule:/dev$ ls -ld *1394* > ls: cannot access *1394*: No such file or directory > > peter@joule:/dev$ ls -ld *vid* > crw-rw----+ 1 root video 81, 0 Jun 10 16:20 video0 > crw-rw----+ 1 root video 81, 1 Jun 10 16:20 video1 > crw-rw----+ 1 root video 81, 2 Jun 10 16:20 video2 > crw-rw----+ 1 root video 81, 3 Jun 10 16:20 video3 > > Thanks for any ideas, ... Peter E. Two or more of these files are certainly backed by vloopback. I suppose two by default but four with "modprobe vloopback pipes=2". Supposedly you can look up in /proc/video/vloopback/ which two video devices belong to one pipe. If "id" says that your account is in the video group, then access permissions are not the issue. -- Stefan Richter -=====-===-- -==- -=-== http://arcgraph.de/sr/ |
|
From: <pea...@sh...> - 2012-06-11 16:43:48
|
By the way, the Coriander manual has no mention of JuJu or udev and I wonder which of the instructions apply to my Debian Squeeze system. peter@joule:/dev$ uname -rv 2.6.32-5-686 #1 SMP Sat May 5 01:33:08 UTC 2012 http://damien.douxchamps.net/ieee1394/coriander/manual/ states, "... you should create the proper 1394 devices. There are two devices to create: raw1394 and video1394." I would have expected udev to create these devices. In any case, this is what exists when Coriander is running. peter@joule:/dev$ ls -ld *1394* ls: cannot access *1394*: No such file or directory peter@joule:/dev$ ls -ld *vid* crw-rw----+ 1 root video 81, 0 Jun 10 16:20 video0 crw-rw----+ 1 root video 81, 1 Jun 10 16:20 video1 crw-rw----+ 1 root video 81, 2 Jun 10 16:20 video2 crw-rw----+ 1 root video 81, 3 Jun 10 16:20 video3 Thanks for any ideas, ... Peter E. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " Shelley's photos https://picasaweb.google.com/112944318138461249464/May292012?authuser=0&authkey=Gv1sRgCN_c7efw5-rWEg&feat=directlink Peter's photos https://picasaweb.google.com/112944318138461249464/May29201202?authuser=0&feat=directlink |
|
From: <pea...@sh...> - 2012-06-11 00:02:05
|
From: Gordon Sinclair <go...@gy...> Date: Tue, 05 Jun 2012 21:39:38 +0100 > The only thing i can see is that I always start coriander as root to get > over any privilege issues. If coriander can not see any cameras try > starting sudo coriander For user and for root Coriander runs and Services > Display gives an image. No problem there. The problem is to get the V4L signal. For interest, I changed the 1394 pci adapter card to a newer Belkin. hwinfo reports the older adapter as well as this one; but "hwinfo --camera" still gives nothing. Can anyone get camera information from hwinfo? Perhaps hwinfo is simply unable to detect a 1394 camera. From: Stefan Richter <st...@s5...> Date: Wed, 6 Jun 2012 13:43:17 +0200 > Likewise, ownerships or ACLs on the v4l character device files need to be > set properly, ... peter@joule:/dev$ find . -type f -name '*v4l*' -print peter@joule:/dev$ No /dev file with "v4l" in the name. What should exist? Is it persistent? Or does it come into existence only when Coriander is running the V4L service? > ... and your user account should be member of the necessary > group(s) of course. Which groups? I don't recognize any group as specific to V4L. Should there be a *v4l* group? Thanks, ... Peter E. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " Shelley's photos https://picasaweb.google.com/112944318138461249464/May292012?authuser=0&authkey=Gv1sRgCN_c7efw5-rWEg&feat=directlink Peter's photos https://picasaweb.google.com/112944318138461249464/May29201202?authuser=0&feat=directlink |
|
From: Stefan R. <st...@s5...> - 2012-06-06 11:43:32
|
On Jun 05 Gordon Sinclair wrote: > The only thing i can see is that I always start coriander as root to get > over any privilege issues. If coriander can not see any cameras try > starting sudo coriander Both safer and more practical would be to check why udev doesn't set useful group ownership or ACLs on the /dev/fw* character device file which corresponds to the camera, and fix that. Stock udev has rules for IIDC compliant devices. https://ieee1394.wiki.kernel.org/index.php/Juju_Migration#Permissions_and_ownership_for_.2Fdev.2Ffw.2A http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=rules/50-udev-default.rules;h=5ad787fc764594e2999809fee105dde416a3d6e5;hb=HEAD#l48 Likewise, ownerships or ACLs on the v4l character device files need to be set properly, and your user account should be member of the necessary group(s) of course. If it turns out that stock udev rules lack some device IDs, we should submit a fix to the udev maintainers. -- Stefan Richter -=====-===-- -==- --==- http://arcgraph.de/sr/ |
|
From: <pe...@ea...> - 2012-06-05 21:34:36
|
Gordon, > If coriander can not see any cameras try > starting sudo coriander Will try it this coming weekend. The camera is at home and I am at work in the city. > ... i only offer you what little help i can be Much appreciated. There was no response from a query to coriander-user over a yar back. Regards, ... P. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " |
|
From: Gordon S. <go...@gy...> - 2012-06-05 20:39:46
|
Dear Peter E. The only thing i can see is that I always start coriander as root to get over any privilege issues. If coriander can not see any cameras try starting sudo coriander again i can only say i have only just started using the program myself so i only offer you what little help i can be thanks gordon On Mon, 2012-06-04 at 10:00 -0700, pea...@sh... wrote: > Gordon and anyone interested, > > Thanks for your instructions. > > > svn co http://www.lavrsen.dk/svn/vloopback/trunk/ vloopback > > > > then compile and install > > I installed from the debian vloopback source package. Compiled it. > > http://packages.debian.org/source/stable/graphics/vloopback-source > > Date: Mon, 04 Jun 2012 15:53:37 +0100 > > modprobe vloopback pipes=2 > > OK thanks. I don't recall seeing "pipes=2" mentioned until now. > > peter@joule:~$ lsmod | grep vloop > vloopback 9842 2 > videodev 25637 3 vloopback > > > run coriander set up the camera ... > > I had to hotplug the camera before Coriander could operate. > > root@joule:/home/peter# hwinfo --all > ./Hardware > The output file is visible here. > > http://members.shaw.ca/peasthope/Hardware > > The 1394 adapter with TI chip is listed. No camera. > > > ... and start the v4l service using the default device (/dev/video0) > > Two windows appear. > > "Error: could not start the V4L service." > > "Failed to open V4L device /dev/video1" > > Problem in the Debian vloopback-source package? > Problem with the old 1394 adapter card with TI chip? > > I can try a different adapter and try compiling from > the svn you mentioned. > > Thanks again, ... Peter E. > > |
|
From: <pea...@sh...> - 2012-06-04 17:00:09
|
Gordon and anyone interested, Thanks for your instructions. > svn co http://www.lavrsen.dk/svn/vloopback/trunk/ vloopback > > then compile and install I installed from the debian vloopback source package. Compiled it. http://packages.debian.org/source/stable/graphics/vloopback-source Date: Mon, 04 Jun 2012 15:53:37 +0100 > modprobe vloopback pipes=2 OK thanks. I don't recall seeing "pipes=2" mentioned until now. peter@joule:~$ lsmod | grep vloop vloopback 9842 2 videodev 25637 3 vloopback > run coriander set up the camera ... I had to hotplug the camera before Coriander could operate. root@joule:/home/peter# hwinfo --all > ./Hardware The output file is visible here. http://members.shaw.ca/peasthope/Hardware The 1394 adapter with TI chip is listed. No camera. > ... and start the v4l service using the default device (/dev/video0) Two windows appear. "Error: could not start the V4L service." "Failed to open V4L device /dev/video1" Problem in the Debian vloopback-source package? Problem with the old 1394 adapter card with TI chip? I can try a different adapter and try compiling from the svn you mentioned. Thanks again, ... Peter E. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " |
|
From: Gordon S. <go...@gy...> - 2012-06-04 14:53:51
|
Dear Peter E. I do not claim any expertise i have only just started using coriander and vloopback. But what i have i will share. I suggest you get vloopback working its fine on Linux 2.6.38 pre-releases. Download the using subversion svn co http://www.lavrsen.dk/svn/vloopback/trunk/ vloopback then compile and install if you are using One camera you will need two pipes so modprobe vloopback pipes=2 run coriander set up the camera and start the v4l service using the default device (/dev/video0) then run what ever program using the next device ie /dev/video1 should work fine all the best gordon On Sun, 2012-06-03 at 12:30 -0700, pe...@ea... wrote: > Hi, > > Please excuse this interjection. Your discussion has piqued > my interest. > > About 3 years ago I purchased a Uibrain Fire-i camera and > connected it to my Debian system; at that time Debian Sarge; > currently Debian Squeeze with linux-image-2.6.32-5-686. > vloopback is installed. > > I've never observed any problem with Coriander. Disappointingly, > the camera has never worked for Skype or any other VoIP. > > On May 29 Gordon Sinclair wrote: > > I have invested in a couple of very nice firewire cams which give me 30 > > fps. I need to get them to work through coriander to my program using > > the v4l interface. That's when it all went wrong because the V4L1 API > > was removed in one of the Linux 2.6.38 pre-releases. The > > <linux/videodev.h> header doesn't exist any more and has been superseded > > by <linux/videodev2.h>. Thus I cannot build vloopback on my system with > > the kernel version 2.6.38-15-generic-pae > > This suggests that the problem here may not be my incompetence. Does every > VoIP in Linux require vloopback? Should vloopback work in this system? > > Any tips welcome, thanks, ... Peter E. > > |
|
From: <pe...@ea...> - 2012-06-03 19:43:00
|
Hi, Please excuse this interjection. Your discussion has piqued my interest. About 3 years ago I purchased a Uibrain Fire-i camera and connected it to my Debian system; at that time Debian Sarge; currently Debian Squeeze with linux-image-2.6.32-5-686. vloopback is installed. I've never observed any problem with Coriander. Disappointingly, the camera has never worked for Skype or any other VoIP. On May 29 Gordon Sinclair wrote: > I have invested in a couple of very nice firewire cams which give me 30 > fps. I need to get them to work through coriander to my program using > the v4l interface. That's when it all went wrong because the V4L1 API > was removed in one of the Linux 2.6.38 pre-releases. The > <linux/videodev.h> header doesn't exist any more and has been superseded > by <linux/videodev2.h>. Thus I cannot build vloopback on my system with > the kernel version 2.6.38-15-generic-pae This suggests that the problem here may not be my incompetence. Does every VoIP in Linux require vloopback? Should vloopback work in this system? Any tips welcome, thanks, ... Peter E. -- Telephone 1 360 639 0202. Bcc: peter at easthope.ca "http://carnot.yi.org/ " "http://members.shaw.ca/peasthope/index.html#Itinerary " |
|
From: Stefan R. <st...@s5...> - 2012-06-03 18:43:38
|
On Jun 03 Gordon Sinclair wrote: [IIDC->V4L2 driver] > I agree I think it is the way forward, but as i have 13 mouths of my > doctorate left and simply do not have the time for now but after i > graduate i will look at my schedule. With your time constraints, you should certainly simply install the last kernel which was still compatible with the old vloopback module. I suspect not even a v4l2loopback mode for Coriander will appear soon enough for you, even if somebody decides to implement it. -- Stefan Richter -=====-===-- -==- ---== http://arcgraph.de/sr/ |
|
From: Gordon S. <go...@gy...> - 2012-06-03 15:19:29
|
Dear Stefan I agree I think it is the way forward, but as i have 13 mouths of my doctorate left and simply do not have the time for now but after i graduate i will look at my schedule. all the best gordon On Sun, 2012-06-03 at 13:08 +0200, Stefan Richter wrote: > On May 29 Gordon Sinclair wrote: > > I have invested in a couple of very nice firewire cams which give me 30 > > fps. I need to get them to work through coriander to my program using > > the v4l interface. That's when it all went wrong because the V4L1 API > > was removed in one of the Linux 2.6.38 pre-releases. The > > <linux/videodev.h> header doesn't exist any more and has been superseded > > by <linux/videodev2.h>. Thus I cannot build vloopback on my system with > > the kernel version 2.6.38-15-generic-pae > > > > Is there a branch of coriander which does v4l2loopback? > > > > I have taken a look at the code for vloopback but I don't understand it > > at all. The only other option is to roll back to a previous kernel. > > Doing FireWire video capture via special low-level IEEE 1394 I/O kernel > interfaces instead of the V4L/ V4L2 interface has been, and still is, one > of the big mistakes of IEEE 1394 support on Linux. > > The stop-gap solution for 1394 video via V4L, vloopback, was always > problematic by > (a) being a project outside of the mainline kernel, thus risking > breakage at any kernel update, > (b) having to rely on a userspace process for DMA buffer queueing. > The very same problems apply to v4l2loopback of course. > > To me, an IIDC to V4L2 kernel driver (as well as an IEC61883-2/-4 to V4L2 > kernel driver) looks like a much more useful project. Alas I have far to > little time for Linux projects myself for the time being to implement such > a driver. |
|
From: Stefan R. <st...@s5...> - 2012-06-03 11:08:39
|
On May 29 Gordon Sinclair wrote:
> I have invested in a couple of very nice firewire cams which give me 30
> fps. I need to get them to work through coriander to my program using
> the v4l interface. That's when it all went wrong because the V4L1 API
> was removed in one of the Linux 2.6.38 pre-releases. The
> <linux/videodev.h> header doesn't exist any more and has been superseded
> by <linux/videodev2.h>. Thus I cannot build vloopback on my system with
> the kernel version 2.6.38-15-generic-pae
>
> Is there a branch of coriander which does v4l2loopback?
>
> I have taken a look at the code for vloopback but I don't understand it
> at all. The only other option is to roll back to a previous kernel.
Doing FireWire video capture via special low-level IEEE 1394 I/O kernel
interfaces instead of the V4L/ V4L2 interface has been, and still is, one
of the big mistakes of IEEE 1394 support on Linux.
The stop-gap solution for 1394 video via V4L, vloopback, was always
problematic by
(a) being a project outside of the mainline kernel, thus risking
breakage at any kernel update,
(b) having to rely on a userspace process for DMA buffer queueing.
The very same problems apply to v4l2loopback of course.
To me, an IIDC to V4L2 kernel driver (as well as an IEC61883-2/-4 to V4L2
kernel driver) looks like a much more useful project. Alas I have far to
little time for Linux projects myself for the time being to implement such
a driver.
--
Stefan Richter
-=====-===-- -==- ---==
http://arcgraph.de/sr/
|
|
From: Gordon S. <go...@gy...> - 2012-05-29 22:11:46
|
Dear Developers I am a doctorate student at the University of Portsmouth. I have built an eye tracking microscope using two usb web cams to capture eye moments. Unfortunately I am only getting 8 frames per second so I think I am missing the very behaviour I need to see. I have invested in a couple of very nice firewire cams which give me 30 fps. I need to get them to work through coriander to my program using the v4l interface. That's when it all went wrong because the V4L1 API was removed in one of the Linux 2.6.38 pre-releases. The <linux/videodev.h> header doesn't exist any more and has been superseded by <linux/videodev2.h>. Thus I cannot build vloopback on my system with the kernel version 2.6.38-15-generic-pae Is there a branch of coriander which does v4l2loopback? I have taken a look at the code for vloopback but I don't understand it at all. The only other option is to roll back to a previous kernel. Thanks gordon |
|
From: Stefan R. <st...@s5...> - 2011-11-17 21:30:37
|
On Nov 17 pea...@sh... wrote:
> There should be a definitive way to know whether Coriander is using the
> "old" 1394 drivers or the Juju drivers.
Coriander just uses libdc1394 for all 1394 I/O, and libdc1394 uses what
the running kernel offers.
> Something in /proc shows this?
/proc/interrupts, /sys/bus/{ieee1394,firewire}/, lspci -v for example...
--
Stefan Richter
-=====-==-== =-== =---=
http://arcgraph.de/sr/
|
|
From: <pea...@sh...> - 2011-11-17 15:56:28
|
Hello Coriander developers, I am using Coriander in Debian Squeeze with a Unibrain Fire-i camera. Here are a few suggestions for the documentation. http://damien.douxchamps.net/ieee1394/cameras/ reports the optics of the Fire-i as fixed. In fact the lens is thread mounted although not removable. Focus can be adjusted manually. The Optics Key doesn't have a notation for this configuration. There should be a definitive way to know whether Coriander is using the "old" 1394 drivers or the Juju drivers. Something in /proc shows this? Documention is needed. http://damien.douxchamps.net/ieee1394/coriander/manual/ and "man coriander" should tell which device input is taken from. Also, when vloopback is operating, the documentation should tell which device a secondary application can obtain output from. Stefan Richter carefully explained most of this in <20111116193303.7d625e33@stein> to coriander-user at Date: Wed, 16 Nov 2011 19:33:03 +010. Incorporation into the Web based and traditional manuals would be really helpful for clueless novices. Thanks, ... Peter E. -- New telephone 1 360 639 0202. Old telephone 1 360 450 2132. bcc: peasthope at shaw.ca Work "http://carnot.yi.org/". "http://members.shaw.ca/peasthope/index.html#Itinerary". |
|
From: Sverre H. <sve...@gm...> - 2011-04-24 20:47:51
|
Hi. Since videodev.h was removed from the linux kernel 2.6.38 and I could not compile the vloopback that coriander uses/recomends ( http://www.lavrsen.dk/foswiki/bin/view/Motion/VideoFourLinuxLoopbackDevice ) I made it work with the V4L2 ( http://code.google.com/p/v4l2loopback/ ) It seems to work but this was a quick fix I did. So anyhow patch attached (this was against git aec43533bdaf3477ad7660a5683638872801e6c0) configure.in | 2 +- src/coriander.h | 2 +- src/thread_v4l.c | 51 ++++++++++++++++++++++++++++----------------------- src/thread_v4l.h | 5 ++--- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/configure.in b/configure.in index 9d758a4..4dfff60 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl AC_INIT(configure.in) AC_INIT(coriander, 2.0.1) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE -AM_CONFIG_HEADER(config.h) +dnl AM_CONFIG_HEADER(config.h) AC_ISC_POSIX AC_PROG_CC diff --git a/src/coriander.h b/src/coriander.h index 562005b..0e14ee9 100644 --- a/src/coriander.h +++ b/src/coriander.h @@ -59,7 +59,7 @@ #include <netinet/in.h> #include "definitions.h" -#include "videodev.h" +#include "linux/videodev2.h" // SDL lib #ifdef HAVE_SDLLIB diff --git a/src/thread_v4l.c b/src/thread_v4l.c index 839cc90..ad14536 100644 --- a/src/thread_v4l.c +++ b/src/thread_v4l.c @@ -52,6 +52,8 @@ V4lStartThread(camera_t* cam) info->frame.image=NULL; info->frame.allocated_image_bytes=0; + memset(&info->vid_fmt, 0, sizeof(info->vid_fmt)); + info->vid_fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; // open V4L device info->v4l_dev=-1; @@ -105,8 +107,11 @@ V4lThread(void* arg) v4lthread_info_t *info=NULL; long int skip_counter; float tmp; - struct video_picture p; + struct v4l2_format fmt; + memset(&fmt, 0, sizeof(fmt)); + fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; + v4l_service=(chain_t*)arg; pthread_mutex_lock(&v4l_service->mutex_data); info=(v4lthread_info_t*)v4l_service->data; @@ -127,6 +132,7 @@ V4lThread(void* arg) v4l_service->drop_warning = 0; v4l_service->processed_frames=0; + while (1) { /* Clean cancel handlers */ pthread_mutex_lock(&info->mutex_cancel); @@ -145,12 +151,15 @@ V4lThread(void* arg) if (((v4l_service->current_buffer->frame.color_coding == DC1394_COLOR_CODING_MONO8) || (v4l_service->current_buffer->frame.color_coding == DC1394_COLOR_CODING_RAW8)) && v4l_service->processed_frames==0) { Warning("Setting V4L device to GREY palette"); - if (ioctl(info->v4l_dev,VIDIOCGPICT,&p) < 0) - Error("ioctl(VIDIOCGPICT) error"); - else { - p.palette = VIDEO_PALETTE_GREY; - if (ioctl(info->v4l_dev,VIDIOCSPICT,&p) < 0) - Error("ioctl(VIDIOCSPICT) Error"); + if (ioctl(info->v4l_dev,VIDIOC_G_FMT,&fmt) < 0) { + Error("ioctl(VIDIOC_G_FMT) Error"); + } else { + fmt.fmt.pix.width=v4l_service->current_buffer->frame.size[0]; + fmt.fmt.pix.height=v4l_service->current_buffer->frame.size[1]; + fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_GREY; + if (ioctl(info->v4l_dev,VIDIOC_S_FMT,&fmt) < 0) { + Error("ioctl(VIDIOC_S_FMT) Error"); + } } } @@ -255,7 +264,6 @@ V4lStopThread(camera_t* cam) void V4lThreadCheckParams(chain_t *v4l_service) { - v4lthread_info_t *info; info=(v4lthread_info_t*)v4l_service->data; @@ -266,23 +274,20 @@ V4lThreadCheckParams(chain_t *v4l_service) // STOPING THE PIPE MIGHT BE NECESSARY HERE // "start pipe" - if (ioctl (info->v4l_dev, VIDIOCGCAP, &info->vid_caps) == -1) { - perror ("ioctl (VIDIOCGCAP)"); + if (ioctl (info->v4l_dev, VIDIOC_QUERYCAP, &info->vid_caps) == -1) { + perror ("ioctl (VIDIOC_QUERYCAP)"); } - if (ioctl (info->v4l_dev, VIDIOCGPICT, &info->vid_pic)== -1) { - perror ("ioctl VIDIOCGPICT"); - } - info->vid_pic.palette = VIDEO_PALETTE_RGB24; - if (ioctl (info->v4l_dev, VIDIOCSPICT, &info->vid_pic)== -1) { - perror ("ioctl VIDIOCSPICT"); - } - if (ioctl (info->v4l_dev, VIDIOCGWIN, &info->vid_win)== -1) { - perror ("ioctl VIDIOCGWIN"); + + if (ioctl (info->v4l_dev, VIDIOC_G_FMT, &info->vid_fmt)== -1) { + perror ("ioctl VIDIOC_G_FMT"); } - info->vid_win.width=v4l_service->current_buffer->frame.size[0]; - info->vid_win.height=v4l_service->current_buffer->frame.size[1]; - if (ioctl (info->v4l_dev, VIDIOCSWIN, &info->vid_win)== -1) { - perror ("ioctl VIDIOCSWIN"); + + info->vid_fmt.fmt.pix.width=v4l_service->current_buffer->frame.size[0]; + info->vid_fmt.fmt.pix.height=v4l_service->current_buffer->frame.size[1]; + info->vid_fmt.fmt.pix.pixelformat=V4L2_PIX_FMT_RGB24; + + if (ioctl (info->v4l_dev, VIDIOC_S_FMT, &info->vid_fmt)== -1) { + perror ("ioctl VIDIOC_S_FMT"); } } diff --git a/src/thread_v4l.h b/src/thread_v4l.h index 91710f7..0551e1d 100644 --- a/src/thread_v4l.h +++ b/src/thread_v4l.h @@ -30,9 +30,8 @@ typedef struct dc1394video_frame_t frame; //unsigned char *v4l_buffer; - struct video_capability vid_caps; - struct video_window vid_win; - struct video_picture vid_pic; + struct v4l2_capability vid_caps; + struct v4l2_format vid_fmt; } v4lthread_info_t; |