852 Commits

Author SHA1 Message Date
James Hughes
aaf33e589a Default runs that require interaction to infinite time
Things like keyboard and signal mode by default will only last 5s
which is confusing, so now they default to run indefinitely
unless overidden with the -t option.
2018-11-30 10:14:55 +00:00
Dave Stevenson
b9f8c5b19b raspivid: Fix so you can record raw without encoding too.
You could use raspividyuv to do it, but there's no reason to
prevent doing it in raspivid.
2018-11-26 11:52:33 +00:00
Phil Elwell
d574b51a60 dtoverlay: Use SUDO_USER in -pre and -post scripts
This patch replaces the hardcoded "pi" user in the dtoverlay-pre and
dtoverlay-post scripts with $SUDO_USER, which is set by the sudo command
to the ID of the user calling it. In the event that SUDO_USER isn't set,
$LOGNAME is used (set by login shells), with an ultime fallback to "pi".
This change is necessary for users who have changed the login ID, perhaps
as a security measure.
2018-11-06 13:05:37 +00:00
Dave Stevenson
6312ae528d Fix IL documentation omissions/errors. 2018-11-06 12:49:53 +00:00
Dave Stevenson
91a884e248 MMAL/IL: Add support for components to report alignment requirements.
Add parameter to allow RIL components to report the buffer alignment
requirements, and the core will the do those alignments.

It would make more sense for the mmal_port_format_commit to fail
should the width/height not be suitably aligned, rather than just
amending the format and not telling userland.
2018-11-06 12:49:53 +00:00
Dave Stevenson
6c169f9757 annotate: Add options to move the text and set justification
Adds extra fields to the IL and MMAL parameters to set justification
as centre/left/right, and add an x and y offset.
Retains backwards compatibility
2018-11-06 12:49:53 +00:00
Dave Stevenson
ae1dd9e5a6 vc_image: Add vpitch to linear RGB formats
Adds a vpitch option for linear (not TF) RGB formats so
there is an option for not having the height aligned to
a multiple of 16 lines.
2018-11-06 12:49:53 +00:00
Phil Elwell
30b5fd7a8b Updates for VS2017 compatibility 2018-11-06 12:49:53 +00:00
Dave Stevenson
7c98083fa2 image_fx: pass all user buffer flags.
IL didn't have the user buffer flags defined, so there were some
magic (1<<X) flags kicking around. Formalise those as defines.

image_fx was passing only 1<<30 and 1<<31 through. Pass all the
user buffer flags through instead.
2018-11-06 12:49:53 +00:00
Gordon Hollingworth
a421909718 Add logging_messages to UART
This commit adds logging_messages begin pushed out to the UART output
it is enabled in one of three ways:
1) sed -i -e "s/BOOT_UART=0/BOOT_UART=1" bootcode.bin
2) Adding a file UART to the SD card
3) Adding uart_2ndstage=1 to config.txt

Using the sed will get you earlier debug than UART which will get
earlier than uart_2ndstage

Altering the logging level for vcos messages has been added as such:

vcos_logging_level=*:info,brfs:trace,confzilla_be:warn

This means everything will default to info level, except brfs which gets
trace and confzilla back end which gets warnings.  The logging_level
still exists but only controls the vcfw logging levels.
2018-11-06 12:49:53 +00:00
popcornmix
5ece9f3669 mmal: Remove unused mmal_metadata header file
See: https://github.com/raspberrypi/userland/pull/475
2018-11-06 12:49:53 +00:00
Dave Stevenson
94ce4abca7 mmal: Populate buffer->type->video.flags field
Some of the buffer flags are designated as
MMAL_BUFFER_HEADER_VIDEO_FLAG_xx instead of MMAL_BUFFER_HEADER_FLAG_xx
and are intended to be in buffer->type->video.flags instead of
buffer->flags. The implementation put them in buffer->flags.

Populate both fields with these flags.
2018-11-06 12:49:53 +00:00
Dave Stevenson
565dd59ce1 MMAL: Populate buffer header TYPE_SPECIFIC fields.
MMAL_BUFFER_HEADER_T has a TYPE_SPECIFIC fields, which for
video includes the number of planes, pitches and offsets.
This hasn't been populated previously, but it can be helpful
for interfacing to the likes of DRM and FFMPEG to be given
these values.

