Commit Graph

8024 Commits

Author SHA1 Message Date
Martin Pulec
ba07b9d3e7 SDL2: deprecate pos,fixed_size
Similarly to GL, prefer "size" parameter with optional position syntax.

+ allow also negative position coordinates
2023-06-22 16:12:36 +02:00
Martin Pulec
7bb4a7e13b SDL2: deindent help 2023-06-22 15:40:47 +02:00
Martin Pulec
59e548d576 GL: deprecate fixed_size
The name is needlessly verbose - it is quite clean, that size of the
window will be fixed (on the other hand, it is still resizable), it just
leaks a semantics that the GL window is by default adjusted to video
size.

We can use simply "size=" parameter. Also deprecated "fixed_size"
without parameters - it doesn't have direct counterpart but it
basically works as "size=512x512" because it fixes to first "video",
which is currently the splashscreen (at the time of writing it used to
be really the first incoming video but is seems there is a little use
case for that - CoUnsil used that at a time).

+ optinally a window position can be specified
2023-06-22 15:40:46 +02:00
Martin Pulec
e8625fb2de GL: help fixes
Do not list all options on example usage - there are quite many options
and it became unreadable and those are repeated below.

+ missing '=' after --param glfw-window-hint=..
+ small updates in few items
2023-06-22 14:57:34 +02:00
Martin Pulec
5555315b5c added override_prop cap. f.
This allows overriding some video props (only in metadata), eg.
25p->50i. Currently only FPS + interlacing change is supported.
2023-06-21 16:37:49 +02:00
Martin Pulec
572209187e audio/codec: turned fprintfs into log_msg
+ print number of empty channels
2023-06-21 16:37:42 +02:00
Martin Pulec
1c8383782a vidcap file: dropped audio msg info lvl
Dropping audio actually shouldn't occur during normal operation so it
should be better to print it also in "normal" log level (not using
warning, because it still can occur eg. during a seek; but in this case
user would perhaps silently ignore that).
2023-06-21 14:30:14 +02:00
Martin Pulec
83216958be vidcap file: respect user-specified audio ch count
closes GH-323
2023-06-21 12:29:59 +02:00
Martin Pulec
ca8d0bc1cf updated coding style
+ added .clang-format to .gitignore

The style respects mostly rtp/rtp.{c,h} coding style (original
UltraGrid).

Rather than specifying own style, deduce one from clang-format default
format (just keeping the indention 8 spaces). The style is quite
restrictive because indention of 8 spaces + line with 80 restricts
nesting quite a bit.

Anyways, the style is rather a recommendation and is not enforced in any
way - .clang-format is just added to .gitignore and the developer can
tweak it a bit (like extending ColumnLimit).
2023-06-21 10:56:49 +02:00
Martin Pulec
1624d0e624 Deck disp.: audio oveflow details only if verbose
Print overflow details (nr of samples written/dropped/buffered) only in
verbose mode. The point is that those values will differ and if there is
a moment where overflow occurs, it is better to colligate the overflow
messages into one and only to see the details in verbose mode, otherwise
the output could be flooded with the messages.
2023-06-20 16:39:25 +02:00
Martin Pulec
84f63b22e5 vc_copylineV210toRGB: fixed unused params 2023-06-20 13:40:03 +02:00
Martin Pulec
f6f2ca75bd vidcap file: pause immediately
Do not wait for the queue to flush but pause immediately even if there
are more frames to send to avoid delays.

+ added the `ended` variable in the meaning of original paused (it needs
  to be a separate variable and it is also more clear)
2023-06-20 13:37:49 +02:00
Martin Pulec
9e63b28d5f vidcap file: prevent seeking ahead of start 2023-06-20 13:37:49 +02:00
Martin Pulec
9a9e58f3c4 vidcap file: correctly handle aligned seeks
When seek 2x at a time, reflect the change immediatelly (previously,
seek when paused worked, but only one/the last, not summed).
2023-06-20 13:37:49 +02:00
Martin Pulec
6583fe5094 vidcap file worker: do house-keeping first
do the house-keeping first and remove unused CV

