Commit Graph

392 Commits

Author SHA1 Message Date
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
724eaff424 parse_mtu: additional checks
Added additional number validitiy check (to newly created parse_number
function). Mainly to cover inputs like '1something'  where it should
not be parsed correctly as being 1.
2025-03-17 15:54:45 +01:00
Martin Pulec
84c3e5571d MTU size check: improved
Do not use positional references to printf format string, which is a
POSIX extension and not supported by Windows C library.

+ write the optarg string (in case that is only partionally parsed -
atoi stopped at first non-number)

refers to GH-437
2025-03-17 15:51:20 +01:00
Martin Pulec
850138ab59 set ug_options.audio.codec_cfg=nullptr
The commit b785c3d8 from 2024-08-05 changed the default unconditionally
to PCM, but this has been true just for UltraGrid RTP, not RTSP or SDP
that used MP3, so this change reverts it back.
2025-03-06 10:59:26 +01:00
Martin Pulec
4a085c6c6c vrxtx/rtsp: allow compressed stream passthough
If the input is already compressed, try to pass it further. Initialize
the compression just if receiving uncompressed data.

This is implemented in the same way as it already is in vrxtx/sdp.

refers to GH-433
2025-03-05 16:09:05 +01:00
Martin Pulec
924453e5b0 use get_stat_color also for FPS
select the color automatically (lime for +- 2-5%, brown for >5% diff)

This simplifies the code by sharing the logic in common; also exceeding
FPS is now colored (until this just lower than nominal was colored).
2025-02-11 14:19:11 +01:00
Martin Pulec
72ac724fb1 correct color names
The actual value (5,2,1)/5 didn't match peach fuzz (255,190,152)/255
but the rather closest color is Tomato (255,99,71)/255.

The T_DARKER_ORANGE is poorly defined but its value (3,1,0)/5 matches
approximately the X11 color Saddle Brown (139,69,19)/255.
2024-10-21 10:55:27 +02:00
Martin Pulec
ef0cd7130d unify stod/stoi invalid_argument::what parse
This is a hack to check whether given invalid_argument message belongs
to stoi/stod. It is usually used to catch non-numeric user input where
a number was expected.
2024-09-13 15:35:44 +02:00
Martin Piatka
4682cf6506 main: Allow multiple --capture-filter options 2024-08-19 14:38:12 +02:00
Martin Pulec
5f90324328 tx: pass parent in common_opts 2024-08-13 12:59:51 +02:00
Martin Pulec
41b0388624 rtsp server: fixed audio props
Do not deduce audio properties from command-line parameters but from
the actual format that is being to sent.

Until now, the properties like ch_count and sample rate was deduced from
command-line parameters (ch_count from `-a channels=` and sample rate from
`-A xxx:sample_rate`). However, this is a bit fragile - the source may not
respect the `-a` parameters and also the `-A sample_rate` doesn't need
to be set, like in the following case:
```
uv -x rtsp -A A-law -a sample_r=8000 -s testcard
```

Here the capture sample_rate is set to 8000 but not parsed from parameters
(it must have been in `-A`). So SDP parameeters for RTSP was set
incorrectly (48000).
2024-08-09 09:22:59 +02:00
Martin Pulec
78f2a30f12 main: set audio data always
The audio state is always present (even if no audio rx/tx is used),
so set this always.

This will allow setting the data also for tx (the vrxtx) - the check if
either audio tx or rx is unnecessary (as indicated above).
2024-08-09 09:22:59 +02:00
Martin Pulec
0d143d3789 main: pass video_rxtx pointer to audio
will be used to register actual audio format for RTSP
2024-08-09 09:22:59 +02:00
Martin Pulec
e75d1f2591 renamed rtsp_types_t audio and video
renamed to rtsp_type_audio and rtsp_type_video

Although not causing probles by now, the name itself (which is as a
part of unscoped struct global) is very common so it could have caused
conflicts in future.
2024-08-09 09:22:58 +02:00
Martin Pulec
c637644b72 vrxtx/ihdtv: use argc/argv from global option 2024-08-09 09:22:58 +02:00
Martin Pulec
44e4946b22 main: removed unused rxtx param a_tx_port 2024-08-09 09:22:58 +02:00
Martin Pulec
603a0c39a3 audio_register_display_clks: use struct for params 2024-08-09 09:22:58 +02:00
Martin Pulec
1ab725d575 moved some common transmission opts to struct 2024-08-09 09:22:55 +02:00
Martin Pulec
b785c3d845 audio_options: do not duplicate def initialization
It should be either in audio/audio.h or main.cpp but not both because
it is unclear which will be used in the end.
2024-08-08 11:16:19 +02:00
Martin Pulec
9a2c632d16 removed av from enum rtsp_types_t
use rather the bit sum of `audio | video`
2024-08-06 16:25:12 +02:00
Martin Pulec
ea958702ea rtsp_utils: fixed a typo (rtSP instead of rtPS) 2024-08-06 16:25:12 +02:00
Martin Pulec
1efc15cfa0 main: print exception errors with logger
The problems are definitely fatal if caught on top-level.
2024-08-02 15:52:58 +02:00
Martin Pulec
5c48277b10 BasicRTSPOnlySubsession: basic support for IPv6
\+ do not force IPv4 for RTSP
2024-07-19 12:03:27 +02:00
Martin Piatka
ef8c7d4993 main: Allow multiple --audio-filter arguments 2024-07-16 12:44:39 +02:00
Martin Pulec
9880a1aa29 vcap/fps_indicator: use colors when low fps
Indicate lower than nominal FPS with different colors when using generic
FPS indicator.

