Commit graph

1611 commits

Author SHA1 Message Date
Nicolas Dufresne
f9e01a53d8 v4l2transform: Use looser caps for upstream
When we fixate for upstream, try to not introduce new fields when not
needed. This was imported from videoconvert element.
2016-06-06 17:54:10 -04:00
Enrico Jorns
5829f326b0 gstv4l2transform: format fixation for preferring passthrough
* If outgoing format is unfixated, try to set it to input format.

* Call gst_caps_fixate () at end of fixation routine

https://bugzilla.gnome.org/show_bug.cgi?id=766719
2016-06-06 17:53:02 -04:00
Philipp Zabel
3eeef5fa09 v4l2transform: allow to change pixel aspect ratio
Scalers may change width and height independently,
allow to change pixel aspect ratio.

https://bugzilla.gnome.org/show_bug.cgi?id=766712
2016-06-06 17:50:41 -04:00
Philipp Zabel
89a2f0a647 v4l2transform: fix scaling in case of fixed pixel aspect ratio
To change pixel aspect ratio from DAR to PAR, the necessary scaling factor
is DAR/PAR, not DAR*PAR.
For good measure, add debug output similar to the fixed-width and
fixed-height cases.

https://bugzilla.gnome.org/show_bug.cgi?id=766711
2016-06-06 17:45:38 -04:00
Philipp Zabel
616ccbb0db v4l2object: fill colorimetry in gst_v4l2_object_acquire_format
Instead of relying on the default colorimetry chosen by
gst_video_info_set_format(), set info.colorimetry from the
values returned by G_FMT. This allows decoders to propagate
their input colorimetry downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=766383
2016-06-06 17:39:26 -04:00
Philipp Zabel
b5530a19a7 v4l2object: refactor gst_v4l2_object_get_colorspace to take a v4l2_format parameter
Move the extraction of colorimetry parameters from struct v4l2_format and the
setting of the identity matrix for RGB formats into the function to avoid code
duplication.

https://bugzilla.gnome.org/show_bug.cgi?id=766383
2016-06-06 17:39:26 -04:00
Philipp Zabel
1f31715c98 v4l2videodec: use visible size, not coded size, for downstream negotiation filter
gst_v4l2_probe_caps() returns the coded size, not the visible size. Subtract
the known padding from probed caps with the coded size before using them as
filter for caps negotiation with downstream elements.

https://bugzilla.gnome.org/show_bug.cgi?id=766382
2016-06-06 17:35:47 -04:00
Philipp Zabel
74f020fd2f v4l2object: use G_SELECTION instead of G_CROP in gst_v4l2_object_acquire_format
The gst_v4l2_object_acquire_format() function is used by v4l2videodec to obtain
the currently set capture format. Since G_FMT returns the coded size, the
visible size needs to be obtained from the compose rectangle in order to
negotiate it with downstream elements. The G_CROP call hasn't worked on mem2mem
capture queues for a long time. Instead use the G_SELECTION call to obtain the
compose rectangle and only fall back to G_CROP for ancient kernels.

https://bugzilla.gnome.org/show_bug.cgi?id=766381
2016-06-06 17:33:27 -04:00
Andreas Naumann
b18031cf4b v4l2sink: Use V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY if driver advertises it.
On modern kernels, the G/S_FMT ioctls will always fail using
V4L2_BUF_TYPE_VIDEO_OVERLAY with VFL_DIR_TX (e.g. real overlay out drivers)
since this is not the intented use (rather rx, according to v4l2 API doc).
Probably this is why the Video Output Overlay interface was created, so if
the driver advertises it we might as well use.
For old kernels (pre 2012) the old way might still work so keeping this for
compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=761165
2016-06-06 17:26:13 -04:00
Kieran Bingham
b4e6a71566 v4l2object: Use non-deprecated V4L2 type for RGB15
Support for the updated V4L2_PIX_FMT_XRGB555 was added in commit
2538fee2fd however, when setting the format
for use in v4l2 ioctls, the old deprecated format is still used. Convert
this to the new accepted format type, as the preferred format.

https://bugzilla.gnome.org/show_bug.cgi?id=767300
2016-06-06 17:19:41 -04:00
Josep Torra
b7866315a6 v4l2src: check for valid size on raw video buffers
Discard buffers that doesn't contain enough data when dealing
with raw video inputs.

https://bugzilla.gnome.org/show_bug.cgi?id=767086
2016-06-01 17:35:12 +02:00
Guillaume Desmottes
1840fa9363 v4l2object: fix caps leak
gst_v4l2_object_probe_caps() was taking an extra ref on the returned
caps for no reason.

https://bugzilla.gnome.org/show_bug.cgi?id=766610
2016-05-25 13:40:54 -04:00
Hyunjun Ko
1face2a662 osxaudio: Support audio device provider on osx
https://bugzilla.gnome.org/show_bug.cgi?id=753265
2016-05-02 09:58:49 +03:00
Song Bing
11899106d0 ximageutil: shouldn't implement transform if don't support it
shouldn't implement transform if don't support it. Or gst_buffer_copy_into()
will print ERROR log.