RIL doesn't support these values, so precompute them for
output ports based on the port format.
2018-11-06 12:49:53 +00:00
Dave Stevenson
5c1619589c mmal: Remove unused mmal_metadata header file (part 2)
See: https://github.com/raspberrypi/userland/pull/475
2018-11-06 12:49:53 +00:00
popcornmix
f6a14420f6 mmal: Remove unused mmal_metadata header file
See: https://github.com/raspberrypi/userland/pull/475
2018-11-06 12:49:53 +00:00
Phil Elwell
4d41ce6ee1 arm_dt: Work around an absent cache-line-size
The upstream VCHIQ has been denied its cache-line-size property and
forces a cache line size of 32. This doesn't work on V7/8 cpus with
64-bit cache lines.

If an updated DT is found (based on the size encoded in the reg
property, which should be 0x3c not 0xf, and the vchiq node name
"mailbox@7e00b840"), assume the kernel is using the correct cache
line size. A corresponding kernel patch derives the correct value,
and updates the size as indicated.
2018-11-06 12:49:53 +00:00
Phil Elwell
c8c0b7638a dtoverlay: More "reg" and "name" support
Allow node names to be changed by assigning to the "name"
meta-property.

Don't create or extand a "reg" property, but do overwrite it if
it already exists.
2018-11-06 12:49:53 +00:00
Phil Elwell
58021d2342 dtoverlay: Also allow "fragment-<n>" in overlays
The old "fragment@<n>" syntax causes newer versions of dtc to complain
about missing "reg" parameters, so there is a move to replace the '@'s
with '-'s. All that really matters is that the node names are distinct.
Modify the dtoverlay library to cope with either form. I don't think
it is necessary to cope with arbitrary fragment names, and keeping
this restriction makes handling disabled ("__dormant__") fragments
easier.
2018-11-06 12:49:53 +00:00
Dave Stevenson
035a2e150a dispmanx: Add option to ignore all layers lower than the current layer
Adds option DISPMANX_FLAGS_ALPHA_DISCARD_LOWER_LAYERS to DispmanX
alpha flags that sets the current layer as effectively totally opaque
and full screen, therefore obscuring anything below and avoiding adding
it to the HVS display list.

Plumb it through IL/MMAL as well so that it can be used as a simple way
to hide the frame buffer from the display.
2018-11-06 12:49:53 +00:00
Dave Stevenson
58f4b168d3 IL hvs component.
New component that wraps the HVS hardware to allow for scaling, format
conversion, and alpha blending of source images.
2018-11-06 12:49:53 +00:00
Spinki
9d5e5b56d2 Delay after first frame, burst-mode #494
https://github.com/raspberrypi/userland/issues/494
2018-10-31 16:36:28 +00:00
Dave Stevenson
27b4eaa6c8 mmal: Correct encoding 4CC for SBGGR16
It was identical to SRGGB16 ('RG16'), so correct to 'BG16'.
2018-10-25 18:15:15 +01:00
Alex Houghton
3be9b5a325 Raspivid: Fix for bug where %04d no longer works.
When inserting the time/date stamp into the filename was added
certain combinations of output filename no longer work. As it
was only searching for "%u" or "%d". Specifying %04d would take
the code down the timestamp route but with invalid parameters.

Make the search slightly more intelligent to allow specifying
the number of digits to insert in the filename.
2018-10-15 09:51:39 +01:00
Dave Stevenson
8f0abfb07b mmal: Relax requirement on a buffer in mmal_port_send_buffer
If the alloc_size of a buffer is flagged as zero, then remove
the requirement for buffer->data to be non-NULL in
mmal_port_send_buffer.