This should help user to detect potential problems.
2024-05-16 09:54:23 +02:00
Martin Pulec
f379547fce main: capture_thread: early return if tx_frame==0
just a refactor, no functional change

\+ the same in print_fps()
2024-05-16 09:54:23 +02:00
Martin Pulec
ade96e561d moved FPS indicator prefix trailing ' ' trim
moved to video_capture.cpp  - it is a bit technical and it is nicer to
have it there than in the huge main.cpp
2024-05-16 09:50:08 +02:00
Martin Pulec
56a6dc78b0 replace remaining WIN32 platform macros
see the commit HEAD@{2}
2024-05-13 12:56:53 +02:00
Martin Pulec
4d82b59bb3 parse_bitrate: use also for hd-rum-transcode 2024-05-13 12:56:52 +02:00
Martin Pulec
cf2314de28 uv: make some shortopts as in hd-rum-transcode
to be consistent
2024-05-13 12:56:51 +02:00
Martin Pulec
13905c4d76 use dedicated server mode blackhole addr
- use custom IPv6 black hole address 100::556C:7472:4772:6453 instead
of 100::1, which a user may use explicitly to signalize server mode
- check just the one address, not the black hole prefix in general
(again, the user may select the discard address intentinally without
knowing our semantics)
- removed the black hole handling functions (no longer needed)
- compute the actual in6_addr from the string with inet_pton instead of
hard coding the value
2024-04-26 10:35:16 +02:00
Martin Pulec
84a9083c7b fixed video RX port explicit setting
Fixed the commit cb0f7fea (2023-05-09) which caused that -P <vrx>:<vtx>
didn't set the video bind port.
2024-04-18 12:37:56 +02:00
Martin Pulec
a9da4539d8 to_lavc_vid_conv: add stub for CUDA implementation 2024-03-08 16:11:46 +01:00
Martin Pulec
731a48e94f rxtx/sdp: default to mjpeg+mp3
Those doesn't need to be signalized in any way (PT is defined), so that
the receiver can play the streams directly without SDP - eg. `ffplay
rtp://[::1]:5004` (and similarly on port 5006).

MP3 (just added std TX) is set as default for RTSP as well - perhaps
not a big difference if MP3 or Opus so we do not need to handle two
cases. Also MP3 could be more compatible.
2024-02-05 09:40:49 +01:00
Martin Pulec
a984d04fd2 main: fixed multiple acap dev specification
The condition was written incorrectly, because it disallows only
combination of video-attached and standalone audio drivers but allowed
2 audio standalone drivers, which is unsupported as well.
2024-02-02 14:25:04 +01:00
Martin Pulec
edc39dbe90 set default audio ch count to 1 for RTSP/SDP
needed for SDP
2024-01-08 17:06:54 +01:00
Martin Pulec
6e637c37cb opt protocol: old protocol opts fixes
fixed legacy --video-protocol and --audio-protocol handling
2024-01-08 11:36:16 +01:00
Martin Pulec
40a7d04ec1 unit_evaluate[_dbl]: added endptr param 2023-11-29 15:27:32 +01:00
Martin Pulec
bfb7a1d232 removed no longer needed check_audio_codec 2023-11-29 14:58:16 +01:00
Martin Pulec
288b2c5804 refactor audio codec fmt parse
Should be almost functional equivalent as the previous version.
2023-11-29 14:58:14 +01:00
Martin Pulec
61cd13d3c6 add short opt -i for audio filter 2023-11-21 14:10:21 +01:00
Martin Pulec
fb0c6d5796 main usage: fixed short opts
- '-A' is now for audio codec; original is now --audio-host (without short opt)
- '-V' for verbose
2023-11-21 14:10:21 +01:00
Martin Pulec
6b12ca5231 write_all: take the fd as 1st arg
Make the function more universal by not writting implicitly to
STDERR_FILENO.
2023-11-13 16:48:22 +01:00
Martin Pulec
11fd6830be add opt --audio-channel-map shortcut -U 2023-11-06 13:28:18 +01:00
Martin Pulec
624b34f7bd screen win uninitialize elevated: do not coinit
For uninit, screen-capture-recorder-x86.dll calls CoInitialize(0) and
fails because it fails.

Curiously this doesn't occur for register, which should be equivalent.
2023-10-26 16:11:49 +02:00
Martin Pulec
06956f0544 print caught signal desc in verbose 2023-10-26 08:44:43 +02:00
Martin Piatka
a1ac44a2e2 holepunch: add bind_ip option 2023-10-06 14:00:48 +02:00
Martin Pulec
87e0c61416 renamed video_rxtx hdrs from .h to .hpp
clang-tidy doesn't like naming C++ headers with .h
2023-10-02 08:44:17 +02:00
Martin Pulec
afd0f217de signal_handler: ignore next SIGPIPE signals
We will end anyways and do not produce additional SIGPIPE on eventual output.
2023-09-19 13:34:11 +02:00
Martin Pulec
9e80a018fe main: handle also SIGPIPE
SIGPIPE signals may be delivered externally if user uses a named pipe
eg. as file capture input or file display output. We want to exit
gracefully in this case.
2023-09-01 13:50:57 +02:00