The queue is already written over the max when there are video frames
waiting for audio (and there may be even something like 150, like in
ED[1]) so it doesn't matter if we write one more frame or not.

This simplifies the stuff a bit.

+ it allows to check the messages always (not only before frames) -
  again this is useful when ED flushes some 150 frames, because before
  this change, it was processed just after all those frames were sent
+ print 'paused' notice when the stream stops (without loop) - the
  stream can be rewinded back, but it is in paused state, so unpause
  must be issued at the same time

[1] The Elephants Dream
2023-06-20 13:37:49 +02:00
Martin Pulec
425644b110 vidcap file: delay video until we have audio
ED[1] writes audio frames more or less on par with the video frames but
the GOP in this file is not reordered (as it sometimes is) but in the
presentation order, so it is needed to wait almost the whole GOP until
audio frames can be correctly attached to video.

[1] The Elephants Dream
2023-06-20 13:37:49 +02:00
Martin Pulec
edfeeebbc5 vidcap file: fix a potential crash
s->audio_data used after free (not always crashes, as usual)
2023-06-20 13:37:49 +02:00
Martin Pulec
10ea0b0f7d vidcap file: increase queue len
This will help with harder files (eg. the ED)

+ signal also to frame_consumed, because also this cv may be waited and
  should be continued with the seek (actually this is even necessary
  because this thread then processes the message)