https://bugzilla.gnome.org/show_bug.cgi?id=765583
2016-04-29 10:08:45 +03:00
Dimitrios Katsaros
df9eed0ab5 v4l2: Change warning handling to break infinite message loop
v4l2src can cause an "infinite message loop" when a base control exposed as a
property is not provided by the device. In these cases, if in the warning message
handling for the bus, the GST_DEBUG_BIN_TO_DOT_FILE* category of functions are used,
the src lookup causes a new warning to be posted on the bus, causing a loop.

This patch changes the warning for these controls so they are not posted on the bus.

https://bugzilla.gnome.org/show_bug.cgi?id=758703
2016-04-16 16:36:25 -04:00
Sebastian Dröge
4103f3d7f3 ximage: Initialize all fields in the meta explicitly
The meta is not allocated with all fields initialized to zeroes.

https://bugzilla.gnome.org/show_bug.cgi?id=764902
2016-04-13 09:57:16 +03:00
Wim Taymans
c9c051d53d v4l2: avoid leaking GValues
unset the GValue if we don't use it any more to avoid leaks.
2016-04-12 11:56:08 +02:00
Nirbheek Chauhan
a5369c6be3 v4l2: Don't leak v4l2 objects and props on probe errors 2016-04-04 20:31:43 +01:00
Aurélien Zanelli
c163250f0d v4l2object: probe all colorspace supported by device
A device can support more than one colorspace for a given image
dimension and pixel format. So we have to probe all the supported
colorspace and not only rely on the default one. Otherwise we could end
up with negotiation failure if the caps colorimetry field don't match
the v4l2 device default one even if the v4l2 could support such
colorimetry.

This patch enable probing if colorspace for both capture and output
device. It really makes sense for output device since the colorspace
shall be set by the application and a little less for capture device
which, at the moment, shall provide the colorspace; ie: the v4l2
specification seems to not take into account the fact that a capture
device could do colorspace conversion.

As a side effet, probing takes some times and so sligthly delay v4l2
initialization. Note that this patch only probe colorspace and not all
colorspace, matrix, transfer and range combination to avoid taking too
much time, especially with low-speed devices as full probing do 1782
ioctl.

https://bugzilla.gnome.org/show_bug.cgi?id=755937
2016-03-24 14:05:45 -04:00
Vineeth TM
1071309870 good: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763076
2016-03-24 14:32:20 +02:00
Thomas Roos
93d09f0474 dirctsoundsink: Setting volume should not unmute
https://bugzilla.gnome.org/show_bug.cgi?id=755106
2016-03-08 20:42:09 +02:00
Thomas Roos
e345a7fee9 dirctsoundsink: Fix volume reset on unmute
https://bugzilla.gnome.org/show_bug.cgi?id=755106
2016-03-08 20:42:06 +02:00
Alban Bedel
d746e1ef51 v4l2object: fix capture with bayer formats other than bggr
gst_v4l2_object_get_caps_info() always return V4L2_PIX_FMT_SBGGR8
for all bayer formats. This is obviously broken if the device use
another ordering. Fix this by properly reading the format parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=763318
2016-03-08 11:15:08 -05:00
Josep Torra
c65b66432e v4l2: fix colorimetry for NV12
Replicate V4L2_MAP_QUANTIZATION_DEFAULT macro behavior.
At #v4l it was described that documentation might be wrong and that
we should trust this macro instead.

https://bugzilla.gnome.org/show_bug.cgi?id=762529
2016-03-07 11:36:59 -05:00
Tim-Philipp Müller
3333683f64 v4l2: don't use undeclared core debug category symbols 2016-02-20 11:51:56 +00:00
Tim-Philipp Müller
30a3551163 v4l2src: fix indentation 2016-02-19 15:03:41 +00:00
Luis de Bethencourt
2c52174167 v4l2allocator: Fix spelling of reenqueueing
To match commit 7d7074cef0. I love the idea
of aiming for the maximum number of consecutive vowels.
2016-02-08 15:35:19 +00:00
Nicolas Dufresne
7d7074cef0 v4l2allocator: Fix spelling of queueing
Didn't know which one to choose between queuing and queueing, so I picked
the one with the biggest amount of vowels in a row ;-P (both are
acceptable apparently)
2016-02-08 10:19:31 -05:00
Nicolas Dufresne
0569178ca7 v4l2: Re-add colorimetry field for RGB formats
This time, check if it's an RGB format and sets the transformation
matrix to identity. The rest of the colorimetry information is
meaningfull and shall be kept.

