#2 raw1394_new_handle_on_device("/dev/raw1394")

open
nobody
None
5
2005-11-14
2005-11-14
Hans Schou
No

Hi

I have tried to use libraw1394 together with dvgrab and
found
a thing I would like to change. What is the procedure
for doing that?

The problem is that function raw1394_new_handle() has
hard-coded
the device name "/dev/raw1394". This give to problems.
On systems
where the device name is different from the hard-coded
name,
the device will fail to open. This is the case when
using "udev"
as the name is "/dev/raw/raw1394". One way to remove
the symptom
is by making a symlink but this require that the admin
knows
more about the wrong device name. When using dvgrab,
the error
messages is just something like "file not found" and
the end
user does not get any hint about what is wrong.

Another problem is when the end user has two firewire
devices.
In that case it is not possible to specify which device
to use.

I suggest that the function raw1394_new_handle(void)
should be
removed and replaced with
raw1394_new_handle_on_device(char *name) - or simply
just rename the function.

Line 125 in main.c should then be changed from
handle->fd = open("/dev/raw1394", O_RDWR);
to
handle->fd = open(name, O_RDWR);

There is a few lines more which has to be changed and I
would
send a patch file if you like and agree to this change.

Developers should then be instructed to this simple change:
p = raw1394_new_handle();
should be changed to:
p = raw1394_new_handle_on_device("/dev/raw1394");
or put the device name in a variable in a config file.

best regards/hans schou

Discussion