Commit Graph

10611 Commits

Author SHA1 Message Date
Martin Pulec
7d52ed0948 get_temp_file: removed debug printf
committed mistakenly
2025-03-31 11:42:35 +02:00
Martin Pulec
f4d94066c8 unit_evaluate: accept binary suffixes
+ test
2025-03-31 09:15:51 +02:00
Martin Pulec
5ed4b72ca4 unit_evaluate[_dbl]: set the endptr unconditionally
Even if no number is parsed, set the endptr. This is consistent with
strtod (and family) behavior.
2025-03-31 09:15:50 +02:00
atrivialatomic
51c9fb71b6 compress/cmpto_j2k.cpp - refactor to implement upstream changes and keep CPU compress working
Moved some interfaces to be inside of the state_video_compress_j2k class rather than outside of it. Still WIP, as additional testing is needed on a system with CUDA.

- Renamed parse_fmt(const char*) to parse_opts(const char*)
- Created more function predeclarations
- Renamed cuda_convert_funct to cmpto_j2k_enc_preprocessor_run_callback_cuda
- Created additional member functions of state_video_compress_j2k struct
    - bool compare_video_desc(const video_desc& video_desc);
    - bool compare_video_desc_and_reconfigure(const video_desc& video_desc);
    - void stop();
    - void try_push_image(std::shared_ptr<video_frame> tx);
    - shared_ptr<video_frame> try_pop_image();
    - bool set_pool(const video_desc& video_desc);

- Added additional struct members to state_video_compress_j2k
    - struct cmpto_j2k_enc_ctx_cfg*     ctx_cfg = nullptr;
    - bool  configured  = false;
    - bool should_exit = false
    - const char*   configuration_opts;

- Commented out functions that have been moved to be internal class methods
    - static void set_pool(struct state_video_compress_j2k *s, bool have_gpu_preprocess);
    - static bool configure_with(struct state_video_compress_j2k *s, struct video_desc desc)
2025-03-28 17:52:41 -04:00
Martin Pulec
3c6e5d5d41 Vk debug_callback: use to compat for ver up to 303
Also eg. distro Vulkan in Ubuntu 22.04 seem to be affected. The change
seem to be introduced with Vulkan headers version 304 (commit d4a196d8).
2025-03-28 15:49:14 +01:00
Martin Pulec
16943b4406 vcap/rtsp: includ H.265 in support list in help 2025-03-28 14:11:01 +01:00
Martin Pulec
2a1deceab8 rtpdec_h264: fixed incorrect address-of taken
Using operator & makes it actually the type uint8_t (*)[2], althoug the
pointer value remained the same. The cast then pruned the type - added
checks before the cast if the value given is really ptr to a char type.

Dropped the HEVC hint - now little-endian uint16_t ptr cannot be passed
by mistake.
2025-03-28 14:11:00 +01:00
Martin Pulec
4ef3f49297 rtpdec_h264: fixed cropping
If cropping_flag is used, from the size the margin was perhaps incorrectly
substracted twice times. Eg. in the example stream from the previous commit
the resolution was not 1920x1080 but 1920x1792 - 8 was substracted twice).
2025-03-28 11:50:57 +01:00
Martin Pulec
707422d291 h264_stream: compat with 444 subsampling
Sync the h264_stream source with [upstream] (commit 70124d30) because
the decoding of 4:4:4 subsampled H.264 video fails. Problematic stream
can be generated with:
```
docker run --rm -it --network=host bluenviron/mediamtx
ffmpeg -re -f lavfi -i smptebars=s=1920x1080 -pix_fmt yuv444p \
     -vcodec libx264 -f rtsp rtsp://localhost:8554/mystream
```

For that the read_seq_parameter_set_rbsp() called on PPS NALU from SDP
(sprop-parameter-sets) gave completly wrong resolution 16x160 - evidently
the header was misinterpreted.

The code is taken mostly unmodified (just internal functions set static
in prototype).  debug_sps() not updated (no longer compiles so commented
out).

[upstream]: https://github.com/aizvorski/h264bitstream
2025-03-28 11:50:37 +01:00
Martin Pulec
e41ab00ac6 parse_mtu: erase '!' before parse_number call
Do not pass number with trailing '!' to parse_number, which would
refuse it.