https://bugzilla.gnome.org/show_bug.cgi?id=759624
2016-01-22 14:17:24 -05:00
Wim Taymans
710ab7f083 v4l2: fix sRGB colorspace definition
V4l2 can also use the sRGB colorspace for YUV formats and thus needs a
default matrix.
2016-01-22 10:05:01 +01:00
Wim Taymans
681bab62e5 v4l2: Add adobe colorspace support
Use the new primaries and transfer function for Adobe RGB.
Explicitly list the colorimetry instead of using the default GStreamer
ones. The defaults for BT2020, for example, do not match.
Explicitly set the matrix of SRGB to RGB.
2016-01-21 10:49:44 +01:00
Jan Schmidt
d34910bf30 v4l2: Don't free props structure twice.
gst_v4l2_device_provider_probe_device() frees the passed props
structure, don't free it again in the caller.
2016-01-20 18:23:37 +11:00
Nicolas Dufresne
496137854b v4l2object: Cleanup uneeded return statement 2016-01-19 15:17:50 -05:00
Nicolas Dufresne
fd32440609 v4l2object: Don't set colorimetry for non YUV formats
Setting colormetry in caps for RGB have no meaning, but worst it
confuses the converters downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=759624
2016-01-19 15:17:50 -05:00
Nirbheek Chauhan
2706a35ebe osxaudio: break as soon as the device is found
No need to loop further if there's no side-effects for it
2016-01-14 22:32:09 +00:00
Nirbheek Chauhan
6b760ead2a osxaudio: Fix error handling when selecting/opening devices
Post an element error when the CoreAudio device cannot be selected or opened.
Also ensure that we post a GST_ERROR with more detail.
2016-01-14 22:32:09 +00:00
Pablo Anton
927ba9332f v4l2-*: Configuring output pool correctly for using drivers min_buffer if present.
Signed-off-by: Pablo Anton <pablo.anton@vodalys-labs.com>

https://bugzilla.gnome.org/show_bug.cgi?id=755736
2016-01-04 16:32:28 -05:00
Wim Taymans
5fe9a59842 v4l2deviceprovider: add properties to the device
Add properties to the device with exactly the same keys and sematics
as what pulseaudio uses as property keys.

Also handle the case when a device is probed manually and not through gudev.

https://bugzilla.gnome.org//show_bug.cgi?id=759780
2015-12-29 11:25:36 +00:00
Thomas Roos
51f94288ce directsoundsink: Fix sleep for buffer-time lower than 200000
https://bugzilla.gnome.org/show_bug.cgi?id=748680
2015-12-21 12:44:55 +01:00
Nicolas Dufresne
2538fee2fd v4l2object: Update formats table
This change add all the new RGB based format. Those format removes the
ambiguity with the ALPHA channel. Some other missing multiplanar format
has been added with some additional cleanup.
2015-12-18 15:58:01 -05:00
Thomas Roos
adb5efaf8a directsoundsink: Check device property and fail if device can't be found
Don't use default if a specific device is set but it can't be found.

https://bugzilla.gnome.org/show_bug.cgi?id=759452
2015-12-14 15:48:40 +01:00
Thomas Roos
fb5a5c069c directsoundsink: Fix handling of the mute property
- set mute value at startup
- correct set and get mute functions

https://bugzilla.gnome.org/show_bug.cgi?id=755106
2015-12-14 14:37:00 +01:00
Thomas Roos
4d72fd9884 directsoundsink: Check the return value of GetStatus() too to decide if there was an error
If GetStatus() fails, the status itself won't be very meaningful but we also
have to look at its return value. This fixes blocking pipelines when removing
sound devices or during other errors, where we wouldn't notice the error and
then wait forever.

https://bugzilla.gnome.org/show_bug.cgi?id=734098
2015-12-11 12:42:04 +02:00
Wim Taymans
b208ae72ee v4l2bufferpool: don't block when resurecting a buffer
When we are resurecting a buffer, don't block. instead let us copy a
buffer.
2015-12-01 18:22:11 +01:00
Philipp Zabel
c75a69d415 v4l2: videodec: choose format from caps
https://bugzilla.gnome.org/show_bug.cgi?id=733827
2015-11-25 14:32:28 -05:00
Philipp Zabel
cf29e6c0b7 v4l2: add gst_v4l2_object_probe_caps
Add a variant of gst_v4l2_object_get_caps that bypasses the probed_caps cache.

https://bugzilla.gnome.org/show_bug.cgi?id=733827
2015-11-25 14:32:28 -05:00
Nicolas Dufresne
1435974c2d v4l2-probe: Skip devices without supported formats 2015-11-25 14:31:29 -05:00
Nicolas Dufresne
3cdc700e3e v4l2: Track /dev/video* to triggered required probe
If something in /dev/video* get added, removed or replaced, we need to
probe the devices again in order to ensure the dynamic devices are up to
date.

https://bugzilla.gnome.org/show_bug.cgi?id=758085
2015-11-25 14:31:29 -05:00
Nicolas Dufresne
4ecd25d267 v4l2: Fix capture/output-io-mode properties
There was some miss-match in the implementation. This makes it
concistent, though functionally it worked, except the video decoder
output-io-mode getter.
2015-11-19 15:35:36 -05:00
Reynaldo H. Verdejo Pinochet
8ef6ecc244 v4l2/object: remove unnecessary NULL check before g_free() 2015-11-15 01:43:08 -08:00