Commit Graph

426 Commits

Author SHA1 Message Date
Martin Pulec
ba9b71bb64 DeckLink: get rid of BMD_CONFIG_SET macro
using bmd_option instead
2023-05-04 14:39:21 +02:00
Martin Pulec
0989a3b859 compilation fixes
Doesn't prevent compilation currently because where the headers were
included, the required headers were included as well but was marked as
error by a standalone analyzator, like clangd.
2023-05-02 15:22:58 +02:00
Martin Pulec
04a0bf581b removed ATTRIBUTE macros
This was unnecessary compat macro, since we always build with a compiler
that understands __attribute__ except of the AJA module in MSW, which
uses MSVC compiler
2023-05-02 15:22:55 +02:00
Martin Pulec
64688bb4c7 hd-rum-transcode: share signal callbacks with UG
The crash and freeze signal handlers may be useful also for the
reflector.
2023-04-28 13:12:35 +02:00
Martin Pulec
14b51badb1 sdp.c: fixed undef fcns if no server 2023-04-28 10:15:11 +02:00
Martin Pulec
bafe32c876 fs.c: removed unused function (+ use C) 2023-04-28 10:15:11 +02:00
Martin Pulec
98ff26a5c9 SDP autorun: support for audio 2023-04-27 15:28:36 +02:00
Martin Pulec
4604257fcc SDP: accept options even when no video 2023-04-27 15:28:31 +02:00
Martin Pulec
5fa7054957 SDP: print name of unsuccessfully written file+err 2023-04-27 15:21:18 +02:00
Martin Pulec
dc9f3f910a RTSP/SDP: disable interlaced dct for H.264 stream 2023-04-27 15:21:18 +02:00
Martin Pulec
23437a8df0 sdp: if filename explicitly given, use it directly
Do not prepend /tmp/ (or generally a temporary dir prefix) to given name
resulting in /tmp/<name.sdp>. This is not an expected behavior and it
also doesn't play well with absolute paths.
2023-04-27 15:21:18 +02:00
Martin Pulec
d330520d59 SDP: refactor - use global state
Until now, `uv -s testcard --protocol sdp` didn't generate the SDP file
(nor output) because the all SDP state initialization was handled in
video_rxtx/h264_sdp.
2023-04-27 15:21:16 +02:00
Martin Pulec
48219758ea use Opus, not OPUS
For audio codecs, we respect its native capitalization of letters, eg.
AAC, speex. So do it also for Opus. This should not affect existing
applications since the Opus name is parsed case-insensitively.

Only exception is SDP (rtpmap) where is usually used lower-case (at
least in rfc7587).
2023-04-26 09:53:10 +02:00
Martin Pulec
170c50f7ab testcard: added interlaced pattern 2023-04-24 09:53:00 +02:00
Martin Pulec
e338ca2f55 video_pattern_generator: split config to pattern+opts first 2023-04-21 14:20:35 +02:00
Martin Pulec
6855aaadee get_sockaddr_str: fixed snprintf max len
fixes CID 406448
2023-04-20 13:19:58 +02:00
Martin Pulec
580ac72ec2 replaced all remaining sprintf witn snprintf
using bound checking variants

Remained last one instance in utils/text.c, that does the checking by
itself and vsnprintf compat using vsprintf, that is not used, anyways.
2023-04-13 14:04:29 +02:00
Martin Pulec
c3b19d25da removed needless check/store of vsnprintf ret 2023-04-12 12:52:08 +02:00
Martin Pulec
602095e38a fixed some further snprintf warns
fixes warnings with Xcode 14.3 as in previous commit

+ allocate +1 in Log_output buffer - snprintf(MULL, 0...) returns number
  of bytes without terminating '\0'. std::string storage isn't guaranteed
  to be NULL-terminated (std::string("").at(0) throws an exception). The
  buffer is somewhere preallocated 256 which prevents problem but it's
  better not to rely upon it.
+ comment out some unused function in LDGM that also triggered the
  warning but looked a bit suspicious so it was not clear how to fix
2023-04-12 12:52:07 +02:00
Martin Pulec
c009f9da76 Syphon: use Objective-C without C++ 2023-03-30 10:49:32 +02:00
Martin Pulec
2fd384b08b fixed 2 Win warnings
- utils/net: unused variable
- wasapi playback: unused function prototype
2023-03-29 12:09:39 +02:00
Martin Pulec
d2c5a1a9f6 net_udp.cpp: replace some C++ utils 2023-03-17 13:15:28 +01:00
Martin Pulec
d8a799f842 get_rtsp_server_port: simplify + use logger
- simplify the flow (exit early)
- allocate string copy on stack (strdupa)
- use logger for errors
- fixed usage

