Skip to content

Add static analysis workflow #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Conversation

ardera
Copy link
Owner

@ardera ardera commented Sep 15, 2024

No description provided.

Repository owner deleted a comment from github-advanced-security bot Sep 15, 2024
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED("-Wfloat-equal")
for (int i = 0; i < a->size; i++) {
if (a->float64array[i] != b->float64array[i]) {

Check notice

Code scanning / CodeQL

Equality test on floating-point values

Equality checks on floating point values can yield unexpected results.
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED("-Wfloat-equal")
for (int i = 0; i < a->size; i++) {
if (a->float32array[i] != b->float32array[i]) {

Check notice

Code scanning / CodeQL

Equality test on floating-point values

Equality checks on floating point values can yield unexpected results.
case kStdFloat64:
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED("-Wfloat-equal")
return raw_std_value_as_float64(a) == raw_std_value_as_float64(b);

Check notice

Code scanning / CodeQL

Equality test on floating-point values

Equality checks on floating point values can yield unexpected results.
@ardera ardera changed the title Add workflow to run scan-build automatically Add static analysis workflow Sep 16, 2024
@ardera ardera force-pushed the feat/static-analysis-workflow branch from e309e22 to 80321d6 Compare September 16, 2024 22:06
ardera added 25 commits May 8, 2025 21:51
When uploading memory with size X into a dmabuf, create a buffer that is square
(e.g. sqrt(x) by sqrt(x)) instead of one that is X pixels wide and one pixel
high.

Drivers have limitations on buffer dimensions, and e.g. the intel (iris) driver
ran into this limitation.
Use playbin3 for playback instead of uridecodebin.
This also enables audio support.

Furthermore, separate out the appsink (which
uploads buffers into a flutter texture) into a
separate "pseudo" gstreamer-element,
which can be created using `flutter_gl_texture_sink_new`.

Synchronization is reworked as well, it is now
assumed the player is only accessed from a
single thread, the platform thread.

The callbacks called by gstreamer (which are
called on internal threads) will rethread, if necessary,
by posting messages to the GstBus.

The buffering query is also now properly fixed.
Previously it queried the playbin instead of the
element that does the actual queueing (a `multiqueue`).

Also, a one-shot debug logging message is
added to the frame uploader, to inform the user
when slower, manual dmabuf uploads are used
instead of zero-copy.
Only supported since gstreamer 1.24.0 and
requires some more work to implement correctly.
Also don't use conditional compilation in places
that don't absolutely depend on it.
There's an issue in the gstreamer video4linux2 plugin where seeking will lead
to buffer management issues, causing streaming to stop, or even
memory leaks.

See: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4465
- add `raw_std_method_call_from_buffer` to
  create a "raw_std_value" from a byte buffer
  & size, and check whether its encoding is
  valid
- add `platch_respond_malformed_message_std`
  to send a pre-determined response if
  the encoding was invalid
Used by Zed to store clangd cache.
- add audio balance setter/getter
- support releasing & prerolling a playback
  source
- add separate seeking info, duration and
  end of stream notifiers
- make gstreamer_video_player.h not
  depend on gstreamer headers (if possible)
Finishing unifying playback element used by
audioplayers and video player plugins.
Did cause a message to be logged on every atomic commit.
On Raspberry Pi, the fix is now backported to 1.22:
  RPi-Distro/repo#391

This reverts commit dc0ff2a.
Was added in gstreamer 1.20, debian bullseye is still on 1.18.
Uses gstreamer 1.20.0-only API and is only used for 1.20.0
anyway.
Change notifiers should only trigger when
notifier_notify is called, not on listen.
gstplayer:
- allow registering callbacks for async seeks/state changes
- implement gapless looping using playbin about-to-finish or
  segments
- listen to GST_MESSAGE_EOS instead of appsink eos signal,
  since appsink is only used as a video sink for video playback.
- query duration in GST_MESSAGE_DURATION_CHANGED message

audioplayers:
- actually send prepared, completed, seek completed and
  error events
- handle incorrect file source uris by audioplayers
- fix incorrect non-null terminated string printing

gstreamer_video_player:
- enable gapless looping by default
- allow overriding it in set_looping call
player

Respond with a detailed error message, that
pipeline playback is not yet implemented instead of
just "video player creation failed".
Disable audio for video players by default, for compatibility.
Only enable when calling `createWithAudio` platform channel method.
@ardera ardera force-pushed the feat/static-analysis-workflow branch from 80321d6 to 8cd0bad Compare June 21, 2025 11:44
ardera added 2 commits June 21, 2025 17:51
Only diagnose flutter-pi sources by default.

The diagnosis results are uploaded as an HTML workflow artifact for
debugging.

Also, remove the old (unused) CodeQL workflow, which had a lot of
hard to disable false positives.
Mostly double-float casts, functions without arguments without an
explicit `void` in the parameter list, but in platformchannel.c there
were actually some memory leaks on error paths, which are now fixed.

Also enable -pedantic for even more diagnostics.
@ardera ardera force-pushed the feat/static-analysis-workflow branch from 8cd0bad to 9617e92 Compare June 21, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant