Commit Graph

8899 Commits

Author SHA1 Message Date
Martin Pulec
fdd4fc1283 CI macos: limit number of threads for GLFW make
Using `cmake --build . --parallel` actually doesn't limit the number
of processes because it just passes the number (here none) to make,
resulting in `make -j`.

This is a possible explanations of macOS runner freezes, as eg. here:
<https://github.com/MartinPulec/UltraGrid/actions/runs/7641831068>
(last relevant message in log is `[100%] Built target joysticks`).
2024-01-25 17:07:41 +01:00
Martin Pulec
c074bdfd41 vcap/dshow: GetSubtypeName - handle non-printable characters
added resolve_fourcc to utils/string

   - fixed wrong signal.h include guard (it should be definitely included
   in mac, it was perhaps meant to be MSW, but it is needed there too)
   - removed config*h
2024-01-25 17:07:41 +01:00
Martin Pulec
f2046a2556 vcap/dshow: use GetSubtypeName
It seems like the first DWORD of subtype GUID
(mediaType->subtype.Data1[0-3]) doesn't always contain FourCC, namely for RGB types, eg.
MEDIASUBTYPE_RG24 (the others seem to be be mostly OK).
2024-01-25 17:07:41 +01:00
Martin Pulec
010dae03ad vcap/dshow: print streaming/grab type
Instead of getting full format from vidcap_dshow_get_video_desc(), which
translates the source pixel format to UG one, use the FourCC directly. Do
write just the format, the same for grabber and then the complete output
format (after eventual UG conversion). Except of the format, every other
parameters should be currently the same.

The previous approuach didn't work when there was either no VFW->UG
mapping (I420 etc.) or there  was not 1:1 mapping, eg. NV12 was displayed
as UYVY because the conversion is such, which might be misleading.
2024-01-25 17:07:40 +01:00
Martin Pulec
055c165ac0 moved i420_to_uyvy conv from dshow to video_codec
the conversion is quite generic, so provide it externally

\+ instantly use it in testcard
2024-01-25 17:07:40 +01:00
Martin Pulec
f4dedb0ffc video_codec: planar<->packed YUV use unsigned char
This requires less conversions from/to (char *).

\+ vcap/testcard: handle unsuppoted subsampling
2024-01-25 17:07:40 +01:00
Martin Pulec
44c03391ed vcap/dshow: conversion I420->UYVY 2024-01-25 17:07:40 +01:00
Martin Pulec
ba610aab1f vcap/dshow: conv also for ABGR 2024-01-25 17:07:40 +01:00
Martin Pulec
6e49c3d900 vcap/dshow: use convert callback to flip BGR lines 2024-01-25 17:07:39 +01:00
Martin Pulec
2f56acbf7a vcap/dshow: optimized including 2024-01-25 17:07:39 +01:00
Martin Pulec
783fb8a5f9 vcap/dshow: print whole grabber out command + conv
Print the grabber format + set the conversion according to that format,
not the streaming format.
2024-01-25 17:07:39 +01:00
Martin Pulec
0978ea0a38 vcap/dshow: accept any codec for pos. arg
we can accept all codecs, not only BGR or YUYV/YUY2

Note that the codec is used as both streaming and grabber codecs,
the converting logic doesn't seem to have been working in the past,
although Pavel Troubil's original code had RGB fixed as the codec.

Commented out the block setting the mediaformat - now the matching format
is already set, unsure about semantic of this block.
2024-01-25 17:07:39 +01:00
Martin Pulec
b035988a64 vcap/dshow: print also captured codec 2024-01-25 17:07:39 +01:00
Martin Pulec
9faaf0ebbb vcap/dshow: respect RGB-enforcement for key=val
Respect RGB for key/value syntax as indicated in help.

This can be particularly useful when capturing eg. MJPEG, which we want
to recompress or process later.
2024-01-25 17:07:38 +01:00
Martin Pulec
e95ce6c7ab vcap/dshow: capture RGB if specified together with mode= 2024-01-25 17:07:38 +01:00
Martin Pulec
b8d52a929a vcap/dshow: set selected media type to sample grab
not ideal but at least it works (if BGR or YUYV is given)
2024-01-25 17:07:38 +01:00
Martin Pulec
c5d99199e3 dshow: print streaming format 2024-01-25 17:07:38 +01:00
Martin Pulec
8905c08278 vcap/dshow: capture BGR for unmapped codecs 2024-01-25 17:07:38 +01:00
Martin Pulec
c1c099c64a CI ARM Linux: disable INTER_LINEAR_EXACT
OpenCV in Buster (Linux armhf build) doesn't have
INTER_LINEAR_EXACT. Similarly to INTER_NEAREST_EXACT, this doesn't seem
to be necessary so enable it for now (althoug compat macros should be
possible as well).
2024-01-23 09:52:07 +01:00
Martin Pulec
560bf40488 dshow: fixed nv12->uyvy chroma convert
refers to GH-369

chroma from first row was used for every column

\+ use ptrdiff_t vars to fix a warning for narrow type multiplication
2024-01-22 16:53:33 +01:00
Martin Pulec
49ddf94410 vcap/v4l2: fixed conversion of fmt unknown to UG
The V4L2 FourCC was an invalid codec_t element and lead to crash in
get_codec_name() on that value few lines below.
2024-01-22 16:52:36 +01:00
Martin Pulec
483d21d7c1 vcap/v4l2: fail on malformed size opt
When `size=1` or `size=b` was entered, the option was silently ignored.
2024-01-22 16:52:36 +01:00
Martin Pulec
21db4b7552 v4l2: moved parsing to separate fn 2024-01-22 16:52:36 +01:00
Martin Pulec
94dff54853 V4L2: print used device path
Removed by mistake with a4d37a221b (2022-06-27) when unified 2 simillar
messages.

