Commit graph

2070 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal 078560e70a v4l2: use GstV4l2Error in gst_v4l2_open()
gst_v4l2_open() is called by gst_v4l2_device_provider_probe_device(),
where the GstV4l2Object is created without an associated GstElement.

If gst_v4l2_open() fails, it raises a bus message, but without an
element, a precondition check fails on
gst_element_message_full_with_details() generating a crash if running
with fatal-warnings debug mode.

GstV4l2Error is a helper to raise error bus messages when it is
appropiated. This patch changes the direct bus messages to this
helper, and the elements will actually send the error message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/694>
2020-08-11 01:44:17 +00:00
Tim-Philipp Müller 435c2acdc5 rpicamsrc: hypothetical fix for data pointer calculation
mmal buffer header docs say data is valid for length bytes
from offset. In practice offset always seems to be 0 so
far though.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-24 17:13:04 +01:00
Tim-Philipp Müller 987a332076 rpicamsrc: mark buffers as header and keyframe/delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-24 17:09:45 +01:00
Tim-Philipp Müller 9588108d6e rpicamsrc: fix nal alignment of output buffers
We claim output buffers are nal-aligned, but that wasn't
actually true: We would push out a partial nal in case
the nal doesn't fit into the max encoder-selected output
buffer size, and then the next buffer would not start
with a sync marker. That's not right and makes h264parse
unhappy.

Instead accumulate buffers until we have a full frame
(we can't rely on the NAL_END flag, it's always set).

Fixes #768

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-24 17:09:45 +01:00
Tim-Philipp Müller 477eba2dd7 rpicamsrc: fix "Could not find component vc.ril.camera" on recent raspios
Make extra sure all the required mmal libs such as libmmal_vc_client.so
actually get linked and stay linked. Otherwise the above error happens
it seems.

buster (10.4) with meson 0.55 and pi ref 2020-05-27
pi-gen, 825107f04027269db77426046f5085475b1ea22f, stage5

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-23 19:11:30 +01:00
Tim-Philipp Müller 428c545e06 rpicamsrc: deviceprovider: hook up i18n properly
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-23 19:09:56 +01:00
Tim-Philipp Müller 7861f17bd7 rpicamsrc: deviceprovider: advertise (M)JPEG as well
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-23 19:09:56 +01:00
Tim-Philipp Müller d67e21d454 rpicamsrc: deviceprovider: also advertise constrained-baseline profile
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
2020-07-23 19:09:56 +01:00
Haihua Hu 0a453cc4a4 v4l2: enhance v4l2 control interface to support string type CID
add string type cid support for v4l2 implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/676>
2020-07-22 14:21:42 +08:00
Tim-Philipp Müller 5a7275220b rpicamsrc: fix build with older meson versions
assert() used to require two arguments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/668>
2020-07-10 21:43:14 +01:00
Tim-Philipp Müller fbcc43d822 rpicamsrc: flesh out docs and add to plugin docs cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:37:28 +01:00
Tim-Philipp Müller b7c07b1a95 rpicamsrc: enable video orientation/direction unconditionally
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:37:28 +01:00
Tim-Philipp Müller b222ca1fc9 rpicamsrc: remove mkenums template files which are no longer needed
They were still being used by the autotools build, but that's gone.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:37:28 +01:00
Tim-Philipp Müller 8ceaefe101 rpicamsrc: fix indentation
Not touching the Raspi* files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:37:28 +01:00
Tim-Philipp Müller 996d2389af rpicamsrc: fix and silence some compiler warnings
Some are in system headers, and in Raspi files we want
to keep modifications to a minimum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:37:28 +01:00
Tim-Philipp Müller 4a4de61c23 rpicamsrc: hook up to build
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:37:28 +01:00
Tim-Philipp Müller 84dbf94313 Merge branch 'plugin-move-rpicamsrc'
Move rpicamsrc from https://github.com/thaytan/gst-rpicamsrc/

