Commit graph

2041 commits

Author SHA1 Message Date
Jan Schmidt
f093e3f5fb rpicamsrc: Fix the descriptions of text annotation colour properties
The text annotation colour properties take an integer value
corresponding to a VUY colour, not a text string like
the copy-pasted description from raspivid suggests.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/59
2020-07-10 16:46:03 +01:00
Jan Schmidt
2c458819f5 rpicamsrc: Implement dynamic bitrate update
Use mmal_port_set_parameter_uint32 to update the encoder
bitrate.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/60
2020-07-10 16:45:54 +01:00
Jan Schmidt
1670712500 rpicamsrc: Set outgoing buffer durations based on negotiated framerate.
make sure outgoing buffers have at least some duration set,
otherwise it leads to strange situations, like qtmux writing
out a file that doesn't include the final frame inside the
playable segment, because no-duration = 0 duration there.
2020-07-10 16:45:53 +01:00
Jan Schmidt
dd9d7341b0 rpicamsrc: Destroy mmal pool on shutdown always.
Avoid hangs on the next run because we didn't clean up the mmal pool
last time we shutdown.
2020-07-10 16:45:52 +01:00
Jan Schmidt
f42afec471 rpicamsrc: Switch back to MJPEG codec for image/jpeg
The JPEG codec hangs, not sure why yet. The MJPEG
codec doesn't provide a quality setting, and sometimes
freezes on shutdown, but otherwise seems more
reliable
2020-07-10 16:45:50 +01:00
Jan Schmidt
38ef8c2411 rpicamsrc: Don't try and set H264 params with JPEG codec 2020-07-10 16:45:49 +01:00
Jan Schmidt
da86cec40e rpicamsrc: First attempt at implementing MJPEG and raw video support 2020-07-10 16:45:47 +01:00
Tim-Philipp Müller
0a38642214 rpicamsrc: Add experimental build using the Meson build system
Builds in about 10 seconds vs. 77 seconds with autotools.
2020-07-10 16:45:46 +01:00
Xabier Rodriguez Calvar
39afecac32 rpicamsrc: Implement GstVideoDirection interface
Instead of implementing a custom property, we implement that interface.
2020-07-10 16:45:45 +01:00
Jan Schmidt
2496d0e859 rpicamsrc: MMAL gives buffers with nal alignment, not AU
Fix the output caps, our buffers are not AU aligned, since
the SPS / PPS are given in separate packets at the start.
2020-07-10 16:45:43 +01:00
Xabier Rodriguez Calvar
c785d4f5db rpicamsrc: Create orientation property
Its behavior and choices are analog to the ones present in [gl]videoflip
for the method property.
2020-07-10 16:45:39 +01:00
Jan Schmidt
8e8ac0504c rpicamsrc: basesrc event handlers should not unref
Don't unref the passed event when handling events via
the GstBaseSrc src pad event handler - basesrc does
the unref. That breaks handling of upstream
force-key-unit events by unreffing twice.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/43
2020-07-10 16:45:29 +01:00
Jan Schmidt
8fa4acacc0 rpicamsrc: Add property getters for preview window position.
Add the lines in get_property() for the preview-x/y/w/h properties
so the values can be retrieved without causing critical warnings.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/42
2020-07-10 16:45:21 +01:00
Jan Schmidt
48b3c2bc8e rpicamsrc: Add preview-x/y/w/h properties
Expose properties for setting the position of the preview
window on the screen
2020-07-10 16:45:19 +01:00
Jan Schmidt
63f60f7e7e rpicamsrc: Add properties for configuring annotation text size and colour.
Map the raspivid setting for annotation text size and colours
to properties.
2020-07-10 16:45:18 +01:00
ibauer
a3de294cb5 rpicamsrc: Changed awb-gain-blue use the correct enum PROP_AWB_GAIN_BLUE and not PROP_AWB_GAIN_RED 2020-07-10 16:45:16 +01:00
Jan Schmidt
e97b50af51 rpicamsrc: Fix buffer PTS calculation
Timestamps from MMAL are in microseconds,
so make sure to convert to nanoseconds before
using them to adjust the GStreamer buffer time
2020-07-10 16:45:15 +01:00
Philippe Normand
cda483cb3c rpicamsrc: Basic orientation interface support
The (h,v)flip attributes are now supported through this interface.
It should also be possible to support (h,v)center attributes using the
ROI properties.
2020-07-10 16:45:13 +01:00
Jan Schmidt
1a4870d13d rpicamsrc: Describe awb-mode=off in lowercase
Change the descriptions for the awb-gain-blue and awb-gain-red
properties to say 'awb-mode=off' instead of 'awb-mode=OFF'

