Commit Graph

96345 Commits

Author SHA1 Message Date
Steve Lhomme 79b837b2b3 meson: remove forced _THREAD_SAFE optional define
It's not set in the meson files and it's not done in autotools builds.
2023-03-15 09:50:57 +00:00
Steve Lhomme 88ec5e93bf meson: remove forced _REENTRANT optional define
It's not set in the meson files and it's not done in autotools builds.
2023-03-15 09:50:57 +00:00
Steve Lhomme 3c67f745ca meson: remove unused HAVE_X11_XLIB_H
It doesn't exist in autotools.
2023-03-15 09:50:57 +00:00
Steve Lhomme c11e6bb15c meson: remove unused HAVE_QSORT_R
It doesn't exist in autotools.
2023-03-15 09:50:57 +00:00
Steve Lhomme 39ff35852c meson: remove unused HAVE_INET_NTOP
It doesn't exist in autotools.
2023-03-15 09:50:57 +00:00
Steve Lhomme 7ccaed3cb0 meson: remove unused CAN_COMPILE_SSE4xxx
They don't exist in autotools
2023-03-15 09:50:57 +00:00
Steve Lhomme 442338a3f5 meson: use comments from autotools in config.h.meson
For better or worse. It helps comparing the files.
2023-03-15 09:50:57 +00:00
Steve Lhomme ca7270f019 meson: reorder config.h.meson to match autoconf config.h order
This makes it easier to compare them, to find what is missing, what is extra.

No functional changes.
2023-03-15 09:50:57 +00:00
Steve Lhomme 1ccffc330f control: remove unimotion motion handling
This code is very old and seems to require the installation of another module.
There's no trace online of this extra code.
2023-03-15 09:00:38 +00:00
Steve Lhomme 586e1cbafe libvlc: use the local includes in vlc.h
Do not allow messing with the include path and end up using other
includes.

Any C compiler should respect the "" meaning including local files
before looking in other pathes.
2023-03-14 09:53:54 +00:00
Alexandre Janniaux 07d8bc705d input: es_out: reset buffering on PCR discontinuity
When PCR discontinuities happens, the whole pipeline is reset and it
safely (though after a glitch) reset back to playback on what's visible
after the PCR discontinuities, and restart buffering.

However, this PCR discontinuity currently happens only when **not** in
buffering. When it happens during buffering, then:

 - either the PCR value is much bigger than expected, and buffering will
   stop sooner than expected.

    | Buffer start      Buffer end    New PCR
    | v                          v    v
    | |------.-------------------|    |
    |        ^
    | Old PCR  |----------------------|
    |             Missing buffering
    +-- Resulting buffer after PCR jump to the future.

 - or the PCR value is much smaller than expected, and the buffering is
   completely borked, the computed stream buffer duration is negative
   and it would buffer for the time of the

    | New PCR         Buffer start     Buffer  end
    | v               v                          v
    | |---------------|------.-------------------|
    |                        ^
    |                 Old PCR
    |
    |              Total buffering:
    |
    |  Buffering after the PCR jump
    | |------------------------------------------|
    |                    +
    |                 |------|
    |                 Previous additional buffering
    |
    +-- Resulting buffer after PCR jump to the past.

The second behaviour can be visible when disabling the __MAX for the
caching progress value, leading to logs like:

    [000055df326370e0] main input debug: Buffering 0%
    [000055df326370e0] main input debug: Buffering 1%
    [000055df326370e0] main input debug: Buffering 2%
    [000055df326370e0] main input debug: Buffering 3%
    [000055df326370e0] main input debug: Buffering 4%
    [000055df326370e0] main input debug: Buffering 5%
    [000055df326370e0] main input debug: Buffering 6%
    [000055df326370e0] main input debug: Buffering 7%
    [000055df326370e0] main input debug: Buffering -99%
    [000055df326370e0] main input debug: Buffering -98%
    ...

