Commit graph

153 commits

Author SHA1 Message Date
Julien Isorce
61ae84b50d v4l2: add support for multi-planar V4L2 API
This api is in linux kernel since version 2.6.39,
and present in all version 3.

The commit that adds the API in master branch of the
linux kernel source is:
f8f3914cf9

v4l2 doc: "Some devices require data for each input
or output video frame to be placed in discontiguous
memory buffers"

There are newer structures 'struct v4l2_pix_format_mplane'
and 'struct v4l2_plane'.
So the pixel format is not setup with the same API when using
multi-planar.

Also for gst-v4l2, one of the difference is that in GstV4l2Meta
there are now one mem pointer for each maped plane.

When not using multi-planar, this commit takes care of keeping
the same code path than previously. So that the 2 cases are
in two different blocks triggered from V4L2_TYPE_IS_MULTIPLANAR.

Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=712754
2013-12-04 09:27:20 +00:00
Nicolas Dufresne
90ac945dcc v4l2object: Use space instead of tabs
https://bugzilla.gnome.org/show_bug.cgi?id=712754
2013-11-25 13:44:50 -05:00
Michael Olbrich
f8f2fc3e86 v4l2: clear cached caps on close
A different device with different caps may be used for the next open.

https://bugzilla.gnome.org/show_bug.cgi?id=712611
2013-11-21 14:14:24 -05:00
Tim-Philipp Müller
d506409af5 docs: get rid of 'Since: 0.10.x' markers
And some gtk-doc markup fixes.
2013-11-18 14:47:35 +00:00
Marc Leeman
be01e80e6b v4l2object: print FOURCC_FORMAT when enumerating
https://bugzilla.gnome.org/show_bug.cgi?id=712206
2013-11-13 13:52:49 +01:00
Tim-Philipp Müller
51ff79842d v4l2src: print probed caps as caps again in debug log
This got lost during refactoring.
2013-10-03 18:33:01 +01:00
Olivier Crête
d595c08aca v4l2: Add forward declaration for gst_v4l2_object_get_format_list 2013-08-19 13:19:42 -04:00
Olivier Crête
48caa1712a v4l2: De-duplicate caps probing between src and sink 2013-08-19 13:08:18 -04:00
Michael Olbrich
5c99fefa04 v4l2: don't extract data from caps twice
gst_video_info_from_caps() always extract width, height, interlace mode and
framerate now. It is no longer necessary to do it again for encoded
formats.

https://bugzilla.gnome.org/show_bug.cgi?id=703399
2013-07-02 10:08:46 +02:00
Michael Olbrich
74d217c44b v4l2: improve pixel aspect ratio handling
Instead of just assuming a aspect ratio of 1/1 use VIDIOC_CROPCAP to ask
the device.
This also add a pixel-aspect-ratio property to overwrite the value from the
driver and a force-aspect-ratio property to ignore it.

https://bugzilla.gnome.org/show_bug.cgi?id=700285
2013-06-04 17:37:15 +02:00
Michael Olbrich
0fb59275b0 v4l2: add a property for arbitrary v4l2 controls
This makes it possible to set any controls that can be set with
VIDIOC_S_CTRL.
The controls are set when the property is set (if the device is open)
and when the device is opened.

https://bugzilla.gnome.org/show_bug.cgi?id=698837
2013-05-29 20:18:11 +02:00
Michael Olbrich
00ffe41e6a v4l2: Don't stop streaming when set_caps is called with unchanged caps
This can happen if other parts of the pipeline are reconfigured.
Stop streaming even for a short amount of time can be quite visible, so it
should be avoided if possible.