See https://github.com/thaytan/gst-rpicamsrc/issues/26
2020-07-10 16:45:05 +01:00
Philippe Normand
961cf17c97 rpicamsrc: colorbalance: protect with config_lock mutex 2020-07-10 16:45:03 +01:00
Philippe Normand
48a735ff21 rpicamsrc: Implement GstColorBalance interface
Fixes https://github.com/thaytan/gst-rpicamsrc/issues/24
2020-07-10 16:44:48 +01:00
Jan Schmidt
4e827949ef rpicamsrc: Fix initial config setting.
Make sure to update the captsure config before starting
capture. Since the capture component now keeps a local
copy of the config, it's not updated automatically.
2020-07-10 16:44:46 +01:00
Jan Schmidt
e58951cfb8 rpicamsrc: Disable bitrate, quantisation and intra-refresh dynamic changes
The firmware rejects dynamic changes of those encoder params.
2020-07-10 16:44:45 +01:00
Jan Schmidt
92aa566c43 rpicamsrc: Send vcos_log_warn via GStreamer debug messages 2020-07-10 16:44:43 +01:00
Jan Schmidt
3b85ddd90e rpicamsrc: Update properties dynamically where possible
Update camera and encoder properties at runtime
where possible

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/19
and https://github.com/thaytan/gst-rpicamsrc/issues/23
2020-07-10 16:44:23 +01:00
Jan Schmidt
1610030b40 rpicamsrc: split preview config and state 2020-07-10 16:44:21 +01:00
Jan Schmidt
3771777f7f rpicamsrc: Clear intra-refresh MMAL param struct.
Use memset on the stack allocated MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T
struct. Apparently mmal_port_parameter_get() doesn't retrieve all
parameters, causing random failures when we set the intra-refresh
param on the encoder.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/22 for me.
2020-07-10 16:44:13 +01:00
Jan Schmidt
4d70e1d8ee rpicamsrc: Merge changes from userland repo
Current to b69f807ce59189457662c2144a8e7e12dc776988