Such scenario can be created by streaming a .ts file with the option
--ts-trust-pcr on udp://127.0.0.1:1234 for instance, while running
ffmpeg with:

    ffmpeg -re -i input_file.ts -f mpegts udp://127.0.0.1:1234

During buffering, interrupt and restart the ffmpeg streaming command.
The value in --network-caching can also be increase to ensure easier
reproduction of the scenario.

Instead, if PCR is going back to the past, flush the pipeline and reset
the buffering back to zero to avoid waiting for the stream to catch-up
with the old reference, and avoid buffering more than what we requested,
which would shift the playback more from the live.

    | - Step 1:
    | New PCR         Buffer start     Buffer  end
    | v               v                          v
    | |---------------|------.-------------------|
    |                        ^
    |                 Old PCR
    |
    | - Step 2:
    |                 Previous buffering is dropped.
    |                 |------|
    | |--------------------------|
    | ^                          ^
    | New PCR                    New buffer end
    |
    |
    +-- New buffering behaviour when PCR jumps to the past.
2023-03-14 09:24:17 +00:00
Steve Lhomme 3ccf6ae23c decklink: fix fourcc string to enum conversion
Before 9168091a46 htonl() was used to convert
the values to/from enum to the string. But that commit broke the conversion on
little endian machines.

Now we don't use an intermediate string anymore. We just use GetDWBE() to do
the endianness conversion of the char buffer if needed.
2023-03-14 08:12:04 +00:00
Jean-Baptiste Kempf 437d802fc5 Win32: add tak to the installer 2023-03-12 13:00:08 +00:00
Steve Lhomme 0f92f19cfc avcodec/dxva: use DXVA_NoEncrypt
It is always defined when we use the dxva.h GUIDs.
2023-03-12 10:01:41 +00:00
Steve Lhomme 5319cf9fd1 directx_va: define missing DXVA_xxx GUIDs for the platform SDK and mingw
Favor the DXVA_xxx variants which are the most common ones. Redirect
missing DXVA_xxx variants to existing alternatives in mingw-w64.

Some GUIDs do not exist in any SDK so we need to define them ourselves.
The we share the redirections with dxva_blocklist.
2023-03-12 10:01:41 +00:00
Thomas Guillem 4c3538533e aaudio: restart stream when flushing
Since flush is not working.

There are 2 main issues:

 - AAudioStream_getTimestamp() could fail from Flush(), resulting in the
   impossibility to report a correct timing. As the doc says:
   "TODO review Frame counters are not reset by a flush", and we need a point
   of comparison after a flush.

 - Some devices (seen on The Galaxy S22 Ultra API Level 31) can't report
   a timestamp once the stream is flushed, resulting in the
   impossibility to report a correct timing.

Now, the whole Flush() function take between 10ms and 25ms (depending on the
device).

Fixes #27917
2023-03-12 09:26:44 +00:00
Thomas Guillem c9563144f9 aaudio: assert that "as" is valid after checking the state
sys->as will be set to NULL in case of flush error in the next commit.
2023-03-12 09:26:44 +00:00
Thomas Guillem 3fa5113b0b aaudio: handle device_id
In order to use the same decide_id when we restart the AAudio stream.
2023-03-12 09:26:44 +00:00
Thomas Guillem 3aee1739a5 aaudio: split OpenAAudioStream()
In order to be able to call it again, when flushing (cf. next commits).
2023-03-12 09:26:44 +00:00
Thomas Guillem 9f6da290bb aaudio: close even in case of failure 2023-03-12 09:26:44 +00:00
Thomas Guillem bb8f21636d aaudio: create CloseAAudioStream() function 2023-03-12 09:26:44 +00:00
Thomas Guillem b41e227623 aaudio: move function up
To avoid forward declaration in a next commit.

