Kopete videodevice fixes #34
Merged
blu.256
merged 1 commits from fix/kopete-webcam
into master
3 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'fix/kopete-webcam'
Deleting a branch is permanent. It CANNOT be undone. Continue?
A number of fixes to Kopete's webcam support.
There is a problem using
__LINUX_VIDEODEV2_H
see comment.#define CLEAR(x) memset (&(x), 0, sizeof (x))
#define STRINGIZE_(x) #x
#define STRINGIZE(x) STRINGIZE_(x)
Please, that's really needed? I don't see use in code.
Sorry, this was accidentally left there from my debugging attempts.
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)
#ifdef V4L2_CAP_VIDEO_CAPTURE
#if defined(__LINUX_VIDEODEV2_H) /* V4L2 */
It seems to rely on defining
__LINUX_VIDEODEV2_H
is a problem. There is a layer on FreeBSD that provides compatibility with V4L2 API, but there is defined_UAPI__LINUX_VIDEODEV2_H
. WhereinV4L2_CAP_VIDEO_CAPTURE
is defined.const TQString videodevice_dir_filter=TQString::fromLocal8Bit("video*");
// Check *video* symlinks in /dev/v4l/by-id
const TQString videodevice_dir_path=TQString::fromLocal8Bit("/dev/v4l/by-id/");
We know what the kernel version has changed this path?
Unfortunately, I do not know what the devices path are used on FreeBSD. Maybe ask Nik on ML.
This is a change in Udev rules (see note) : https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/open.html#v4l2-device-node-naming
Haven't found yet when precisely the change occured, but probably both cases should be present anyway.
Ok, I understand if there are not symlinks in
/dev/v4l/by-id
, will be used/dev/video*
, so it should work in all cases, including FreeBSD.Based on the little information I could find about using video devices with FreeBSD, it seems to use the "standard"
/dev/video?
paths. I can confirm the existence of these same paths on Linux.Probably, due to
/dev/video?
being common on both Linux and FreeBSD this should be the first guess of Kopete::AVDevice, and if this fails, then it should check the probably-Linux-specific/dev/v4l/by-id/*video*
. What do you think?It seems to me as a good idea to start first with Linux way – symlinks
/dev/v4l/by-id/*video*
because they can provide better identification of the device for users. And if they are not available as fallback use/dev/video*
.I think the sensible thing to do is try to detect the avaible path till we find one. I agree with Slavek, start from Linux path first, then BSD, then eventually others.
@SlavekB These quick fixes were mostly based on my attempt to get my videocam working with Kopete (it showed a blue box instead) and I'm sure those require some refinement, that is also why I marked the PR as WIP. Thank you for the feedback. I'll get back to this PR when I have the time.
Great, looking forward for this. I also had a blue box, I remember
WIP: Kopete videodevice fixesto Kopete videodevice fixes 3 years ago238aafe882
tode786a075b
3 years agode786a075b
into master 3 years agoGood work, thank you.
Just for info, in Kopete -> Configure Kopete -> Devices tab, do you see any picture from the camera? I am testing in a VB box and I see just a black square, but I guess it could be because of VB. Just trying to undertand better.
Yes with the fix I see the picture from my webcam. Before that it did not find any device (drop down menu was empty) and showed a blue box.
I look forward to trying it today on my Pine 😺
I do see a VB camera in the drop down now, but no picture. But as said, it could be virtual box. I will try on another laptop where TDE is installed directly and see how it goes.
Tested on another laptop, works great!! Good work Philippe!!
I can confirm that on my Pine video now works! Although I don't know why two USB Camera devices are shown, but it is a matter between hardware and kernel 😺
Interestingly, it also showed two devices for me. /dev/v4l/by-id/ does in fact contain two devices for the same webcam (not sure why V4L2 does this). The difference between them seems to be, according to debug output from Kopete, that the second one does not have any controls (brightness, gamma, etc.), at least in my case.
I also have two devices, and if I try to select the second one I get a SEGV, both in VB and in the real laptop....
There was also a crash when I chose the second device. Obviously it is not the unusual behavior of my hardware and we should deal with it. For example, find the capabilities of device and exclude from the list that is not possible to use?
Probably yes. Initially I though that it was just my camera, but it seems to be commonplace. I'll try finding a solution when I find time for this.
Probably relevant: https://unix.stackexchange.com/questions/512759/multiple-dev-video-for-one-physical-device
Reviewers
de786a075b
.