It's a useful little element and works well, so might as well
make sure it's widely available so people can stop piping
raspivid output into fdsrc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
2020-07-10 17:36:14 +01:00
Tim-Philipp Müller e5593a4c9c rpicamsrc: sync autotools with glib-mkenum usage in meson build 2020-07-10 16:47:12 +01:00
Tim-Philipp Müller 1c25fe131d rpicamsrc: meson: use gnome.glib_mkenums_simple() and fix build as Meson subproject
While at it also fix up the type defines, e.g.
GST_RPI_CAM_TYPE_RPI_CAM_SRC_EXPOSURE_MODE -> GST_RPI_CAM_SRC_TYPE_EXPOSURE_MODE
2020-07-10 16:47:10 +01:00
Tim-Philipp Müller 912ea0dceb rpicamsrc: meson: drop map file and fix plugin symbol export with newer gstreamer versions
Use -fvisibility instead of a map file for symbol export, so that
the right symbols get exported with newer gstreamer versions. Older
GStreamer versions also still work of course.

Fixes blacklisting/plugin-loading issues with GStreamer >= 1.14

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/984,
closes https://github.com/thaytan/gst-rpicamsrc/issues/94
and https://github.com/thaytan/gst-rpicamsrc/issues/67
2020-07-10 16:46:35 +01:00
Jan Schmidt 3c5327ae64 rpicamsrc: Attempt to workaround MMAL timeout bug
mmal_queue_timedwait() might spuriously return immediately
if called at exactly the wrong instant due to an internal
off-by-one bug. Attempt to work around that and just retry.
2020-07-10 16:46:33 +01:00
Jan Schmidt c907deb15f rpicamsrc: Improve timeout error
Propagate timeout errors so they're not reported
generically
2020-07-10 16:46:31 +01:00
Jan Schmidt 09d9ac2d2e rpicamsrc: Don't destroy the camera component on startup error
Just disable the camera component when it fails to start. The
most common reason is that the camera device is already in use,
and if we just disable the mmal component correct cleanup
will happen later
2020-07-10 16:46:23 +01:00
Jan Schmidt d5cd0c0301 rpicamsrc: Expose constrained-baseline profile
constrained-baseline is a useful profile for streaming to iOS
devices, and seems to work in the firmware, so let's publish it
2020-07-10 16:46:19 +01:00
Jan Schmidt 93bd8c34ed rpicamsrc: Add define and increase reported maximum FPS from 90 to 1000 2020-07-10 16:46:18 +01:00
Jan Schmidt cab6585378 rpicamsrc: Expand frame timeout from 100ms to 500ms
rpicamsrc on a normal rpi camera doesn't start up fast enough,
and always fails the new 100ms timeout. A better solution
might be to have a longer timeout for the first frame, but
shorter once frames are running - but this quick fix will at
least make rpicamsrc work again.
2020-07-10 16:46:17 +01:00
Georgii Staroselskii b45e239128 rpicamsrc: RaspiCapture: use mmal_queue_timedwait() for buffer queueing
If an external camera was disconnected, there were no feedback in an
application. It seems reasonable to wait on mmal_queue no longer than
100ms. If it's stuck we just return a FLOW_ERROR and let the application
decide what to do later.
2020-07-10 16:46:15 +01:00
Georgii Staroselskii 149fdee7fb rpicamsrc: RaspiCapture: handle MMAL_EVENT_ERROR 2020-07-10 16:46:13 +01:00
Jan Schmidt ed893592ea rpicamsrc: Implement use-stc property to disable STC timestamps
If use-stc=false, then rpicamsrc won't apply
the camera timestamping to outgoing buffers, instead
relying on real-time timestamping by the
GStreamer clock. It means slightly less accuracy
and more jitter in timestamps, but might help on some
CSI inputs with broken timestamping.
2020-07-10 16:46:12 +01:00
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