This is initially an optimisation for the V4L2 codec support
where there is a need to send an EOS flag on an empty buffer,
so saves allocating the buffer which will never be used.
2018-10-12 13:33:53 +01:00
Dave Stevenson
1275cdc0bc Raspistillyuv: Add option for bgr888 capture 2018-10-12 13:33:53 +01:00
dhamp
de4a7f2e3c Raspivid: add an option to add sps timings (#488)
Raspivid: add an option to add H264 sps timings

H264 SPS headers can include a timings section which the Pi defaults to not including.
Add an option to raspivid to enable these timing parameters.

This patch also refactors setting some parameters which are all conditional on the codec being H264.
2018-10-03 12:58:43 +01:00
xginn8
4055450aac Fix up typos in vcgencmd.h 2018-09-25 14:20:32 +01:00
Dave Stevenson
d491937e8d host_apps: Add --no-as-needed to stop libmmal_vc_client being dropped
Some versions of GCC have --as-needed turned on by default.
The binding of libmmal_vc_client is such that the constructor
registers the supported components with the MMAL core, and nothing
calls into it directly. The linker can't tell this, decides
it is unused, and promptly drops it as a dependency - cue no
VideoCore components.

Adding --no-as-needed means that the linker leaves it alone.
It's not nice, but there doesn't appear to be a better solution.

See #178.
2018-09-07 19:37:27 +01:00
jasaw
4228b6c116 RaspiStill: Apply gpsd info as EXIF tags (#286)
* RaspiStill: Apply gpsd info as EXIF tags

Applies GPS information from gpsd as EXIF tags.
Enable via "-gps" command line argument and requires libgps.so.22 when
enabled.
Only these GPS info are added as EXIF tags: GPSDateStamp, GPSTimeStamp,
GPSMeasureMode, GPSSatellites, GPSLatitude, GPSLatitudeRef,
GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef, GPSSpeed,
GPSSpeedRef, GPSTrack, GPSTrackRef.
2018-08-23 17:47:33 +01:00
Dave Stevenson
25155c00f8 mmal: Add KEEP_PORT_FORMATS flag to mmal connection
There's a slightly quirky use case with deinterlacing.
Interlaced YUV420 is line interleaved, so chroma line 1
is that for luma lines 1&3, and chroma line 2 is for luma lines 2&4.
If you pass such a frame into a standard component (eg the ISP), it
messes up the chroma by assuming chroma line 1 is for luma lines 1&2.

If you pass it into the ISP as double width by half height then the
chroma subsampling behaves correctly. Normally that precludes using
a mmal_connection as that will copy the port format from output
to input. Setting this new flag skips that stage and makes it the
client's responsibilty to set both port formats appropriately.
2018-08-22 17:15:07 +01:00
Dave Stevenson
f74ea7fdef Raspicam: Update for justification and offset in annotation
Camera annotation can now support left and right justification of
the text, and setting an x and y offset.
Update the raspicam apps to allow taking these via the command
line.
2018-07-26 14:10:01 +01:00
Dave Stevenson
53469d984d annotate: Add options to move the text and set justification
Adds extra fields to the IL and MMAL parameters to set justification
as centre/left/right, and add an x and y offset.
Retains backwards compatibility
2018-07-26 14:10:01 +01:00
Dave Stevenson
e5b2684c50 hello_pi: encode: Clean up indentation to use 3 spaces and no tabs 2018-07-26 14:10:01 +01:00
Dave Stevenson
61509e9794 hello_pi: encode: Process the buffer before returning for filling.
The code was calling ilclient_get_output_buffer to retrieve a
filled buffer, and then immediately returning it via OMX_FillThisBuffer
before looking at the contents.
OMX_FillThisBuffer does not block, but relies on waiting for the
FillBufferDone callback instead.

The correct order of doing things is to call ilclient_get_output_buffer
(which waits on FillBufferDone if necessary), process the buffer,
and then call OMX_FillThisBuffer to pass it back to OMX for filling
again.

The recent improvements to video_encode mean that it is faster at
processing buffers and would often have reset the buffer header before
hello_encode had a chance to save the data.
2018-07-26 14:10:01 +01:00
Dave Stevenson
0a66a9ab69 hello_pi: encode: Use portdef for generating the test card
It was using assumed knowledge of the padding instead.
The requirements on video_encode have recently been reduced
and the assumptions were therefore invalid and caused a segfault
2018-07-26 14:10:01 +01:00
Dave Stevenson
c0ea9294a3 RaspiVidYuv: Don't enable video port if not capturing
The app was unconditionally enabling the video port on the camera
component, which meant that the component was waiting for buffers
that were never sent (that was conditional).
Move the port enable to within the same conditional.
2018-07-20 18:13:43 +01:00
Dave Stevenson
6633d273be Raspi(Still)Yuv: Add support for -md to set the sensor mode
Missed from this app for some reason. Add it.
2018-07-20 18:13:43 +01:00
James Hughes
11694effb4 Merge pull request #479 from JamesH65/segment_timestamp
Segment timestamp
2018-07-20 16:19:28 +01:00
James Hughes
8dd6e4e1d0 Option to specify timestamp in the segment filename
In segmented mode, this allows you to specify that the file
name for each segment uses a time based filename, not a segment
number based one.
If the filename contains %d or %u a segment number is used.
Anything else, and the filename string is used as a formatting
string for the strftime function.
2018-07-20 15:52:12 +01:00
Dave Stevenson
f7a51ddea8 RaspiVidYuv: Check and disable the correct port on shutdown.
The app was checking the stills port during shutdown which is never
used in this app. It should have been checking the video port.
2018-07-19 15:20:28 +01:00
Dave Stevenson
1ad320676e Raspistill: Add support for TGA and PPM output
Firmware from June 2018 has support in image_encode
for PPM and TGA encoding (no hardware acceleration).
Add these as output options to RaspiStill.
2018-07-19 15:20:28 +01:00
James Hughes
8b28006c3d Fixed up initial timelapse delay
When in timelapse mode, the delay before the first shot
was the timelapse value. However, if a low value is set
this does not give enough time for the AE etc to settle.

In addition, the first image was only taken after the
first delay, rather than immediately which is what would
be expected. So a 5minute timelapse delay meant the 1st
image was only taken after 5 minutes.

The patch sets the delay for the first image capture to
be a constant value, 1000ms. So always time for the AE etc
to settle.

Fixes: #429, #473
2018-07-18 16:12:10 +01:00
Tim Gover
409dfcd90b glxx_client: Fix glGetBufferParameteriv GL_BUFFER_SIZE
glGetBufferParameteriv updates the client side cached copy of the
buffer_size. However, when it updated the cache it by calling
glxx_buffer_info_set it trashed the mapped_pointer and mapped_size
values because they are in the same structure as the cached_size but
this was being allocated on the stack.

The trampled mapped_pointer / mapped_size could cause crashes or invalid
buffer data to be uploaded.

Change to read the current cached value and then modify just the
cached_size preserving whatever was in the cache before.

Fixes #323

Signed-off-by: Tim Gover <tim.gover@raspberrypi.org>
2018-07-04 13:54:19 +01:00
James Hughes
e8242c3950 Merge pull request #471 from timg236/bug246
glxx_client: Fix glMapBufferOES with GL_STREAM_DRAW
2018-07-02 16:34:49 +01:00
Tim Gover
8ccdc868d3 glxx_client: Fix glMapBufferOES with GL_STREAM_DRAW
glMapBufferOES fails if the usage hint passed to glBufferData was
GL_STREAM_DRAW because glBufferData does not initialise the cached copy
of the buffer size.

The usage hint doesn't make any functional difference with these
functions and GL_STREAM_DRAW was added in GLES 2.0 so this looks like
an old check which was never updated.

Fixes #246
2018-07-02 15:27:08 +01:00
Dave Stevenson
2448644657 RaspiVid: Return an error if the overall encode exceeds level 4.2
The error handling forgot to set an error status, so main continued
on and then seg faulted due to no encoder component.

Fixes #464.
2018-05-11 10:48:05 +01:00
stiltr
a343dcad1d Add bcm_host to ARM64 builds 2018-03-29 21:03:49 +01:00
Dave Stevenson
eb3e6d7b3d mmalomx: Add a README to say this library is deprecated. 2018-03-18 12:19:39 +00:00
Dave Stevenson
07d8891ab5 mmalomx_util: Correct mapping errors in mmalomx_param_mapping_fps_range
Fixes mapping error from xFramerateLow to fps_high.

Fixes #456.
2018-03-18 12:19:39 +00:00
Sugizaki Yukimasa
de372ec001 pkgconfig: vcsm: Add -lvcos to Libs
libvcsm.so is linked with vcos in
host_applications/linux/libs/sm/CMakeLists.txt , so changed to specify
it in pkgconfig file.
2018-03-15 14:34:58 +00:00