No integration of stereoscopic support as yet
2020-07-10 16:44:11 +01:00
Jan Schmidt
edf4927704 rpicamsrc: Map intra-refresh cyclic-rows to the correct MMAL param. 2020-07-10 16:44:07 +01:00
Jan Schmidt
8fe0590c29 rpicamsrc: Use MMAL PTS and STC to calculate GStreamer timestamps
Don't apply timestamps based on output time from the encoder,
but use the MMAL STC and capture PTS to generate a GStreamer
timestamp that more accurately resembles the input (and would
preserve reordering should the encoder ever add B-frames).

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/16
2020-07-10 16:43:55 +01:00
Jan Schmidt
c3ad9c99a6 rpicamsrc: Defer encoder creation until after caps are negotiated
This ensures the encoder is created with the profile
negotiated with downstream
2020-07-10 16:43:53 +01:00
Jan Schmidt
3abe941e74 rpicamsrc: Read and set H.264 profile from negotiated caps 2020-07-10 16:43:51 +01:00
Jan Schmidt
2087b1e44e rpicamsrc: Add intra-refresh-type property, and set default keyframe spacing to -1 (auto)
This plus other recent commits mostly fix
bug https://github.com/thaytan/gst-rpicamsrc/issues/16
2020-07-10 16:43:31 +01:00
Jan Schmidt
ed22d5cc4e rpicamsrc: Add annotation-mode and annotation-text properties 2020-07-10 16:43:30 +01:00
Jan Schmidt
39d212df57 rpicamsrc: implement sensor-mode property 2020-07-10 16:43:28 +01:00
Jan Schmidt
52ae74f9ce rpicamsrc: More conversion to GStreamer logging 2020-07-10 16:43:26 +01:00
Jan Schmidt
37028010f1 rpicamsrc: Implement drc property 2020-07-10 16:43:25 +01:00
Jan Schmidt
78b36bbb6b rpicamsrc: add awb-gain-red and awb-gain-blue properties 2020-07-10 16:43:23 +01:00
Jan Schmidt
f6451323b5 rpicamsrc: Add camera-number property 2020-07-10 16:43:22 +01:00
Jan Schmidt
1ea517a692 rpicamsrc: add inline-headers and shutter-speed properties 2020-07-10 16:43:20 +01:00
Jan Schmidt
861c353873 rpicamsrc: Add quantisation-parameter property, support variable bitrate
Allow birate=0 and implement the quantisation-parameter property

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/21
2020-07-10 16:43:07 +01:00
Jan Schmidt
6bd0347bf0 rpicamsrc: Incorporate raspivid changes from upstream
Merge all changes for new features from upstream
raspberrypi userland, up to commit 0de0b2
2020-07-10 16:43:02 +01:00
Jan Schmidt
eb345f032c rpicamsrc: Add keyframe-interval property to the element 2020-07-10 16:43:00 +01:00
Tim-Philipp Müller
27c35a8ff3 rpicamsrc: deviceprovider: check if camera is detected and supported 2020-07-10 16:42:59 +01:00
Tim-Philipp Müller
8e9c8663f8 rpicamsrc: Add GstDeviceProvider for rpi camera module 2020-07-10 16:42:58 +01:00
Tim-Philipp Müller
4b15fa2abc rpicamsrc: avoid single-element lists in template caps 2020-07-10 16:42:56 +01:00
Vivia Nikolaidou
d226968275 rpicamsrc: Add force-key-unit event support 2020-07-10 16:42:55 +01:00
Jan Schmidt
244091bb5e rpicamsrc: Move all debug output to go via GStreamer logs
Fixes https://github.com/thaytan/gst-rpicamsrc/issues/9
2020-07-10 16:42:16 +01:00
Jan Schmidt
df3ceb86f7 rpicamsrc: Update maximum framerate to 90 fps 2020-07-10 16:42:15 +01:00
Jan Schmidt
1dfb41bdce rpicamsrc: Enable image effects 2020-07-10 16:42:14 +01:00
Jan Schmidt
1b9a614272 rpicamsrc: Re-flow element source code with gst-indent 2020-07-10 16:42:12 +01:00
Jan Schmidt
5f871311c1 rpicamsrc: Implement a bunch of the raspivid command-line params
Add properties for controlling various parts of the capture
2020-07-10 16:42:11 +01:00
Jan Schmidt
42729b92f0 rpicamsrc: Tell basesrc to timestamp buffers for us, for now. 2020-07-10 16:42:10 +01:00
Jan Schmidt
cde8b33199 rpicamsrc: Initial caps nego and properties.
Support caps negotiation for H.264 frame size and framerate.

Add bitrate, saturation, brightness, contrast, sharpness properties.
2020-07-10 16:42:09 +01:00
Jan Schmidt
1416631df9 rpicamsrc: First version which generates buffers on the src pad
Fixed to 1920x1080 h264 regardless of caps.
2020-07-10 16:42:07 +01:00
Jan Schmidt
7ffb618b20 rpicamsrc: Checkpoint. Version which writes directly to test.out
Switch to plain basesrc for parent class
2020-07-10 16:42:06 +01:00
Jan Schmidt
f4af399350 rpicamsrc: checkpoint 2020-07-10 16:42:04 +01:00
Jan Schmidt
e4f74290df rpicamsrc: Initial commit
Simple modified gst-template to use BaseCameraSrc
Incorporate Broadcom mmal headers
2020-07-10 16:42:01 +01:00
Xavier Claessens
c187684b78 v4l2: Do not renegotiate if only framerate changed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/602>
2020-07-03 18:10:14 +00:00
Nicolas Dufresne
ca61a76987 v4l2: Fix threading issues in orphaning mechanism
The pool orphaning function was colling internal _stop() virtual function
implementation. This is not thread safe, as a private lock inside the buffer
pool is supposed to be held. Fix this by keeping delayed _stop() and orphaning
the GstV4L2Allocator instead (REQBUFS(0)).

