Commit graph

259 commits

Author SHA1 Message Date
Tim-Philipp Müller
5290b514c8 v4l2: fix unportable printf format 2010-02-01 09:18:53 +00:00
Stefan Kost
21a8cb1e06 v4l2src: don't deref NULL
Error out when the pool gets shutdown.
2010-01-25 17:23:43 +02:00
Stefan Kost
8576a11dae Revert "v4l2src: don't deref NULL"
This reverts commit 3d9d34bd60.
2010-01-25 17:21:13 +02:00
Stefan Kost
3d9d34bd60 v4l2src: don't deref NULL
Error out when the pool gets shutdown.
2010-01-25 14:16:22 +02:00
Stefan Kost
30b2cd42c5 v4l2: move G_END_DECLS to the end 2010-01-18 14:57:42 +02:00
Stefan Kost
e789d2253f v4l2: fix bufferpool file names in header comment 2010-01-18 14:55:38 +02:00
Tim-Philipp Müller
d68689255d v4l2src: fix memory leak in new uri handler code
Don't leak a string everytime get_uri() is called and a device
has been set. There's a limited number of devices, so just
intern the string instead of doing more elaborate housekeeping
and storing it in the instance struct or so.
2010-01-05 09:49:16 +00:00
Edward Hervey
121c001437 v4l2src: Add GstURIHandler interface. Fixes #601143
This allows using v4l2://[<device>]
2009-12-21 13:54:40 +01:00
Sebastian Dröge
7ef43f021b v4l2: Make sure to initialize variables before using them 2009-11-11 10:45:23 +01:00
Thiago Santos
72af90ae31 v4l2src: Set duration on buffers
Use framerate to estimate duration of buffers.

Fixes #590362
2009-10-14 08:00:49 -03:00
Pau Garcia i Quiles
f10435580f v4l2: Include sys/ioctl.h for the V4L ioctl requests
Old videodevice2.h kernel headers used ioctl stuff without
including ioctl.h, making compilation fail on older systems.

Note: Including ioctl.h here is only a workaround for old kernel
headers, should be removed once everybody has new enough headers.

Fixes bug #597867.
2009-10-09 11:34:16 +02:00
Stefan Kost
00ffa9c2dd v4l2src: add a function pointer for get_frame function and optimize a bit
Use a function-pointer for mmap/read, as this can't change during capture. Also
sprinkle a few G_LIKELY/UNLIKELY to improve the error-less code path.
2009-09-11 22:24:47 +03:00
Stefan Kost
1a945a32cc v4l2: log buffer copies on queue underrun in perf category
v4l2src has a slow path where it does buffer-copies when it runs out of queued
buffers. Log this to performance category to help monitoring it.
2009-09-11 22:19:23 +03:00
Stefan Kost
0a68003efe docs: fix gtk-doc warnings 2009-09-10 10:26:23 +03:00
Wim Taymans
5580571f8d whitespace fixes 2009-09-09 10:27:55 +02:00
Wim Taymans
796dec5920 v4l2src: add support for mpeg formats 2009-09-07 18:28:51 +02:00
David Schleef
55d2754098 Remove Ronald Bultje from Authors field
Replaced with "GStreamer maintainers
<gstreamer-devel@lists.sourceforge.net>" or just removed,
depending on the number of other authors.
2009-09-05 20:53:10 -07:00
Sebastian Dröge
686f8376a8 v4l2: Define V4L2_FMT_FLAG_EMULATED if it's not defined yet
libv4l2 already uses this flag, even on Linux kernel versions
before 2.6.32.
2009-09-04 09:32:42 +02:00
Sebastian Dröge
0c6fba9506 v4l2: Fix stupid typo in last commit 2009-09-03 20:40:17 +02:00
Sebastian Dröge
4fda384a83 v4l2: Put emulated formats behind native formats
Fixes bug #593764.
2009-09-03 20:39:44 +02:00
Hans de Goede
10d41286d5 v4l2src: fix 'hang' with some cameras caused by bad timestamping if no framerate is available
For cameras/drivers that don't support e.g. VIDIOC_G_PARM we'd end up without
a framerate and would try to divide by 0, causing run-time warnings and all
frames to be timestamped with 0, which makes sinks that sync against the clock
drop them, causing 'hangs' (observed with the pwc driver and a Logitech QuickCam
Pro 4000). So if we do not know the framerate, simply don't adjust the
timestamps. Fixes #591451.
2009-08-14 13:30:31 +01:00
Filippo Argiolas
a3a61f8940 v4l2src: clear format list in READY->NULL
Clear format list and probed caps when going to NULL so if a new device
is set we'll probe the formats again instead of using previously
detected ones. Fixes bug #591747.
2009-08-14 10:15:43 +02:00
Tim-Philipp Müller
9590df3c2e v4l2: fix make distcheck by disting some more headers 2009-08-11 03:08:01 +01:00
Tim-Philipp Müller
8c8e6af45b v4l2src: if max == min width/height put an int in the probed caps, not an int range
Fixes #560033.
2009-08-09 14:19:42 +01:00
Sebastian Dröge
198604c108 v4l2: Directly use GST_PTR_FORMAT for printing caps with the LOG_CAPS macro 2009-08-04 14:45:31 +02:00
Sebastian Dröge
23dbb15ff5 v4l2: Remove some OMAP specific hacks
They require special build flags and are not useful in general.
2009-08-04 09:32:07 +02:00
Rob Clark
99e2ac121d v4l2sink: change where buffers get dequeued
It seems to cause strange occasional high latencies (almost 200ms) when dequeuing buffers from _buffer_alloc().  It is simpler and seems to work much better to dqbuf from the same thread that is queuing the next buffer.
2009-08-04 09:22:29 +02:00
Rob Clark
f19cfbda96 v4l2: Add v4l2sink element
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.
2009-08-04 09:16:56 +02:00
Elaine Xiong
085f87d85f v4l2: Fix v4l2src on OpenSolaris
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>
2009-07-19 11:42:13 +01:00
Filippo Argiolas
946c20a8ba v4l2src: optional support for device probing with gudev
Enumerate v4l2 devices using gudev if available.