https://bugzilla.gnome.org/show_bug.cgi?id=700503
2013-05-20 11:13:18 +02:00
Michael Olbrich
57c0f4d6b5 v4l2: only add interlace-mode to the caps for raw formats
https://bugzilla.gnome.org/show_bug.cgi?id=700280
2013-05-14 13:01:27 +02:00
Michael Olbrich
16b0fd5ad9 v4l2: copy and set the actual size of the content
https://bugzilla.gnome.org/show_bug.cgi?id=700282
2013-05-14 12:57:14 +02:00
Michael Olbrich
53da901cc9 v4l2: always generate video info from caps
In the past gst_video_info_from_caps() only video/x-raw. Now it also
supports other video/* and image/* formats.
With this patch the format won't be GST_VIDEO_FORMAT_UNKOWN and
gst_v4l2_buffer_pool_set_config() handles strides correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=699570
2013-05-03 13:14:58 +02:00
Philipp Zabel
4d3f6850ca v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM
Newer kernels return -ENOTTY, older kernels return -EINVAL if the ioctl
is not implemented. With this patch, GStreamer handles both cases.

https://bugzilla.gnome.org/show_bug.cgi?id=698825
2013-05-01 15:34:50 +02:00
Michael Olbrich
bf3a0b7e37 v4l2: fix broken boolean expression to detect non-frame buffers
https://bugzilla.gnome.org/show_bug.cgi?id=699294
2013-04-30 11:47:09 +02:00
Philipp Zabel
fd0123800c v4l2: fix copying of encoded buffers
The existence of a GstVideoFormatInfo does not guarantee, that
the buffer contains video frames, so the format must be checked.

Also, for encoded buffers the length is variable and must be set.

https://bugzilla.gnome.org/show_bug.cgi?id=698949
2013-04-26 15:36:49 +02:00
Michael Olbrich
3466796f10 v4l2: add support for mpeg4 and H.263
https://bugzilla.gnome.org/show_bug.cgi?id=698826
2013-04-26 14:26:15 +02:00
Diogo Carbonera Luvizon
0a7d4afc1b v4l2: save the format correctly
If TRY_FMT is not implemented,  gst_v4l2_object_get_nearest_size will
use S_FMT and will change the device's operation mode. To save the
old device mode we need to set the type field or else it will fail
to save the previous format.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685209
2013-04-24 16:00:24 +02:00
Benjamin Gaignard
e29ab42922 v4l2: Add support of dmabuf
v4l has add a new IOCTL to export a buffer by using dmabuf.
This patch allow to use this new IOTCL if it has been defined in videodev2.h
I introduce a new IO mode (GST_V4L2_IO_DMABUF) to enable this way of working.

https://bugzilla.gnome.org/show_bug.cgi?id=693826
2013-02-19 12:57:07 +01:00
Tim-Philipp Müller
e672123621 v4l2: remove unused define 2012-11-25 16:05:11 +00:00
Tim-Philipp Müller
230cf41cc9 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:07:18 +00:00
Wim Taymans
d154743949 v4l2: remove unused code. 2012-09-06 10:43:52 +02:00
Tim-Philipp Müller
787c314ec3 Silence some 'variable may be used uninitialized' compiler warnings
When compiling with -DG_DISABLE_ASSERT
2012-08-08 11:31:59 +01:00
Hans de Goede
b9676944bb v4l2object: Don't probe UVC devices for being interlaced
UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
causes expensive and slow USB IO, so don't probe them for interlaced.

This shaves 2 seconds of the startup time of cheese with a Logitech
Webcam Pro 9000.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677722
2012-06-11 11:23:34 +02:00
Wim Taymans
85d4dde9d1 v4l2: fix compilation on older v4l2
Fix compilation on systems where the H264 format is not defined.
2012-04-19 12:38:58 +02:00
Sebastian Dröge
04b70571e5 video: Update for libgstvideo API changes 2012-04-19 12:20:59 +02:00
Youness Alaoui
09dabd4be6 v4l2src: Allow mpeg-ts cameras to negociate format
This removes an ugly hack until the reason for the hack can be documented
2012-04-19 10:31:18 +02:00
Sebastian Dröge
e7a76badc5 v4l2src: Fix merge 2012-04-19 09:50:25 +02:00
Youness Alaoui
a63451ecd7 v4l2src: Add H264 encoded stream support to the caps
This is not enough to properly support H264 cameras, but it will
allow an H264 stream to be generated by v4l2src using the default
settings of the camera. If used with the pre-set-format signal, the
H264 encoder can be fully configured.

Conflicts:

	sys/v4l2/gstv4l2object.c
2012-04-19 09:49:33 +02:00
Wim Taymans
2adc948d18 x-raw-bayer -> x-bayer 2012-03-05 12:43:17 +01:00
Mark Nauwelaerts
f189f62b13 Merge branch 'master' into 0.11
Conflicts:
	ext/wavpack/gstwavpackenc.c
	tests/check/elements/audioiirfilter.c
	tests/examples/v4l2/probe.c
2012-03-01 11:29:50 +01:00
Edward Hervey
9beda57c3a Suppress deprecation warnings in selected files, for g_value_array_* mostly 2012-02-27 14:47:25 +01:00
Wim Taymans
9365f12d6e GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING 2012-02-08 16:43:30 +01:00
Wim Taymans
b4630dd3e0 more memory API porting 2012-01-25 12:30:29 +01:00
Wim Taymans
4b8975f867 update for removed property probe 2011-12-21 11:59:46 +01:00
Wim Taymans
4f42f58565 v4l2: update for new interlaced caps 2011-12-19 19:03:52 +01:00
Tim-Philipp Müller
668e15598b Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	sys/v4l2/gstv4l2object.c
2011-12-08 01:28:26 +00:00
Vincent Penquerc'h
687d6138d1 v4l2src: do not ignore the highest frame interval
https://bugzilla.gnome.org/show_bug.cgi?id=665387
2011-12-07 13:41:12 +00:00
Vincent Penquerc'h
2b0a001d0d v4l2src: do not ignore the largest resolution
The 'max' value isn't an STL style "one after the end" bound,
but the largest allowed value.

https://bugzilla.gnome.org/show_bug.cgi?id=665387
2011-12-07 13:41:12 +00:00
Tim-Philipp Müller
87ba312e19 v4l2: replace deprecated GST_CLASS_LOCK 2011-12-05 12:15:21 +00:00
Vincent Penquerc'h
1e974b1581 v4l2src: add a comment about a "hidden" assumption on rank values
https://bugzilla.gnome.org/show_bug.cgi?id=665387
2011-12-02 14:44:47 +00:00
Wim Taymans
07cc855b24 Merge branch 'master' into 0.11
Conflicts:
	ext/speex/gstspeexenc.c
	gst/rtpmanager/rtpsession.c
2011-11-17 17:17:11 +01:00
Sjoerd Simons
e7ae593993 v4l2: Set pixel-aspect-ratio to 1/1
We don't currently support setting the pixel-aspect-ratio from V4L2. So
simply set it to be 1/1 in the caps to prevent negotiation failures when
fixating to weird values (e.g. when the downstream caps has
pixel-aspect-ratio = [ MIN, MAX ] )

https://bugzilla.gnome.org/show_bug.cgi?id=663580
2011-11-14 11:43:41 +01:00
Wim Taymans
9a8a8e72c8 structure: fix for api update 2011-11-02 09:06:37 +01:00
Tim-Philipp Müller
d18a578ba4 rtpmanager, v4l2: fix compiler warnings after gst_caps_new_simple() change 2011-10-28 09:06:41 +01:00
Wim Taymans
fc4684f4c6 fix compilation 2011-10-27 16:03:17 +02:00
Wim Taymans
586ef0babd Merge branch 'master' into 0.11
Conflicts:
	ext/speex/gstspeexdec.c
	ext/speex/gstspeexenc.c
	gst/isomp4/atoms.c
	gst/isomp4/gstqtmux.c
2011-10-06 12:23:39 +02:00
Stas Sergeev
73fac4e5bc v4l2, ximagesrc: fix some printf format compiler warnings
https://bugzilla.gnome.org/show_bug.cgi?id=660150
2011-09-30 18:05:32 +01:00