fixed GH-438
2025-03-28 08:47:47 +01:00
Martin Pulec
90ee52db0e rtpdec_h2645: use common decode_frame function
the handling is mostly the same

+ change MOD_NAME to rtpdec_h2645 (HEVC inclusive)
2025-03-27 13:43:29 +01:00
Martin Pulec
4ced077d94 rtpdec hevc: implement aggregation packets (untested) 2025-03-27 13:43:29 +01:00
Martin Pulec
07715c62e2 rtpdec_hevc: implement FU packets 2025-03-27 13:43:29 +01:00
Martin Pulec
e96314c9f5 HEVC RTP: support for 2 byte HEVC NAL header 2025-03-27 13:43:29 +01:00
Martin Pulec
7464d865e5 rtp hevc: add addition RTP types (aggregate, FU) 2025-03-27 13:43:28 +01:00
Martin Pulec
98d25a17a0 lavd: accept also different NALs for HEVC start
Accept also different NALs than VPS for HEVC decode start - VPS is first
in UG generated HEVC stream but must not be the case always.

Also debug dump the actual NALU names.
2025-03-27 13:43:28 +01:00
Martin Pulec
3134b14c28 rtpdec: add HEVC initial support 2025-03-27 13:43:28 +01:00
Martin Pulec
00ff09f3e0 separate H.264 and HEVC NALU types
Those sets are distinct in general (eg. the types 0-9 seem to be defined
differently for H.264 and HEVC).
2025-03-27 13:43:28 +01:00
Martin Pulec
9c6554851d vcap/rtsp: set frame prop when creating
It is possible that width/height is not yet set but it doesn't matter -
the demuxer sets it when detected.
2025-03-27 13:43:28 +01:00
Martin Pulec
d769384571 vcap/rtsp: parse HEVC metadata from SPS in SDP
HEVC not yet fully working - the actual packet decode needs to be done.
2025-03-27 13:43:27 +01:00
Martin Pulec
3cb0a2c135 vcap/rtsp: do not hard-set H264 decompress codec
We can now have also JPEG and in future HEVC, the .color_spec should
already be set correctly in the video_desc.
2025-03-27 13:43:27 +01:00
Martin Pulec
de410a05bc nal_to_rbsp: return also first byte
In [upstream] of h264_stream.c the iteration is from 0 but the byte is
subsequently consumed so use this variant. This should be idempotent
(aside of a little more instructions performed) but it will be used
also by the HEVC bitstream parser.

[upstream]: https://github.com/aizvorski/h264bitstream
2025-03-27 13:43:27 +01:00
Martin Pulec
8b547de34e rtpdec_h264: remove fill_coded_frame_from_sps()
fill_coded_frame_from_sps() and width_height_from_SDP() are almost the
same, except than different prototype (1st filss W/H of video_frame) and
additional debug message of the second, so keep just the second.
2025-03-27 13:43:27 +01:00
Martin Pulec
c8873da0b8 get_nals: improvements
- statically allocate the string s - 1500 should be available on stack
almost everytime
- use strtok_r (thread-safety)
- strstr -> strchr
- no need to memset s and setting nals[0]='\0'
- fgets - use the whole size of s (fgets reads n-1 bytes so cstr cannot
be truncated)
2025-03-27 13:43:27 +01:00
Martin Pulec
a2d98d5d98 add codec alias "H265"
the H265 can come from rtpmap parsed in RTSP capture
2025-03-27 13:43:24 +01:00
Martin Pulec
9d8ab816e2 vulkan_context: debug_callback compat
compat with old Vulkan as in Debian 11 (still used for ARM builds)
2025-03-27 12:35:07 +01:00
Martin Pulec
e2f0ddc6eb CI ARM: set CFLAGS for 32-bit off_t
The flags queried also for 64-bit ARM but it is empty there.

This does basically the same as the commit f46a101c, that adds
_FILE_OFFSET_BITS=64 define to config.h. But the config.h may not be
always included now.

+ compat/misc: typo in comment + assert 64b off_t (off_t should be
actually 64b in _OFF64 env and >= 64b in _OFFBIG so assert at least 64)
2025-03-27 12:17:34 +01:00
Martin Pulec
3aa6c398f8 CI PCP: change also repo URL
There is a redirect from libpcp/pcp.git but it is better to have this
explicitly.
2025-03-27 09:54:22 +01:00
Martin Pulec
59543ca26f configure.ac: pcp has changed pkg-config name 2025-03-27 09:13:25 +01:00
Martin Pulec
167cf0ce53 utils/nat: IWYU 2025-03-27 09:13:25 +01:00
Martin Pulec
b09636241d main: mk fun adjust_ports from adjust_param
Separated adjust_ports() from adjust_params - the stuff is a bit complex
now, so use rather separate function that encapsulates the tweking.
2025-03-27 08:03:40 +01:00
Martin Pulec
159f687c90 respect the selected port if sending over loopback
`uv -t testcard -d gl -P 5004` didn't select the port 5004 until now
2025-03-27 08:03:26 +01:00
Martin Pulec
d6a42b38e3 CI PCP ARM Linux: Debian 11 build fix
Debian 11 has autoconf v0.69 only but the PCP configure.ac now requires
2.71, perhaps needlessly.
2025-03-27 07:36:15 +01:00
Martin Pulec
5bd65911cd CI: remove U20.04 compat
+ update TODO for pipewire where still neeeded for Debian 11
2025-03-27 07:36:11 +01:00
Stefan Hueneke
1eb4a96de9 Merge branch 'wip-cmpto-j2k-cpu' into wip-cmpto-j2k-cpu-merge-check 2025-03-26 14:27:58 -04:00
Martin Pulec
5d3c9f9e06 vcomp/lavc: accept no_intra_refresh
and no_interlaced_dct

The original option names are prefixed with disable_ to disable. But if
user (mistakenly) uses "no_XY", it actually did the opposite. So rewrite
the condition to accept both variants for now. The "no_" prefix may be
more natural and it might be switched to in future.

Also accept "no_header_inserter" aside the original "header_inserter=no"
- the original syntax is inconsistent with the other options above - this
could be unified later.

+ removed duplicite line
2025-03-26 15:32:55 +01:00
Martin Pulec
c84422ab84 AppImage Firejail: suppress private-tmp in config
Upstream Firejail (0.9.75) has now private-tmp enabld by default in
default.profile, which breaks run from the nounted AppImage.
2025-03-26 14:25:35 +01:00
Martin Pulec
4caf732be1 rtp.h: do not include config_*.h 2025-03-26 11:06:46 +01:00
Stefan Hueneke
a07bbd750e Merge pull request #4 from CESNET/master
Update fork to master branch
2025-03-25 14:06:30 -04:00
Martin Pulec
6bcac129b7 macOS lib bundle: move from Makefile to a script
Extend the script added by previous commit to one handling the entire
bundling from Makefile.

It is nicer having the scripting outside the Makefile, anyways, and the
bundle LC_RPATH fix workaround closly relates to bundling.
2025-03-25 14:12:43 +01:00
Martin Pulec
393fd8a415 utils/local_buard,resource_manager: IWYU 2025-03-25 13:13:30 +01:00
Martin Pulec
31ea569352 aplay/coreaudio: remove unneeded config*.h 2025-03-25 12:36:36 +01:00
Martin Pulec
cfca08b895 audio/playback/*: IWYU 2025-03-25 11:24:10 +01:00
Martin Pulec
ca93e7db8f wav_{reader,writer}: IWYU 2025-03-25 10:56:11 +01:00
Martin Pulec
c2116835da compat/platform_{pipe,semaphore}: IWYU 2025-03-25 10:56:10 +01:00
Martin Pulec
26ffbfded8 gl_common,glx_common: IWYU 2025-03-25 09:17:19 +01:00
Martin Pulec
e8cd71b259 vcap/import: IWYU + aligned_malloc compat 2025-03-25 09:17:13 +01:00
Martin Pulec
70903661f9 vdisp/dummy, x11_common: IWYU 2025-03-25 08:37:14 +01:00
Martin Pulec
d31f1e2797 vcomp/lavc version: print ver from run-time linked
Do print the runtime lavc version instead the one from headers, that
may differ (minor and patch only).
2025-03-25 08:20:42 +01:00
Martin Pulec
bef67b7879 acap/testcard, vdisp/dump: IWYU 2025-03-24 17:29:01 +01:00