Then, protect the orphaned boolean with the object lock for the case a buffer
is being released after we have orphaned the buffer. That would otherwise
cause a QBUF to happen while the queue is no longer owned by the buffer pool.
This boolean is otherwise used and set from the streaming lock, or after
threads have been stopped (final cleanup).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/648>
2020-06-28 15:12:07 +00:00
Nicolas Dufresne
71204f2c3b v4l2bufferpoool: Fix requeueue after seek when importing
When the buffer pool is importing buffer, it will requeue num_allocated on
streamon. As this value was not set for DMABuf import and USERPTR, no buffer
was queued  back.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
2020-06-28 13:40:30 +00:00
Nicolas Dufresne
1beb497aa7 Revert "v4l2bufferpool: request the maximum number of buffers for USERPTR"
This reverts commit 6bf9f4bd77.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
2020-06-28 13:40:30 +00:00
Nicolas Dufresne
d4ac154824 Revert "v4l2bufferpool: request the maximum number of buffers for DMABUF"
This reverts commit 94e323c10f.

Fixes #754

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
2020-06-28 13:40:30 +00:00
Nicolas Dufresne
83f60aea54 v4l2bufferpool: Only resurrect the right amount of buffers
On streamon, we need to resurrect (queue back) some buffers, as during
flushign seek we'd endup with an empty queued. We initially started with
resurrecting as many as we could without blocking, but that miss-behaved with
dynamic CREATE_BUFS, causing the pool to grow dramatically. This was limited
by the number of allocated buffers, but this still tried to resurrect too many
buffers for the first run, as activating the pool will queued buffers.

In this patch, we calculte the missing detal in the queue and only try and
resurrect that amount of buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
2020-06-28 13:40:30 +00:00
Nicolas Dufresne
85b9893e96 v4l2object: Only offer inactive pools and if needed
Avoid offering a pool if it's not needed or if it's still active.
This works around the fact the we only have one pool in V4L2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
2020-06-28 13:40:30 +00:00
Nicolas Dufresne
93b202b84e v4l2allocator: Don't do REQBUFS(0) on inactive allocator
If the allocator is no longer active, it means the memory has already
been freed, calling REQBUF(0) would make no sense.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>
2020-06-26 19:24:21 +00:00
Nicolas Dufresne
b8f1f2195e v4l2bufferpool: Avoid set_flushing warning
The gst_buffer_pool_set_flushing() warns when that function is called
on an inactive pool. Avoid the warning by checking the state, this is
similar to what we do in gst_v4l2_object_unlock().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>
2020-06-26 19:24:21 +00:00
Nicolas Dufresne
0344c50eaf v4l2allocator: Fix data offset / bytesused size validation
The check was too strict causing spurious warning. Now check for <= so that 0
sized buffer do not cause a warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>
2020-06-26 19:24:21 +00:00
Nicolas Dufresne
dbdbcfe7ff v4l2videoenc: Fix negotiation caps leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>
2020-06-26 19:24:21 +00:00
Nicolas Dufresne
7bbe4653a4 v4l2videoenc: Skip negotiation of profiles/level if no codec
The codec structure is optional and not used for fwht test codec. This
was leading to a crash dereferencing NULL pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/650>
2020-06-26 13:37:21 -04:00
Mathieu Duponchelle
ceece207e0 docs: mark more types as plugin API 2020-06-23 12:07:47 -04:00
Jordan Petridis
3e2420361a Use gst_element_class_set_metadata when passing dynamic strings
gst_element_class_set_metadata is meant to only be used with
static or inlined strings, which isn't the case for the 2 elements
here resulting in use-after-free later on.

https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c#gst_element_class_set_static_metadata

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/622>
2020-06-11 20:39:33 +03:00
Mathieu Duponchelle
f63299ff2f plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:42:25 +02:00
Mathieu Duponchelle
37c619f995 plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:09 -04:00
Nicolas Dufresne
3ea71a63f6 v4l2: videodec: Fix broken template caps
The profiles and levels were applied to the common caps instead of the copy.
That had the side effect of setting profiles/level from one CODEC onto
another. Leaving to encoder not being registered or not-negotiated errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/599>
2020-05-22 19:11:47 +00:00
Nicolas Dufresne
d93664d65d v4l2: codec: Fix GValue leak
The levels and profiles probe function returned a dynamically allocated GValue
that was leaked. Simplify this by using a stack allocated GValue and a boolean
return value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/599>
2020-05-22 19:11:47 +00:00
Nicolas Dufresne
24e08553d6 v4l2codec: Remove uneeded factorisation
There is only one user of that function and the split only increase
complexicity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/599>
2020-05-22 19:11:47 +00:00
Nicolas Dufresne
bfb1506381 v4l2src: Ignore non-increasing sequence number
With older kernel, older driver or just broken drivers, the sequence number
may not be increasing. This simply ignore the sequence in this case. This
would otherwise miss-leading large amount of lost frame being reported.

Fixes #729

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/598>
2020-05-20 21:35:06 +00:00
Nirbheek Chauhan
fbd4afc64c meson: Pass native: false to add_languages()
This is needed for cross-compiling without a build machine compiler
available. The option was added in 0.54, but we only need this in
Cerbero and it doesn't break older versions so it should be ok.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/589>
2020-05-13 19:25:33 +05:30
Nicolas Dufresne
8e3184a213 v4l2videodec: Increase internal bitstream pool size
This patch will now set the maximum of buffers to 32, allowing to grow the
pool for drivers that supports that and will respect the minimum buffers
reported by the driver. This was made to fix a stall with the virtio CODEC
driver.

Fixes #672
2020-04-15 20:19:48 +00:00
Nicolas Dufresne
6bf9f4bd77 v4l2bufferpool: request the maximum number of buffers for USERPTR
This is to match what we now do for DMABuf importation.
2020-04-08 16:37:30 +00:00
Michael Olbrich
94e323c10f v4l2bufferpool: request the maximum number of buffers for DMABUF
There are often only two buffers queued in the kernel so no new buffers are
requested.

With every qbuf, the kernel receives a new DMABUF for the specified index.
This most likely differs from the last DMABUF and the old cached entry is
released. This results in a lot of map/unmap overhead if the kernel driver
needs a mapping for the buffer.

With a larger queue, it's quite likely, that both old and new DMABUFs are
also mapped for another index. So the map/unmap is skipped, because the
mapping is reference counted.

The corresponding allocated buffers don't contain any actual memory, so
allocating them is quite cheep. So the log message is updated to clarify
this.
2020-04-08 16:37:30 +00:00
Guillaume Desmottes
d1501f0952 v4l2: add alternate interlace mode
When using this mode each frame is split in two fields, each one being
transferred using its own buffer.
This is implemented with the V4L2_FIELD_ALTERNATE field format in v4l2.

This mode is enabled using a caps filter such as
"v4l2src ! video/x-raw\(format:Interlaced\)"

Here are the main changes related to this feature:

- use the INTERLACED caps feature with this mode.

- in this mode both fields of a given frame have the same sequence/offset
so adjust the algorithm checking for lost field/frame accordingly.

- double pool's min number of buffers as each frame requires 2 buffers.

Fix #504
Co-authored-by: Zeeshan Ali <zeenix@collabora.co.uk>
2020-03-25 12:42:12 +01:00
Guillaume Desmottes
0834ef15ce v4l2: display field when setting or trying format
Ease debugging interlacing pipelines.
2020-03-25 12:14:41 +01:00
Guillaume Desmottes
8a69e26f16 v4l2: pass v4l2object to GST_V4L2_MIN_BUFFERS()
Will be used to double the number of buffers in alternate interlace
mode.
2020-03-25 12:14:41 +01:00
Guillaume Desmottes
00893baef9 v4l2: use GST_VIDEO_INFO_FIELD_HEIGHT()
Use GST_VIDEO_INFO_FIELD_HEIGHT() instead of GST_VIDEO_INFO_HEIGHT()
when we actually want the field height rather than the frame height.
So far both are equals but that won't longer be the case when
implementing alternate interlace mode.
2020-03-25 12:14:41 +01:00
Seungha Yang
b0f4831481 v4l2bufferpool: Use unique name for v4l2bufferpool object
Assign unique sequence number to an object name for better debugging
2020-03-23 17:48:19 +00:00
Gordon Hart
05e8dd42e7 v4l2src: decrease gst_v4l2src_create log verbosity
Lower the verbosity of the 'sync' log message emitted
each buffer from gst_v4l2src_create down to LOG(6)
from INFO(4). This brings the logging behavior of
v4l2src closer to the GStreamer guidelines, which
recommend the INFO level be reserved for rare or
one-off messages.
2020-03-10 20:33:04 +00:00
Guillaume Desmottes
48a7381602 v4l2: map GST_VIDEO_FORMAT_BGR15
The GstVideoFormat to v4l2 conversion was missing for BGR15.
2020-02-05 18:22:20 +05:30
Guillaume Desmottes
0f907205de v4l2: fix crash on invalid caps
gst_v4l2_object_set_format_full() was returning FALSE without setting
an error. Caller code (gst_v4l2src_fixate()) was then derefing a
NULL pointer when trying to handle the error.
2020-02-05 18:22:20 +05:30
Stéphane Cerveau
b928517f1e good: use of g_value_dup_string
Use helper method to get string from GValue.
2019-12-20 09:30:26 +00:00
Olivier Crête
f66fc2a694 osxaudio: Remove deprecated GTimeVal 2019-12-18 19:48:34 +00:00
Nicolas Dufresne
3bd544418c v4l2bufferpool: Queue number of allocated buffers to capture
Before we do streamon, we queue all capture buffers by calling
resurrect. When the driver supports CREATE_BUFS, this would lead
to buffers being allocated till the maximum of 32 is reached.

Instead, we now save the number of allocated buffers and queue this
amount.
2019-11-20 11:03:19 -05:00
Nicolas Dufresne
23089e9cc3 v4l2object: Workaround bad TRY_FMT colorimetry implementation
libv4l2 reset the colorpace to 0 and does not do any request to the
driver. This yields an invalid colorspace which currently cause a
negotiation failure. This workaround by ignoring bad values during the
TRY_FMT step.
2019-11-18 18:29:48 +00:00
Niels De Graef
7cf4ab6229 Don't pass default GLib marshallers for signals
By passing `NULL` to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
2019-11-17 15:32:30 +00:00
Guillaume Desmottes
e9c10713a3 v4l2object: update match_buffer_layout() debug messages
It's no longer used only to try importing buffers.
2019-11-05 14:54:40 +05:30
Guillaume Desmottes
91002389b9 v4l2object: try matching buffer layout from downstream
Ask v4l2 to produce buffers matching the buffer layout requested
downstream.
2019-11-05 14:54:40 +05:30
Guillaume Desmottes
31c753a3fb v4l2object: factor out gst_v4l2_object_match_buffer_layout()
No semantic change.
2019-11-05 14:52:22 +05:30
Guillaume Desmottes
a195d5a4a6 v4l2transform: use alignments from upstream when importing on sink
Try configuring the v4l2 output with the alignments from upstream when
importing its buffers. This allows us to support importing with
non-standard strides and/or heights if supported by the driver.
2019-11-02 12:47:43 +01:00
Guillaume Desmottes
a92000ebb9 v4l2object: add support for vertical padding when importing buffers
We were already supporting horizontal padding by setting bytesperline to
the buffer stride but not vertical one.

We are now updating the format height with the padded height and crop to
the actual video resolution if needed.
2019-11-02 12:47:43 +01:00