No functional changes.
2023-03-12 09:26:44 +00:00
Thomas Guillem a149122dab aaudio: report latency only in the STARTED state
And not in the STARTING state.
2023-03-12 09:26:44 +00:00
Thomas Guillem 65c3634eb0 aaudio: use LogAAudioError
To convert the result to a string.
2023-03-12 09:26:44 +00:00
Thomas Guillem 371e18c170 android_device: add missing initialisation
Fixes a crash when setting volume/device if no stream were started.
2023-03-12 09:11:38 +00:00
Loïc f77921f427 stream: introduce typed operations for stream
This commit introduce a typed virtual table for operations on stream,
aiming at replacing the legacy pf_control() callback which is using
va_list. As a counterpart to the typed virtual table, typed methods
are also introduce.

The operations can be implemented by the modules directly right now
and will be used when possible. This is done to provide type safety
at every level.

When no operation is provided (ie, stream_t.ops is NULL) by a module
implementation, the legacy pf_control will be used instead as a
fallback.

The commit doesn't migrate any of access/stream_filter/… modules yet.
The commit also doesn't introduce the demux specific callbacks yet.
2023-03-11 18:01:48 +00:00
Thomas Guillem 63488e047d decoder: update the state directly when creating an output
Threading changed, it is now possible.

This fixes the video or audio output that can render the first frames in
the initial state, leading to audio/video glitches (if a delay is
applied after).

For example, audio with clock-master=input:

[00007fc4a4311760] main decoder: vlc_input_decoder_ChangeDelay():
000055ad16120e60] main audio output error: Play in 133193
[000055ad16120e60] main audio output error: Play in 156331
[000055ad16120e60] main audio output error: Play in 179508
[000055ad16120e60] main audio output error: Play in 202699
[000055ad16120e60] main audio output error: Play in 225891
[00007fc4a4311760] main decoder: changing delay(2): -2000000
[000055ad16120e60] main audio output error: Play in -1750921

Refs #27918
2023-03-11 16:51:11 +00:00
Thomas Guillem a89b5d6b61 decoder: rename request_rate to rate
Use the same naming that paused and delay.
2023-03-11 16:51:11 +00:00
Thomas Guillem 74adb26cd2 decoder: rename some functions
These functions can be called from any threads, if the lock is held.
2023-03-11 16:51:11 +00:00
Thomas Guillem 378db759e5 decoder: move code up
To avoid forward declarations in next commits.
2023-03-11 16:51:11 +00:00
Steve Lhomme 656e5eb27a media_track: fix tracklist leak when no track found
When count is 0 the list is still allocated. Either we should not allocate
one, we free it locally, or we pass it on as it.
The latter is similar to the code from 40c14fbee4
in libvlc_media_tracklist_from_es_array().

Introduced in 057f3ef9e8.
2023-03-11 16:32:00 +00:00
Steve Lhomme 4bc4577b99 avcodec: don't use the console "quiet" parameter
Just use --verbose=-1 which is strictly equivalent.

This module should not depend on another module's option. And we don't
really need that option anyway.
2023-03-11 11:37:41 +00:00
Fatih Uzunoglu d9e5c65d33 qt: classify qml errors for logging 2023-03-11 11:11:35 +00:00
Alaric Senat f162293740 contrib: meson: always use meson `setup`
"meson builddir" has been deprecated since 0.64.0.

Please see 3c7ab542c0c4770241eae149b0d4cd8de329aee0 [1] upstream for the
complete explanation.

[1] 3c7ab542c0
2023-03-11 07:18:05 +00:00
Steve Lhomme 26abe73e4f vout/interlacing: don't inherit sout-deinterlace-mode
We just release the inherited value and overwrite a new value.
This also fixes a crash if the software deinterlacer module is not found.