The usage syntax (`--video-progocol rtsp[=port:<num>]`) looks a bit
exotic, however (isn't entirely consistent with the rest of UG).
2023-03-16 16:03:27 +01:00
Martin Pulec
d2c00ff3f8 split utils/text to string.c and text.c 2023-03-14 13:21:12 +01:00
Martin Pulec
e5484c7a96 moved get_splashscreen to video_display
to resolve this failed build:

    https://github.com/CESNET/UltraGrid/actions/runs/4375068060/jobs/7655309176

(Added dependency of misc.o on video stuff, which broke build of
tools/convert, which has hard-coded dependencies.)

The function is video_display specific, anyways.
2023-03-09 15:35:48 +01:00
Martin Pulec
37876bbec8 caca: updates
- added splashscreen
- fixed RGB-shifts
- redraw last frawme if resized
2023-03-09 13:26:13 +01:00
Martin Pulec
cf00c419fa fixed bitmap_font.h gen comment
perhaps not a big deal but 'printf \xXX' is a non-standard shell extension
2023-03-02 09:41:48 +01:00
Martin Pulec
ed60bf3765 portaudio: grey out unuable devices in listing
Some of devices cannot be used in either input or output (or none)
direction. Those are usually hidden but are shown if in verbose mode.
If so, use different color to highlight that those cannot be used.
2023-03-01 15:44:32 +01:00
Martin Piatka
9df03d3b0d string_view_utils: Whitespace trimming helpers 2023-02-28 12:48:41 +01:00
Martin Pulec
4fc998ef59 get_win_error: notice about localized output 2023-02-28 10:05:21 +01:00
Martin Pulec
3dd5981ca2 replaced gai_strerror calls with own wrapper
added ug_gai_strerror

Default to gai_strerror, but use WSAGetLastError() in Windows. This
solves a problem with localized error messages but with a wrong
non-ASCII characters. Instead of gai_strerror, WSAGetLastError is
preferred according the Microsoft MSDN docs (thread safety). Also using
get_win_error() to ensure non-localized output (preferred).
2023-02-28 10:04:45 +01:00
Martin Pulec
e7f011f2ef prefix some calls of gai_strerror msgs
Since it is called on multiple places, be clear where the problem
happens.
2023-02-28 10:03:53 +01:00
Martin Pulec
d025484ae3 get_win_error: drop trailing <CR><LF>
Some occurences of this call (net_udp.cpp, dlfunc.c) don't expect the
string to be terminated so it is perhaps better to drop it at the
source.
2023-02-27 12:36:56 +01:00
Martin Pulec
84ba9bbce5 utils/windows.cpp -> .c 2023-02-27 11:22:27 +01:00
Martin Pulec
c06de1c49a win: replace FormatMessage with the UG function
+ handle a situaltion when FormatMssage fails on unknown error (dshow
  has been handling that)
2023-02-27 10:37:03 +01:00
Martin Pulec
1076097bfd com_[un]initialize: one definition
Merged win and non-win dummy compat versions of the com_[un]initialize
fuctions. Otherwise it is a bit confusing.
2023-02-27 10:09:28 +01:00
Martin Pulec
fdf3361ff4 win: fixed locale-aware string conversion 2023-02-27 09:57:30 +01:00
Martin Pulec
06417f79ef get_win_error: do not generate localized error msgs
This is perhaps not preferred - our users should be most likely able to
understand English. Moreover, localized message content may not be clear
if given eg. in a bug report.
2023-02-27 09:56:16 +01:00
Martin Pulec
a4d88298f7 win: common err to string func 2023-02-27 09:49:20 +01:00
Martin Pulec
4fe552f225 use common com_[un]initialize 2023-02-24 16:06:42 +01:00
Martin Pulec
8df499ffac merged utils/hresult to utils/windows
These 2 files are relatively small and coherent.

+ fixed hresult_to_str not returning anything on RPC_E_CHANGED_MODE
2023-02-24 15:00:00 +01:00
Martin Pulec
39af5e01df moved CoInitialize stuff outside bmd_common
this code may be useful in general
2023-02-24 14:48:07 +01:00
Martin Pulec
faafa640a2 hresult: added RPC_E_CHANGED_MODE
CoInintialize[Ex] initialized with different mode (can occur eg. for
DeckLink because it uses COINIT_MULTITHREADED but Portaudio uses
COINIT_APARTMENTTHREADED).
2023-02-24 12:02:32 +01:00
Martin Pulec
73176ea568 bmd_hresult_to_string: common COM errors handling
Factor out common errors to hresult.h header. If not running on Windows,
use that subset. Vice versa use hresult_to_str directly because it can
catch more Windows-specific errors.
2023-02-24 12:02:31 +01:00
Martin Pulec
4cef5b81df hresult: adeed RPC_E_CHANGED_MODE 2023-02-24 12:02:29 +01:00
Martin Pulec
27dc4c6a92 macOS warning fixes 2023-02-21 09:52:58 +01:00
Martin Pulec
dd60dd2540 screen_pw: replaced moodycamel with synchronized_queue
There doesn't seem to be any significant advantage of using the
readerwriterqueue so replace it with a generic UG one.

If needed, this change can be easily reverted (the API is similar).
2023-02-21 08:55:48 +01:00
Martin Pulec
86ae693117 text textcard pattern: updates
- accept bg/fg options without need to alter (default) text
- print error on wrong option
- use #CC00CC (pink) - although looking less decent, the subsampling
  artifacts should be more observalble with this color
2023-02-10 11:52:40 +01:00
Martin Pulec
c592d8cbbb Y4M: fixes
- writer: length should no longer be multiplied by 2 (y4m_get_data_len()
  does this already)
- C&P error - 16-bit YCbCr written is 4:4:4, not 4:2:2
2023-02-09 09:52:09 +01:00
Martin Pulec
cac1d11190 updated copyrights of files changed in 2023 2023-02-09 09:19:50 +01:00