Skip to content
Commit ddee436d authored by Bastien Nocera's avatar Bastien Nocera
Browse files

Fix warning when v4l device doesn't have a path

 #0  0x00007ffff7e4cf77 in g_logv () at /lib64/libglib-2.0.so.0
 #1  0x00007ffff7e4d233 in g_log () at /lib64/libglib-2.0.so.0
 #2  0x00007ffff7f6b37b in g_value_dup_string () at /lib64/libgobject-2.0.so.0
 #3  0x00007ffff7fb601c in cheese_camera_device_set_property (object=0x6c4360, prop_id=3, value=0x7fffffffc6a0, pspec=0x6c6a40) at ../../../../Projects/jhbuild/cheese/libcheese/cheese-camera-device.c:635
 #4  0x00007ffff7f50a46 in object_set_property () at /lib64/libgobject-2.0.so.0
 #5  0x00007ffff7f50e14 in g_object_new_internal () at /lib64/libgobject-2.0.so.0
 #6  0x00007ffff7f522c8 in g_object_new_valist () at /lib64/libgobject-2.0.so.0
 #7  0x00007ffff7a5921e in g_initable_new_valist () at /lib64/libgio-2.0.so.0
 #8  0x00007ffff7a592ed in g_initable_new () at /lib64/libgio-2.0.so.0
 #9  0x00007ffff7fb674e in cheese_camera_device_new (device=0x7fffec0058c0, error=0x7fffffffcc28) at ../../../../Projects/jhbuild/cheese/libcheese/cheese-camera-device.c:781
 #10 0x00007ffff7fb6e68 in cheese_camera_device_monitor_set_up_device (device=0x7fffec0058c0) at ../../../../Projects/jhbuild/cheese/libcheese/cheese-camera-device-monitor.c:96
 #11 cheese_camera_device_monitor_added (monitor=0x6c7c20, device=0x7fffec0058c0) at ../../../../Projects/jhbuild/cheese/libcheese/cheese-camera-device-monitor.c:117
 #12 0x00007ffff7fb7058 in cheese_camera_device_monitor_add_devices (data=0x7fffec0058c0, user_data=<optimized out>) at ../../../../Projects/jhbuild/cheese/libcheese/cheese-camera-device-monitor.c:189
 #13 0x00007ffff7e42840 in g_list_foreach () at /lib64/libglib-2.0.so.0
 #14 0x00007ffff7fb7311 in cheese_camera_device_monitor_coldplug (monitor=0x6c7c20) at ../../../../Projects/jhbuild/cheese/libcheese/cheese-camera-device-monitor.c:221
 #15 0x0000000000401d4f in cameradevicemonitor_create () at ../../../../Projects/jhbuild/cheese/tests/test-libcheese.c:39
 #16 0x00007ffff7e71bd6 in g_test_run_suite_internal () at /lib64/libglib-2.0.so.0
 #17 0x00007ffff7e718fb in g_test_run_suite_internal () at /lib64/libglib-2.0.so.0
 #18 0x00007ffff7e718fb in g_test_run_suite_internal () at /lib64/libglib-2.0.so.0
 #19 0x00007ffff7e720aa in g_test_run_suite () at /lib64/libglib-2.0.so.0
 #20 0x00007ffff7e720d1 in g_test_run () at /lib64/libglib-2.0.so.0
 #21 0x00000000004012b8 in main (argc=<optimized out>, argv=<optimized out>) at ../../../../Projects/jhbuild/cheese/tests/test-libcheese.c:231

The api.v4l2.path might not always be available, so avoid using it when
not present.

gst-device-monitor-1.0 on my system:

	name  : USB2.0 FHD UVC WebCam: USB2.0 F
	class : Video/Source
	caps  : video/x-raw, format=YUY2, width=640, height=480, pixel-aspect-ratio=1/1, framerate=30/1
	        video/x-raw, format=YUY2, width=640, height=360, pixel-aspect-ratio=1/1, framerate=30/1
	        video/x-raw, format=YUY2, width=352, height=288, pixel-aspect-ratio=1/1, framerate=30/1
	        video/x-raw, format=YUY2, width=320, height=240, pixel-aspect-ratio=1/1, framerate=30/1
	        video/x-raw, format=YUY2, width=176, height=144, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=1920, height=1080, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=1280, height=720, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=848, height=480, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=640, height=480, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=640, height=360, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=352, height=288, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=320, height=240, pixel-aspect-ratio=1/1, framerate=30/1
	        image/jpeg, width=176, height=144, pixel-aspect-ratio=1/1, framerate=30/1
	properties:
		udev-probed = true
		device.bus_path = pci-0000:00:14.0-usb-0:1.4:1.0
		sysfs.path = /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.4/1-1.4:1.0/video4linux/video0
		device.bus = usb
		device.subsystem = video4linux
		device.vendor.id = 04f2
		device.vendor.name = "SunplusIT\\x20Inc"
		device.product.id = b612
		device.product.name = "USB2.0\ FHD\ UVC\ WebCam:\ USB2.0\ F"
		device.serial = SunplusIT_Inc_USB2.0_FHD_UVC_WebCam_01.00.00
		device.capabilities = :capture:
		device.api = v4l2
		device.path = /dev/video0
		v4l2.device.driver = uvcvideo
		v4l2.device.card = "USB2.0\ FHD\ UVC\ WebCam:\ USB2.0\ F"
		v4l2.device.bus_info = usb-0000:00:14.0-1.4
		v4l2.device.version = 331538 (0x00050f12)
		v4l2.device.capabilities = 2225078273 (0x84a00001)
		v4l2.device.device_caps = 69206017 (0x04200001)
	gst-launch-1.0 v4l2src ! ...

Fixes: 9f0825c3
parent 07ed58cd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment