summaryrefslogtreecommitdiffstats
path: root/sys/v4l2/v4l2_calls.c
Commit message (Collapse)AuthorAgeFilesLines
* v4l2src: add support for mpeg formatsWim Taymans2009-09-071-7/+13
|
* v4l2: Add v4l2sink elementRob Clark2009-08-041-1/+16
| | | | | | | | | | | This also does the following changes: (1) pull the bufferpool code out into gstv4l2bufferpool.c, and make a bit more generic so it can be used both for v4l2src and v4l2sink (2) move some of the device probing/configuration/caps stuff into gstv4l2object.c so it does not have to be duplicated between v4l2src and v4l2sink Fixes bug #590280.
* v4l2: Fix v4l2src on OpenSolarisElaine Xiong2009-07-191-0/+2
| | | | | | | | The v4l2 driver for USB webcams on OpenSolaris does not support select() calls. Detect when select() fails, and skip polling the device afterward, which restores the pre 0.10.14 behaviour on OpenSolaris. Signed-off-by: Jan Schmidt <thaytan@noraisin.net>
* v4l2src: set structs to zero before using them in ioctlsStefan Kost2009-06-251-5/+5
| | | | This fixes valgrind warnings.
* Fix compiler warningsJames Andrewartha2009-05-151-3/+4
| | | | Fixes bug #582715.
* v4l2src: Prepend to lists and reverse them at the end.Jan Schmidt2009-03-131-3/+7
| | | | | Gratuitous micro-optimisation - prepend to lists and reverse them, rather than appending to them each time.
* Wait for a frame to become available before capturing itSjoerd Simons2009-03-011-0/+8
| | | | | | | | | | Use GstPoll to wait for the fd of the video device to become readable before trying to capture a frame. This speeds up stopping v4l2src a lot as it no longer has to wait for the next frame, especially when capturing with low framerates or when the video device just never generates a frame (which seems a common issue for uvcvideo devices) Fixes bug #563574.
* sys/: Fix some spelling mistakes. Fixes #556802.Fabricio Godoy2008-11-131-1/+1
| | | | | | | | | | Original commit message from CVS: Patch by: Fabricio Godoy <skarllot at gmail dot com> * sys/oss/gstosssink.c: (gst_oss_sink_open): * sys/oss/gstosssrc.c: (gst_oss_src_open): * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_mmap): * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): Fix some spelling mistakes. Fixes #556802.
* Optionally use libv4l to access v4l2 devices. Fixes bug #545033.Bastien Nocera2008-11-041-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Original commit message from CVS: Patch by: Bastien Nocera <hadess at hadess dot net>, Hans de Goede <jwrdegoede at fedoraproject dot org> * configure.ac: * sys/v4l2/Makefile.am: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_read): * sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities), (gst_v4l2_fill_lists), (gst_v4l2_open), (gst_v4l2_close), (gst_v4l2_get_norm), (gst_v4l2_set_norm), (gst_v4l2_get_frequency), (gst_v4l2_set_frequency), (gst_v4l2_signal_strength), (gst_v4l2_get_attribute), (gst_v4l2_set_attribute), (gst_v4l2_get_input), (gst_v4l2_set_input): * sys/v4l2/v4l2_calls.h: * sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize), (gst_v4l2_buffer_new), (gst_v4l2_buffer_pool_finalize), (gst_v4l2_buffer_pool_new), (gst_v4l2_buffer_pool_activate), (gst_v4l2src_fill_format_list), (gst_v4l2src_probe_caps_for_format_and_size), (gst_v4l2src_probe_caps_for_format), (gst_v4l2src_grab_frame), (gst_v4l2src_set_capture), (gst_v4l2src_capture_init), (gst_v4l2src_capture_start), (gst_v4l2src_capture_stop), (gst_v4l2src_get_nearest_size): Optionally use libv4l to access v4l2 devices. Fixes bug #545033.
* sys/v4l2/: Fix memory leaks. Small code cleanups : No need for empty ↵Stefan Kost2008-08-261-2/+3
| | | | | | | | | | | | | _init(). No need to memset instance structures. ... Original commit message from CVS: * sys/v4l2/gstv4l2object.c: * sys/v4l2/gstv4l2src.c: * sys/v4l2/gstv4l2src.h: * sys/v4l2/v4l2_calls.c: * sys/v4l2/v4l2src_calls.c: Fix memory leaks. Small code cleanups : No need for empty _init(). No need to memset instance structures. Some more FIXME's.
* sys/v4l2/v4l2_calls.c: Don't include unused gstv4l2xoverlay.h. Fixes build ↵Tim-Philipp Müller2008-06-261-0/+2
| | | | | | | | | in case where X11 headers are not installed. Original commit message from CVS: * sys/v4l2/v4l2_calls.c:: Don't include unused gstv4l2xoverlay.h. Fixes build in case where X11 headers are not installed.
* sys/v4l2/: Fix compilation with newer GIT kernels that deprecatedBastien Nocera2008-06-091-0/+21
| | | | | | | | | Original commit message from CVS: Patch by: Bastien Nocera <hadess at hadess dot net> * sys/v4l2/gstv4l2vidorient.c: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): Fix compilation with newer GIT kernels that deprecated V4L2_CID_HCENTER and V4L2_CID_VCENTER. Fixes bug #536317.
* sys/v4l2/v4l2_calls.c: Treat ENOTTY (driver does not implement ioctl) the ↵Jan Schmidt2008-01-311-1/+1
| | | | | | | | | | | | | | | | | same as Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): Treat ENOTTY (driver does not implement ioctl) the same as EINVAL since it implies there are no available standards. * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format), (gst_v4l2src_get_nearest_size): Replace gst_v4l2src_get_size_limits with 2 calls to new function gst_v4l2src_get_nearest_size, and get it to use VIDIOC_S_FMT to probe if the driver does not support VIDIOC_TRY_FMT for whatever reason, and if we aren't yet actively capturing. * sys/v4l2/v4l2src_calls.h: Remove replaced function declaration.
* configure.ac: Detect video4linux headers on Solaris too.Brian Cameron2008-01-211-0/+5
| | | | | | | | | | | | | | Original commit message from CVS: * configure.ac: Detect video4linux headers on Solaris too. * sys/v4l2/gstv4l2colorbalance.h: * sys/v4l2/gstv4l2object.h: * sys/v4l2/v4l2_calls.c: * sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize), (gst_v4l2_buffer_new): Make v4l2 build on Solaris. Patch by: Brian Cameron <brian.cameron at sun dot com> Fixes: #510505
* sys/v4l2/: Init some structs to zero before we pass them to ioctl, which ↵Tim-Philipp Müller2007-12-111-3/+3
| | | | | | | | | | avoids valgrind warnings. Also fix a small ... Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_fill_format_list): Init some structs to zero before we pass them to ioctl, which avoids valgrind warnings. Also fix a small memory leak.
* sys/v4l2/gstv4l2src.c: Restructure the setcaps function so that we can also ↵Wim Taymans2007-09-041-18/+40
| | | | | | | | | | | | | | | | | | | | | | | compute the expected GStreamer output siz... Original commit message from CVS: * sys/v4l2/gstv4l2src.c: (gst_v4l2_get_caps_info), (gst_v4l2src_set_caps), (gst_v4l2src_get_mmap): Restructure the setcaps function so that we can also compute the expected GStreamer output size of the video frames. Set frame_byte_size correctly so that read-based devices have a chance of working correctly. When grabbing a frame, discard frames that are not of the expected size. Some cameras don't output the right framesize for the first buffer. Try only a couple of times to get a valid frame, else error out. * sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities), (gst_v4l2_fill_lists), (gst_v4l2_get_input): Add some more debug info when scanning the device. * sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_new), (gst_v4l2_buffer_pool_new), (gst_v4l2_buffer_pool_activate), (gst_v4l2src_fill_format_list), (gst_v4l2src_grab_frame), (gst_v4l2src_set_capture), (gst_v4l2src_capture_init): Add some more debug info when dequeing a frame.
* Printf format fixes; also add some missing quotes in translated strings. ↵Tim-Philipp Müller2007-03-101-3/+3
| | | | | | | | | | | | Fixes #416728 and #416727. Original commit message from CVS: * gst/avi/gstavidemux.c: (gst_avi_demux_parse_subindex), (gst_avi_demux_parse_index): * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_grab_frame): Printf format fixes; also add some missing quotes in translated strings. Fixes #416728 and #416727.
* Fix segfault when oppening a radio device.Edgard Lima2007-02-221-2/+1
| | | | | Original commit message from CVS: Fix segfault when oppening a radio device.
* Improved comments in ELEMENT_ERROR/WARNING and added "#if 0" to xoverlay ↵Edgard Lima2006-11-011-19/+27
| | | | | | | code that is still not implemented. Original commit message from CVS: Improved comments in ELEMENT_ERROR/WARNING and added "#if 0" to xoverlay code that is still not implemented.
* sys/v4l2/: dear stefan, framespersecond is not frameperiod, reverting but ↵Stefan Kost2006-10-171-5/+5
| | | | | | | | | | | adding comment Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_set_fps), (gst_v4l2src_get_fps): dear stefan, framespersecond is not frameperiod, reverting but adding comment
* sys/v4l2/: Numerator is numerator and denominator is denominator. Say that ↵Stefan Kost2006-10-171-6/+6
| | | | | | | | | | | aloud 5 times and retry after next beer. Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_set_fps), (gst_v4l2src_get_fps): Numerator is numerator and denominator is denominator. Say that aloud 5 times and retry after next beer.
* sys/v4l2/: Framerate can be 0/1 too.Wim Taymans2006-09-281-0/+9
| | | | | | | | | | | Original commit message from CVS: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_all_caps), (gst_v4l2src_get_caps): * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): Framerate can be 0/1 too. Init framerate to 0/1 before querying it so that we can detect devices that don't know about a framerate. Add some more debugging info.
* sys/v4l2/: Renamed some properties to match the tuner interface naming.Wim Taymans2006-09-271-11/+12
| | | | | | | | | | | | | | | | | | | | | Original commit message from CVS: * sys/v4l2/gstv4l2object.c: (gst_v4l2_object_install_properties_helper), (gst_v4l2_object_new), (gst_v4l2_object_set_property_helper), (gst_v4l2_object_get_property_helper), (gst_v4l2_set_defaults): * sys/v4l2/gstv4l2object.h: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init), (gst_v4l2src_create): * sys/v4l2/gstv4l2tuner.c: (gst_v4l2_tuner_contains_channel), (gst_v4l2_tuner_list_channels), (gst_v4l2_tuner_set_channel_and_notify), (gst_v4l2_tuner_get_channel), (gst_v4l2_tuner_contains_norm), (gst_v4l2_tuner_list_norms), (gst_v4l2_tuner_set_norm_and_notify), (gst_v4l2_tuner_get_norm): * sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities), (gst_v4l2_fill_lists), (gst_v4l2_empty_lists): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_get_fps): Renamed some properties to match the tuner interface naming.
* Small cleanups.Wim Taymans2006-09-271-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Original commit message from CVS: * sys/v4l2/gstv4l2object.c: (gst_v4l2_object_set_property_helper), (gst_v4l2_set_defaults): * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_read), (gst_v4l2src_create): * sys/v4l2/gstv4l2xoverlay.c: (gst_v4l2_xoverlay_open): * sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities), (gst_v4l2_fill_lists), (gst_v4l2_open), (gst_v4l2_set_norm), (gst_v4l2_get_frequency), (gst_v4l2_set_frequency), (gst_v4l2_signal_strength), (gst_v4l2_get_attribute), (gst_v4l2_set_attribute), (gst_v4l2_get_input), (gst_v4l2_set_input): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_fill_format_list), (gst_v4l2src_grab_frame), (gst_v4l2src_get_capture), (gst_v4l2src_set_capture), (gst_v4l2src_capture_init), (gst_v4l2src_capture_start), (gst_v4l2src_capture_stop), (gst_v4l2src_buffer_new): * tests/icles/v4l2src-test.c: (my_bus_callback), (main): Small cleanups. Fix error messages. Use locks when getting timestamps. Fix leaks in test. Add licensing header to tests.
* Some cleanups and comments.Edgard Lima2006-09-271-147/+73
| | | | | Original commit message from CVS: Some cleanups and comments.
* sys/v4l2/: Fix pass at code cleanups, move errors cases out of the normal ↵Wim Taymans2006-09-261-95/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flow for additional code clarity. Original commit message from CVS: * sys/v4l2/gstv4l2object.c: (gst_v4l2_class_probe_devices), (gst_v4l2_probe_needs_probe), (gst_v4l2_object_install_properties_helper), (gst_v4l2_object_new), (gst_v4l2_object_destroy), (gst_v4l2_object_set_property_helper), (gst_v4l2_object_get_property_helper), (gst_v4l2_set_defaults), (gst_v4l2_object_start), (gst_v4l2_object_stop): * sys/v4l2/gstv4l2object.h: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init), (gst_v4l2src_init), (gst_v4l2src_dispose), (gst_v4l2src_set_property), (gst_v4l2src_get_property), (gst_v4l2src_fixate), (gst_v4l2src_get_caps), (gst_v4l2src_set_caps), (gst_v4l2src_get_read), (gst_v4l2src_get_mmap), (gst_v4l2src_create): * sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities), (gst_v4l2_open), (gst_v4l2_close), (gst_v4l2_get_norm), (gst_v4l2_set_norm), (gst_v4l2_get_frequency), (gst_v4l2_set_frequency), (gst_v4l2_signal_strength), (gst_v4l2_get_attribute), (gst_v4l2_set_attribute), (gst_v4l2_get_input), (gst_v4l2_set_input): * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_fill_format_list), (gst_v4l2src_queue_frame), (gst_v4l2src_grab_frame), (gst_v4l2src_get_capture), (gst_v4l2src_set_capture), (gst_v4l2src_capture_init), (gst_v4l2src_capture_start), (gst_v4l2src_capture_stop), (gst_v4l2src_capture_deinit), (gst_v4l2src_get_size_limits), (gst_v4l2src_set_fps), (gst_v4l2src_get_fps), (gst_v4l2src_buffer_finalize), (gst_v4l2src_buffer_new): Fix pass at code cleanups, move errors cases out of the normal flow for additional code clarity.
* The test application and the plgind error messages has been improved.Edgard Lima2006-09-151-64/+68
| | | | | Original commit message from CVS: The test application and the plgind error messages has been improved.
* sys/v4l2/: Cleanup error messages and unify header commentsStefan Kost2006-09-021-7/+10
| | | | | | | | | | | | | | | | | | | | | | Original commit message from CVS: * sys/v4l2/gstv4l2.c: * sys/v4l2/gstv4l2colorbalance.c: * sys/v4l2/gstv4l2colorbalance.h: * sys/v4l2/gstv4l2object.c: * sys/v4l2/gstv4l2object.h: * sys/v4l2/gstv4l2src.c: * sys/v4l2/gstv4l2src.h: * sys/v4l2/gstv4l2tuner.c: * sys/v4l2/gstv4l2tuner.h: * sys/v4l2/gstv4l2xoverlay.c: (gst_v4l2_xoverlay_open): * sys/v4l2/gstv4l2xoverlay.h: * sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities), (gst_v4l2_open): * sys/v4l2/v4l2_calls.h: * sys/v4l2/v4l2src_calls.c: (gst_v4l2src_queue_frame), (gst_v4l2src_capture_init): * sys/v4l2/v4l2src_calls.h: Cleanup error messages and unify header comments
* sys/v4l2/v4l2_calls.c: add comments and more debug loggingStefan Kost2006-08-281-4/+16
| | | | | | Original commit message from CVS: * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): add comments and more debug logging
* Changes proposed by Wingo in bug #338818.Edgard Lima2006-05-111-187/+217
| | | | | Original commit message from CVS: Changes proposed by Wingo in bug #338818.
* Some changes proposed by wingo in bug #338818 (but not everything yet). ↵Martin Rubli2006-05-051-112/+12
| | | | | | | Patch from Martin Rubli to fix framerate dete... Original commit message from CVS: Some changes proposed by wingo in bug #338818 (but not everything yet). Patch from Martin Rubli to fix framerate detection.
* Few improvements to move to good.Edgard Lima2006-05-011-22/+31
| | | | | Original commit message from CVS: Few improvements to move to good.
* Just make few things more robust and also some identation.Edgard Lima2006-03-251-15/+33
| | | | | Original commit message from CVS: Just make few things more robust and also some identation.
* V4L2 ported to 0.10.Edgard Lima2006-03-111-118/+124
| | | | | Original commit message from CVS: V4L2 ported to 0.10.
* expand tabsThomas Vander Stichele2005-12-061-3/+3
| | | | | Original commit message from CVS: expand tabs
* sys/v4l2/gstv4l2element.c: Flag typo.Ronald S. Bultje2004-10-241-8/+11
| | | | | | | | Original commit message from CVS: * sys/v4l2/gstv4l2element.c: (gst_v4l2element_get_property): Flag typo. * sys/v4l2/v4l2_calls.c: (gst_v4l2_set_defaults): No warnings.
* gst-libs/gst/tuner/tunerchannel.h: - add a freq_multiplicator field to make ↵Stéphane Loeuillet2004-05-311-4/+12
| | | | | | | | | | | | | | | | the conversion between internal frequency... Original commit message from CVS: * gst-libs/gst/tuner/tunerchannel.h: - add a freq_multiplicator field to make the conversion between internal frequency unit and Hz * sys/v4l/gstv4lelement.c: * sys/v4l2/gstv4l2element.c: - change default video device to /dev/video0 * sys/v4l/v4l_calls.c: * sys/v4l2/v4l2_calls.c: - we only expose frequency to the user in Hz instead of bastard v4lX unit (either 62.5kHz or 62.5Hz)
* don't mix tabs and spacesThomas Vander Stichele2004-03-151-116/+116
| | | | | Original commit message from CVS: don't mix tabs and spaces
* gst-indentThomas Vander Stichele2004-03-141-486/+456
| | | | | Original commit message from CVS: gst-indent
* change NULL to (NULL) for GST_ELEMENT_ERRORThomas Vander Stichele2004-02-021-20/+20
| | | | | | Original commit message from CVS: change NULL to (NULL) for GST_ELEMENT_ERROR Make sure errors end with "."
* GST_ELEMENT_ERRORThomas Vander Stichele2004-01-291-20/+20
| | | | | Original commit message from CVS: GST_ELEMENT_ERROR
* putting i18n in place for pluginsThomas Vander Stichele2004-01-191-18/+18
| | | | | Original commit message from CVS: putting i18n in place for plugins
* updating v4l2 for new error handlingThomas Vander Stichele2004-01-191-60/+63
| | | | | Original commit message from CVS: updating v4l2 for new error handling
* sys/v4l2/: add norm, channel and frequency properties.Benjamin Otte2004-01-121-1/+47
| | | | | | | | | | | | | | | | | | | Original commit message from CVS: 2004-01-12 Benjamin Otte <in7y118@public.uni-hamburg.de> * sys/v4l2/gstv4l2element.c: (gst_v4l2element_class_init), (gst_v4l2element_dispose), (gst_v4l2element_set_property), (gst_v4l2element_get_property): * sys/v4l2/v4l2_calls.c: (gst_v4l2_set_defaults), (gst_v4l2_open): add norm, channel and frequency properties. * sys/v4l2/gstv4l2tuner.c: fixes for tuner interface changes * sys/v4l2/gstv4l2element.h: * sys/v4l2/gstv4l2src.c: * sys/v4l2/gstv4l2src.h: * sys/v4l2/v4l2src_calls.c: * sys/v4l2/v4l2src_calls.h: rework v4l2src to work with saa1734 cards and allow mmaped buffers.
* Proper device-capabilities check when openingRonald S. Bultje2003-11-101-0/+11
| | | | | Original commit message from CVS: Proper device-capabilities check when opening
* Oops, input <-> output confusionRonald S. Bultje2003-10-261-1/+1
| | | | | Original commit message from CVS: Oops, input <-> output confusion
* Some interface implementations for video4linux/video4linux2 plugins: a Tuner ↵Ronald S. Bultje2003-10-101-273/+206
| | | | | | | | | | | | | | | | | | | | | | interface, with which one can select inp... Original commit message from CVS: Some interface implementations for video4linux/video4linux2 plugins: * a Tuner interface, with which one can select inputs and stations. Audio work is underway here, but unfinished. * A Xoverlay interface with which one can do simple overlay. Similar to the API of the v4l/Xv XFree86 extension. Widget implementation for GTK-2.0 coming up in the sandbox. * Colorbalance - for adapting colors (brightness, contrast, etc.) - pretty basic and maybe somewhat overdesigned. But it'll do for now. Apart from these interfaces, there's also a loadable library 'xwindowlistener' that listenes to X for the movement of a window and the overlap of other windows. This is partly copied from xawtv (and thus partly GPL :(), but it's needed for the xoverlay interface implementation in the v4l/v4l2 elements. Lastly, some small changes to remove redundant properties from the v4l/v4l2 elements since these can be done much simpler. Comments appreciated!
* Fix missing config.h and unistd.h includes which were apparently removed ↵Ronald S. Bultje2003-07-031-0/+1
| | | | | | | from gst/gst.h recently Original commit message from CVS: Fix missing config.h and unistd.h includes which were apparently removed from gst/gst.h recently
* compatibility fix for new GST_DEBUG stuff.Benjamin Otte2003-06-291-1/+1
| | | | | | | | Original commit message from CVS: compatibility fix for new GST_DEBUG stuff. Includes fixes for missing includes for config.h and unistd.h I only ensured for plugins I can build that they work, so if some of them are still broken, you gotta fix them yourselves unfortunately.
* Unification of the way to speak to v4l2 and v4l elements... Also fix a ↵Ronald S. Bultje2003-03-021-153/+91
| | | | | | | segfautl when doing gst-inspect v4l2src Original commit message from CVS: Unification of the way to speak to v4l2 and v4l elements... Also fix a segfautl when doing gst-inspect v4l2src