2023-06-20 13:37:49 +02:00
Martin Pulec
8ff365e56c vidcap file: moved audio pkt process to fnc 2023-06-20 13:37:49 +02:00
Martin Pulec
976706827b vidcap file: increase audio ring buf size to 60 sec
It needs to be more than GOP size if audio is +/- aligned with video,
eg. The Elephants Dream has GOP 150 frames (= 6.25 sec at 24 FPS)
meaning that the audio must wait up to more than 7 seconds (in the file,
audio packets are up to 1 sec delayed to the respective video packets).
2023-06-20 13:37:49 +02:00
Martin Pulec
345657cdd0 vidcap file: fixed audio oveflows when seeking
When seeking, decoding will start after receiving next I-frame. But
there will remain audio frames from undecoded video frames in the
buffere, which had been flushed at once causing potentially the cache
overflow.
2023-06-20 13:37:49 +02:00
Martin Pulec
bb3ff5e165 vidcap file: improved A/V synchronization
fixes GH-322
2023-06-20 13:37:49 +02:00
Martin Pulec
7cf8b42235 playback: improved help
- added description
- added shortopt
2023-06-20 13:37:48 +02:00
Martin Pulec
a5f3953168 shortopt for --audio-codec 'u'->'A'
'A' seems to be better but it was originally used by --audio-host. This
argument isn't supposed to be important and isn't perhaps used, anyways,
so use this and for the --audio-host keep only the long opt.
2023-06-20 13:37:48 +02:00
Martin Pulec
ca9948449b shortopts for --record/--playback
It is '-E' and '-I' (Export and Import; R/P not viable because 'P' is
already taken for port so the shortcuts won't be consistent then).
2023-06-20 13:37:46 +02:00
Martin Piatka
011f3550f2 pixfmt_conv: Add R10k to RGB conversion
Currently needed for preview
2023-06-20 12:34:29 +02:00
Martin Piatka
90fd925998 pixfmt_conv: Add v210 to RGB conversion
Currently needed for preview
2023-06-20 12:34:29 +02:00
Martin Piatka
2395f379b8 ipc_frame_ug: Respect horizontal alignment when scaling 2023-06-20 12:17:53 +02:00
Martin Pulec
046c6ce767 set_audio_delay: log changed value
refers GH-219
2023-06-20 09:41:45 +02:00
Martin Pulec
3dc4306b39 vidcap file: fixed seek overflow
fixed potential overflow if tb.den is huge (500000 in Elephants Dream)
2023-06-19 11:40:27 +02:00
Martin Piatka
56a0708343 tools/thumbnailgen: Configurable fps 2023-06-16 13:43:03 +02:00
Martin Piatka
ce2a3eca46 tools/thumbnailgen: Don't busywait for connection 2023-06-16 13:43:02 +02:00
Martin Piatka
2651e5caf5 tools/ipc_frame_unix: Add blocking wait for connect 2023-06-16 13:43:02 +02:00
Martin Piatka
f4360d107d tools/thumbnailgen: Don't reinitialize jpeg ctx on each frame 2023-06-16 13:43:02 +02:00
Martin Piatka
a01475050c tools: Add preview thumbnail generator 2023-06-16 13:43:01 +02:00
Martin Pulec
efa621163b vidcap file: flush decoder context on seek
Also check if ring_buffer is available before flushing it, it crashes
without audio.
2023-06-16 12:22:44 +02:00
Martin Pulec
c6350eb030 vidcap file: use frame size from AVFrame
AVCodecContext doesn't need to have the actual sample count always set
(as does not AC3 in Elephants Dream render).
2023-06-16 09:19:29 +02:00
Martin Pulec
16d11f013d AppRun Filejail: whitelist -t file:<name> 2023-06-15 16:43:46 +02:00
Martin Pulec
e1b28f83d6 keyboard_control: option to force in gdb
doesn't seem to be necessary at least since gdb 9.2 in Ubuntu 20.04
2023-06-15 16:14:08 +02:00
Martin Pulec
3a0a1d450f vidcap file: use ring buffer for data
Use ring-buffer instead of raw data, where the remaining data must have
been memmoved.
2023-06-15 14:05:34 +02:00
Martin Pulec
e4d4510068 vidcap file: print also PTS (+fix unit)
Print also decompressed video pts - this is useful to match the delay
with corresponding received video packet.

+ fixed duration unit (not nanoseconds but seconds)
2023-06-15 11:29:58 +02:00
Martin Pulec
3ab44b2074 vidcap file: print pkt timebase+dur (debug only)
This allows to evaluate exact pts/dts values, not only the value
converted to (double) seconds.

+ moved all the stuff to a separate function
2023-06-15 11:29:58 +02:00
Martin Pulec
19abf7a9ab vidcap_file_worker: refactored
Mostly idempotent, only functional differences is that packet is
unreferenced at the beginning of while-loop (unreferencing not
referenced packet snoldn't hurt).

+ fixed wrong time unit for decompressing duration
2023-06-15 11:29:58 +02:00
Martin Pulec
4db0975c60 vidcap_file_worker: needless reallocation removed 2023-06-15 11:29:58 +02:00
Martin Pulec
ef751e16ff print_decoder_error: no extra space after mod_name
mod_name usually already contains trailing space (eg. "[lavd] ") so do
not produce an extra one.

+ reindent
2023-06-15 11:29:58 +02:00
Martin Pulec
cd42c7a6c2 vidcap file: simplify vid dec err handling
+ specify if failed when sending packed or receiving frame
2023-06-15 11:29:58 +02:00
Martin Pulec
da178fe3de vidcap file: seek - flush buffers
At the beginning, there may be several audio frames decoded prior to
first video frame successfully decoded, which is unnecessary after the
seek.

see also GH-322
2023-06-15 11:29:53 +02:00
Martin Pulec
2e52cd4528 vidcap file: print video frame type
used in GH-322 comment
2023-06-14 13:51:00 +02:00
Martin Pulec
c4dcc5051b vidcap file: s/clampi/CLAMP/
Replaced clampi with CLAMP - since the clampi is the only use of the
function, it can be removed.
2023-06-14 12:04:04 +02:00
Martin Pulec
2a9acfce33 vidcap file: dump FF format in verbose 2023-06-14 11:04:44 +02:00