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
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
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).
+ 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).
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.
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)
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
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
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)
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).
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.
'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.
Print also decompressed video pts - this is useful to match the delay
with corresponding received video packet.
+ fixed duration unit (not nanoseconds but seconds)
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
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