Add a src-length-limited version of VCOS_SAFE_STRCPY. For some
reason the vc4 linker complained about not being able to find strnlen,
hence the open-coded version.
The default linker option with Bullseye appears to now set
as-needed, so as the core doesn't call into mmal_vc_client
it is viewed as unnecesary, missing that mmal_vc_client has
a constructor that registers functions with the core.
Move the registration of the component supplier to the core_init.
The linker is therefore satisfied that mmal_vc_client is used,
and actually links to it.
This allows Picamera to work again.
https://github.com/waveform80/picamera/issues/697
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
V4L2 needs to stop on any change that triggers a V4L2_EVENT_SOURCE_CHANGE,
and that includes aspect ratio and colourspace changes.
Add a new parameter to request that behaviour from the RIL component.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This change adds a colour denoise config structure to allow us to set the
operating mode of the software colour denoise. This essentially chooses
between the video and stills colour denoise variants.
The related kernel change is at:
https://github.com/raspberrypi/linux/pull/4069
Video_decode was always ensuring that timestamps increased in value
during a stream.
V4L2 M2M API wants a direct mapping, so add an option to disable it.
Unicam can unpack to 16bpp, but only using the bottom N bits, and
V4L2 supports them all. It is also far easier for a CPU to process.
Adds support to the framework and to the ISP component (changes the
black level config).
It's supported as a standard preset within the VEC, but there was
no way of selecting it.
The 2 bits for SDTV mode in enum SDTV_MODE_T were fully utilised,
so add it as a modifier in one of the higher bits if PAL is
selected.
https://github.com/raspberrypi/firmware/issues/811
MIPI raw 14 wasn't previously defined, so add it for completeness
To support monochrome image sensors, add formats to handle the relevant
packed data formats into the ISP, and disable demosaic.
The Bayer pipeline is still active in Bayer mode, so all 4 channels need
to be programmed with the same data for blocks such as black level and
lens shading.
The examples read the first 512 bytes of the stream and try stuffing
them into the codec as header bytes.
If running a debug build of MMAL this will fail as the extradata
field of the port format is bigger than MMAL_FORMAT_EXTRADATA_MAX_SIZE
Reduce the header bytes array down to 128bytes to match
MMAL_FORMAT_EXTRADATA_MAX_SIZE.
Both these libraries/apps were related to the VPU accessing the
host file system over VCHI. This has never been used on the Pi,
and is creating build warnings with the latest versions of gcc.
Remove them from the source tree.
Current header generates warnings of the form "warning: cast from
function call of type ‘pthread_t’ {aka ‘long unsigned int’} to
non-matching type ‘VCOS_LLTHREAD_T *’ {aka ‘struct VCOS_LLTHREAD_T *’}
[-Wbad-function-cast]". Fix that.
SET_LAUNCH_VPU (0x30013) works like SET_EXECUTE_CODE except it
runs the code on VPU1 using the QPU rpc thread. The mailbox
returns immediately, and will only fail if out of memory.
The old lens_shading parameter structures exist for backwards
compatability, but there's a new v2 version which includes a
corner_sampled flag (when the grid is sampled on cell corners rather
than centrally) and a gain_format, which allows different fractional
precision in the uint8_t values, and even a u4.10 16-bit format.
Calls through the V4L2 interface to the ISP should use the v2
style of structure.
The new 3-channel method wants 16-bit black levels whereas the single-channel method uses native sensor bit depth. This does lead to some slightly awkward code; please refer to the inline comments for the conventions used.
MMAL and video_render used not to allow the client to set the column
stride or the chroma offset.
format->es->video.width wasn't actually being used for anything as
mmal_encoding_width_to_stride returns 0 meaning the component has to
compute it.
Add an extra flag for format->flags (MMAL_ES_FORMAT_FLAG_COL_FMTS_WIDTH_IS_COL_STRIDE)
that treats format->es->video.width as the column stride instead of
being ignored.
video_render also used to ignore nSliceHeight (format->es->video.width)
on the column formats.
Adding support in setting that (via vc_image vpitch) means that you can
crop down a larger image with the chroma in a different place.
eg width=(col stride), height=2160, crop.width=1920, crop.height=1080
flags = MMAL_ES_FORMAT_FLAG_COL_FMTS_WIDTH_IS_COL_STRIDE
will display the top left 1080p image out of a 4k source image.
This fixes infinity loop at tvservice_wait_for_reply on initialize
with older firmare. [E] No multi display support in firmware!
Checked with `tvservice --list`
The advanced deinterlaced algorithm wanted 16 extra lines of height on
SAND images as a scratchpad. vc_image had been hacked to add those lines
to each and every SAND image.
HEVC decode uses SAND but doesn't care about that context, and will never
support interlaced content.
Remove the +16 lines from vc_image, and add specify it as a vpitch when
creating the image from within the decoder.
The HEVC block and various others don't require tall mode, it's only
the H264 codec block that has to keep the column stride below
64kB.
Switch the default configuration to NOT require tall mode.
All the users of SAND with the H264 block are currently internal
to the VPU (video decode will vc_image_convert, or pass an opaque
VC_IMAGE_T. Camera to video_encode either goes via planar, or is
passing a VC_IMAGE_T).
Add a flag to these when creating the images to request tall mode.
vcilcs requries libbrcmEGL, libbrcmGLESv2 and libkhrn_client which have
only 32 bit versions currently, so disable it when building aarch64
Signed-off-by: Dagg Stompler <daggs@gmx.com>
Drops
host_applications/android/apps/vidtex
interface/mmal/openmaxil
interface/mmal/client(/brcmjpeg)
as they aren't directly supported and need further fixup for 64bit.
Where 32bit values are passed down to the VPU, these need to
be mapped into a lookup table within the client. Any pointers
that happen to be within structures such as MMAL_ES_FORMAT_T
are already recreated at each end, but the IPC structures must
always be of the same structure.
Where there are pointers to host side client contexts or component
handles, these are stored in lookup tables and a 32bit handle passed
to the VPU. On return these are looked back up again to convert
back to the handle.
Calling mmal_vc_shm from the constructor means that vcsm_init
is initialised very early. Should another user come along and
want to use export then it can't.
Move mmal_vc_shm init and exit calls to mmal_vc_component_create /
destroy so that other things can be created first, and reference
count calls so that it can be called for every component.
Wasn't handling the new bitmap based flag for ID correctly
in the send command function. Not picked up before as this
function is not used by many commands, and it was simply missed
Moved the command check to before the point where the ID bit is set.
Commands now use a bit set to specify that they include
a display_id parameter, rather than having two sets of
commands, one with and one without the display_id.
Makes things a lot easier.
Tested on Pi4 and Pi3 with older firmware to check backwards
compatibility. Seemed OK.
Previously, not able to run new tvservice app on firmware that
did not support the new commands. You could use old apps on new
firmware though!
This fixes this and forces use of old non-ID display commands
on older firmware.
Add basic support for deep color RGBA. Images can be uploaded/copied and
displayed via dispmanx but there is no support for converting to other
formats.
Argon 10bit YUV had been temporarily hacked in as a modified
YUV_UV format. Actually add it as a new image format at Scalerlib,
vc_image, IL, and MMAL levels.