Use more terse message.
2024-01-22 16:52:36 +01:00
Martin Pulec
f07dc52e77 v4l2: optimize includes
do not rely on config_unix.h
2024-01-22 16:52:35 +01:00
Martin Pulec
679acd007c video_codec: added pair of assertions
As resolved in previous commit, due to the error there may be incorrect
pixel format queried, which may lead to segfault.
2024-01-22 16:52:35 +01:00
Martin Piatka
8c1b1d3a37 control_socket: Make reported audio ch count configurable
And raise the default to 16. Refers to GH-366
2024-01-22 14:56:19 +01:00
Martin Pulec
9622095d4c display_gl_get_property: fixed codec array size
The source array size was returned, but the codec list is filtered so
the actual number may be lower.
2024-01-22 12:53:14 +01:00
Martin Pulec
45f51f8bb0 display_gl_get_property: assert correct size
Enough space is rather assumed because in the oppiste case, hard-to-detect
behavior may occur, especially while the problem is not reported.
2024-01-22 12:53:14 +01:00
Martin Pulec
a39408d231 display_gl_get_property: reformat
- reindent
- DISPLAY_PROPERTY_CODECS - early return if low size
- return in the individual switch cases immediately than later
2024-01-22 12:53:14 +01:00
Martin Pulec
0074f52b8e dshow: capture NV12
refers to GH-369
2024-01-19 16:49:59 +01:00
Martin Pulec
0c0a4036c0 dshow: print mode pName instead of ug name
NV12 will be mapped to UYVY, so instead of NV12, there will be
misleadingly written UYVY.

Actually, the FourCC stored in &pSubtype->Data could be used, because
it mostly match. Chosen approach is, however, more conservative if the
name doesn't match, because the "old-style" init with the codec name
requires the mapping back from name to subtype and there doesn't seem
to be a way to find a subtype from FourCC in genral.
2024-01-19 16:49:59 +01:00
Martin Pulec
604bbf94c5 dshow: generic error handling in init
Handle eventual error generically, currently only in init.

Print also error description (will be perhaps just a code for DShow
for now).
2024-01-19 16:49:58 +01:00
Martin Pulec
1fa19a6844 dshow: print error info 2024-01-19 16:49:58 +01:00
Martin Pulec
ee687e6ad6 dshow: do not attempt to capture on unsupp fmt
\+ ignore explicitly specified pixfmt if mode given expliclty (but issue
a warning)
2024-01-19 16:49:58 +01:00
Martin Pulec
66b17a42d6 dshow: compact BitCountMap + add VC_NONE
VIDEO_CODEC_NONE seems to be needlessly long, especially when used
mutiple times like in the struct BitCountMap being compacted.
2024-01-18 17:02:20 +01:00
Martin Pulec
f3fb8afdc0 tx_send_base (video): simplified sending (mult)
see also similar change for audio in commit 6c07a3e43 (2023-07-27)

The previous solution was using some cumbersome solution, perhaps
repeating the sequence (with mult:3) like `111222333444`.

Rewritten to be easier; also nwo the multiplication is as follows:
`123412341234`, which is perhaps better than the previous variant.
2024-01-17 16:50:05 +01:00
Martin Pulec
cf6f7cbe9d transmit vid.: comp last pkt sz in get_packet_sizes
Correctly set last packet size from get_packet_sizes() so that it doesn't
need to be adjusted later.
2024-01-17 16:50:05 +01:00
Martin Pulec
e22c97bd54 transmit: packet count - multiply always
simplification
2024-01-17 16:50:02 +01:00
Martin Piatka
c8d16f26e2 pano_gl: Recycle frames when returning to free queue 2024-01-17 16:25:55 +01:00
Martin Piatka
05864585a3 vdpau: Fix not uninitializing properly 2024-01-17 16:25:54 +01:00
Martin Pulec
0db80ba471 JPEG read_dqt: improvements
- allow reading up to 4 quantization tables (extended mode)
- check errors (unsupported/wrong precision)
2024-01-16 14:45:50 +01:00
Martin Pulec
bbbf0bc7db JPEG reader: handle quant tables more generically
- do not assume in reader indices 0 for Y a 1 for Cb/Cr
- check the RTP egligibility later
- handle lavc-compressed JPEG (using only table 0) properly, not as a
hack until today
2024-01-16 14:45:50 +01:00
Martin Pulec
5c35bddd4d jpeg reader: RTP compatibility check to sep fn 2024-01-16 14:45:49 +01:00
Martin Pulec
26ea9b5cff h264_rtp: print error if receiving video not H.264 2024-01-16 12:22:55 +01:00
Martin Pulec
e74f100d5d fixed CID 434949 2024-01-16 09:01:26 +01:00
Martin Pulec
c3bb31928e vrxtx/rtsp subsessions: do not send msgs on exit
When destroying the state, ServerMediaSubsession::deleteStream callbacks
are called but we are already deconfiguring so do not send messages to
change destination (eg. audio is already destroyed so the message wont
be delivered causing warnings like:
```
Receiver audio.sender does not exist.
Receiver audio.sender does not exist.
Warning: Message queue not empty!
```

Currently this is just a dirty fix, rtsp_serv::watch would be better to
pass.
2024-01-15 16:35:30 +01:00
Martin Pulec
5017c34265 vrxtx/h264_rtp.cpp: removed conditionally rtsp compile
the file is compiled only if used, so no need for ifdef
2024-01-15 16:00:08 +01:00
Martin Pulec
f08c736ff3 audio: log receiver/port change 2024-01-15 16:00:08 +01:00
Martin Pulec
e5ef4d512e audio_*_process_message: reindent
just a reindention and small warning fixes (like NULL->nullptr), no
functional change
2024-01-15 16:00:08 +01:00