var_CreateGetString is just:
```
    var_Create( p_obj, psz_name, VLC_VAR_STRING | VLC_VAR_DOINHERIT );
    return var_GetString( p_obj, psz_name );
```
2023-03-11 06:47:27 +00:00
Alexandre Janniaux 36dbf29d99 access: concat: fix typo in shortcut 2023-03-10 14:18:48 +00:00
Steve Lhomme dfabf7dc87 mp4/coreaudio: use CoreAudio_Layout enum for the layout
Fixes a sign comparison warning.
2023-03-10 13:48:55 +00:00
Steve Lhomme 5f49b61670 mp4/coreaudio: move enums up
No functional changes.
2023-03-10 13:48:55 +00:00
Claudio Cambra d90149a20b macosx: Ensure volume buttons in library window control bar are properly scaled
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
2023-03-10 11:38:40 +00:00
Claudio Cambra 3f966e6a48 macosx: Use template image for icons of volume buttons in main library window control bar
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
2023-03-10 11:38:40 +00:00
Martin Storsjö 1b84d610bc contrib: fxc2: Build an aarch64 version of fxc2 if doing the build on aarch64
Bump to a newer version of the fxc2 repo, that support aarch64.

The fxc2 tool in contribs isn't meant to be built for the cross
target, but to run on the build host; therefore, pick an
aarch64 mingw cross compiler if running on aarch64 linux.
2023-03-10 10:07:03 +00:00
Pierre Lamot 9d8fa31838 qt: fix accessiblity with X11 compositor
this follows the same scheme as DComp compositor
2023-03-10 08:38:25 +00:00
Pierre Lamot e854adcf8b qt: switch the render window from a QMainWindow (QWidget) to a QWindow
QMainWindow is based on QWidget but we don't need the associated features, and
it comes with its own QWindow and we have no control over it.
2023-03-10 08:38:25 +00:00
Pierre Lamot 8e725d6e17 qt: fix accessiblity with DirectComposition compositor
The method is basically the same as commit
41926e08d73ea6c4bbfc87a1dd52d2cdbc435c27 from QtDeclarative but applied to our
composition architecture

in a nutshell

- the offscreen QQuickWindow must not report the child interfaces
- the render QWindow must report the child interfaces
- The child interfaces must report the render window as the parent

We implement QAccessibleObject for both window implementing theses policies.

Focus events are forwarded to the right window (from qml to the render
window and vice-versa).

We also need to fake the visibility of the offscreen window to make it behave as
visible without creating an actual window
2023-03-10 08:38:25 +00:00
Pierre Lamot c71f0c08e2 qt: add base window classes for compositors
CompositorOffscreenWindow allows to fake making the window visible without
instantiating it

DummyRenderWindow is a simple window that doesn't draw anything, as using a bare
QWindow on Linux makes the window freeze while resizing
2023-03-10 08:38:25 +00:00
Pierre Lamot 231e170918 contrib: patch qtdeclarative for accessibility
This allows quick items to report accessibility events to the right window when
doing off-screen rendering

see QTBUG-67290 and https://codereview.qt-project.org/c/qt/qtdeclarative/+/348284

Qt5 version of the patch is cherry-picked from kde patchset from
https://invent.kde.org/qt/qt/qtdeclarative/
(6d1dd8925f160d6ad02ea646eac638675bdf9f1c)

first patch is mainly here in order to be able to apply second patch correctly
as we don't use the actual QQuickWidget in our code
2023-03-10 08:38:25 +00:00
Pierre Lamot fe6d64d321 meson: check for qt private header availability 2023-03-10 08:38:25 +00:00
Pierre Lamot 4ce5e03ed5 configure: check for qt private header availability 2023-03-10 08:38:25 +00:00
Steve Lhomme e7d0535a5d vpx: use plane_CopyPixels to copy pixels 2023-03-10 08:21:17 +00:00
Thomas Guillem 0d817af380 es_out: add missing jitter update when creating a decoder
This fixes the input not being able to catch up with the delay when
setting it from start (via --audio-desync or --sub-delay). This was
noticeable with --clock-master=input.
2023-03-10 05:36:25 +00:00