Fixes bug #583640.
2009-07-13 16:16:05 +02:00
Stefan Kost
5d256c201f v4l2src: set structs to zero before using them in ioctls
This fixes valgrind warnings.
2009-06-25 19:44:21 +03:00
Stefan Kost
0b475ba774 v4l2: open/close the device in READY
This allows to query the device in READY. Before one need to switch it to PAUSED
and that also starts streaming.
2009-06-22 16:24:46 +03:00
Stefan Kost
751f7fc5f8 v4l2: cleanup and commenting
Remove newlines inserted by gst-indent once. Remove unused var from instance
struct. Add comments. Add another #define for default property value.
2009-05-26 16:29:46 +03:00
James Andrewartha
2410cd7a00 Fix compiler warnings
Fixes bug #582715.
2009-05-15 15:14:52 +02:00
Stefan Kost
ad5702d492 v4l2src: move duplicated timestamping and buffer metadata code to _create()
This will include the latency changes also in the mmap case.
2009-03-25 10:08:41 +02:00
Stefan Kost
652a7fb91f v4l2src: remove win32 ifdefs introduced by commit cff3f46760eac74c9bbd7a36aca44fedf327424b
V4l2src is under sys and does not exists/run under windows anyway.
2009-03-25 10:06:48 +02:00
Stefan Kost
1d16c9cc27 v4l2src: log details if we have them, needed for #575391 2009-03-15 23:26:56 +02:00
Jan Schmidt
a32581abee v4l2src: Prepend to lists and reverse them at the end.
Gratuitous micro-optimisation - prepend to lists and reverse them, rather
than appending to them each time.
2009-03-13 15:43:52 +00:00
Stefan Kost
f86b485f3b v4l2src: fix pads, so that they are subset of template caps
Do not add w=0 | h=0. When we can't get a framerate add fraction range.
2009-03-06 21:57:53 +02:00
Sjoerd Simons
b6755a7000 Wait for a frame to become available before capturing it
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.
2009-03-01 19:55:26 +01:00
Wim Taymans
04359c8382 Conditionally compile code for YVYU
Only compile the code for the YVYU format when the format is actually defined.
Spotted by tmatth on IRC.
2009-02-23 19:53:58 +01:00
Levente Farkas
d2fc4cb3ba v4l2src: Make sort_by_frame_size conditionally compiled
sort_by_frame_size is declared static and only used inside
an ifdef, so use the same ifdef to define the function.  Fixes #572185

Signed-off-by: David Schleef <ds@schleef.org>
2009-02-23 09:20:49 -08:00
Wim Taymans
42c8aa7abc Add YVYU format to caps
Add YVYU format to the caps. We don't have anything to handle these caps yet,
though.
2009-02-23 17:05:43 +01:00
Brijesh Singh
74f84ae47f Fix comparison of the tuner norms
The V4L2 tuner norms that a device supports could
be a subset of some norm (e.g. NTSC instead of NTSC_M).
The comparison should be done by & instead of ==.

See http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#STANDARD

Fixes bug #569820.
2009-01-30 14:42:44 +01:00
Stefan Kost
8e462968cf Remove version numbers from a few gst-launch examples.
The majority of the examples doe not use -0.10 and this will also help us to maintain the docs.
2009-01-29 11:07:59 +02:00
Stefan Kost
6335307b97 Update and add documentation for platform specific plugins (sys).
Link to properties. Correct titles for examples. Fix examples.
2009-01-29 10:12:43 +02:00
Tim-Philipp Müller
6c565d2ee1 sys/v4l2/gstv4l2src.c: Fix error code (the message string also needs love, but not today).
Original commit message from CVS:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_read):
Fix error code (the message string also needs love, but not today).
2009-01-20 15:33:05 +00:00
Jan Schmidt
90e9d8e0e1 sys/v4l2/gstv4l2src.c: Remove () from translateable string, so that it makes more sense.
Original commit message from CVS:
* sys/v4l2/gstv4l2src.c:
Remove () from translateable string, so that it makes more sense.
2009-01-07 16:09:47 +00:00
Sascha Hauer
d576b9fdbe sys/v4l2/gstv4l2src.c: Add support for grayscale v4l2 devices. Fixes bug #566616.
Original commit message from CVS:
Patch by: Sascha Hauer <s dot hauer at pengutronix dot de>
Luotao Fu <l dot fu at pengutronix dot de>
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_v4l2fourcc_to_structure),
(gst_v4l2_get_caps_info):
Add support for grayscale v4l2 devices. Fixes bug #566616.
2009-01-05 12:30:40 +00:00
Tim-Philipp Müller
2e0d8e8b93 sys/v4l2/v4l2src_calls.c: Turns out we don't always get the frame sizes in a predefined order from lowest to highest ...
Original commit message from CVS:
* sys/v4l2/v4l2src_calls.c:
(gst_v4l2src_probe_caps_for_format_and_size), (sort_by_frame_size),
(gst_v4l2src_probe_caps_for_format):
Turns out we don't always get the frame sizes in a predefined
order from lowest to highest resolution, so let's just sort the
list by frame size once we've queried the possible resolutions
rather than assume any particular order. Fixes probed caps for
the camera in my HP2133 mini notebook and makes v4l2src default
to a decent size.
2008-11-17 14:04:20 +00:00