Commit Graph

96415 Commits

Author SHA1 Message Date
Loïc Branstett f93de3ef23 stream/demux: move remaining callbacks to their respective ops struct
This commit moves the remaining callbacks of stream/demux: pf_read/
pf_block/pf_seek/pf_readdir and pf_demux into their operations table,
aiming at unifying all the callbacks under a unique place.
This is a follow-up to the introduction of typed controls callbacks
for stream and demux.

Like for the typed controls callbacks if no operation is provided
(ie, stream_t/demux_t.ops is NULL) by a module, the legacy pf_* will be
used instead as a fallback.

The commit doesn't migrate any of modules yet.
2023-03-24 10:51:36 +00:00
Alexandre Janniaux 69abb5200c input: decoder: remove flush workaround on Delete
Now that flush or drain is done before `vlc_input_decoder_Delete` and
that it has become mandatory, there is no need to flush during delete
preventively.
2023-03-24 06:35:39 +00:00
Alexandre Janniaux c9d874e7ff input: decoder: separate flushing and aborting
No pictures should be queued when aborting the input_decoder via
`vlc_input_decoder_Delete` since it should have been either drained or
queued, but for now the behaviour was conservatively setting flushing to
true in the destructor to ensure the decoder implementation would not
queue anything from there to the output.

Change the check to account for this in release. Future commits will
probably add a debug check to ensure decoder implementations are
conformant to this behaviour and won't queue data from their close
function.
2023-03-24 06:35:39 +00:00
Alexandre Janniaux 5f000b2872 vlc_decoder.h: document vlc_input_decoder_Delete
Add documentation for the vlc_input_decoder_Delete function to enforce
usage of vlc_input_decoder_Flush or vlc_input_decoder_Drain before
destruction.
2023-03-24 06:35:39 +00:00
Alexandre Janniaux cef875107b input: decoder: add explicit input decoder flush
Ensure the input_decoder is flushed before deletion, so that it's not
stuck waiting on the decoder implementation or the output for the ES.

The end goal is to simplify vlc_input_decoder_Delete to ensure it is
either flushed or drained before being deleted, so that the wanted
behaviour is written in the code and frames are neither dropped when
they should have been played, nor drained during interruption, resulting
in increased response time.
2023-03-24 06:35:39 +00:00
Alexandre Janniaux eb34fd0acb input: es_out: add explicit input decoder flush
Ensure the input_decoder is flushed before deletion, so that it's not
stuck waiting on the decoder implementation or the output for the ES.

The end goal is to simplify vlc_input_decoder_Delete to ensure it is
either flushed or drained before being deleted, so that the wanted
behaviour is written in the code and frames are neither dropped when
they should have been played, nor drained during interruption, resulting
in increased response time.
2023-03-24 06:35:39 +00:00
Alexandre Janniaux 13ffce3086 stream out: display: add explicit input decoder flush
Ensure the input_decoder is flushed before deletion, so that it's not
stuck waiting on the decoder implementation or the output for the ES.

The end goal is to simplify vlc_input_decoder_Delete to ensure it is
either flushed or drained before being deleted, so that the wanted
behaviour is written in the code and frames are neither dropped when
they should have been played, nor drained during interruption, resulting
in increased response time.
2023-03-24 06:35:39 +00:00
Alexandre Janniaux 23a0ea4b4e input: decoder: fix flushing when deleting decoder
An input_decoder instance can be deleted while its DecoderThread, the
thread calling decoder_t::pf_decode, is still running, meaning that
the deletion request happens asynchronously to the decoding process.

In particular, when the input_decoder instance is being deleted, an
aborting state is signalled to the DecoderThread and the input decoder
joins the thread afterwards.

In order to return and be joined, the DecoderThread needs to finish what
it was doing. In the case of a decoder, where input is paced by output
availability, it's likely that the decoder will get paced and will be
waiting on the decoder_t::pf_decode call. To finalize this call, the
decoder must be provided pictures back from the output, so that the
block from decoder_t::pf_decode can be queued.

At the beginning of the deletion, by setting p_owner->flushing to true,
we also prevent the decoder implementation to queue blocks into the
output (from commit 34a548cc02). When
flushing the input decoder, the output was also correctly flushed
(tested by 91aabbf066) which matches with
how the decoder implementation can be unblocked.

But in the case of closing, output flushing was only happening when the
output was paused, meaning that a deadlock could happen if every
pictures were queued to the output when the decoder would be deleted
while it was decoding another new block.

This issue was reproduced with the Videotoolbox decoder.
2023-03-24 06:35:39 +00:00
Francois Cartegnie f7bb59d9f5 demux: mp4: always check and use next edit list
directly skips empty edits and avoids stopping
on last track sample (fixes loop playback)
2023-03-24 01:04:39 +00:00
Francois Cartegnie bde2098647 demux: mp4: move edit list mapping to own functions 2023-03-24 01:04:39 +00:00
Francois Cartegnie 06ce45c754 demux: mp4: fix wrong edit list offset regression 2023-03-24 01:04:39 +00:00
Francois Cartegnie 3ef970a52a demux: libmp4: rework edit list storage 2023-03-24 01:04:39 +00:00
Francois Cartegnie 90811de8f8 demux: libmp4: restrict to known elst versions 2023-03-24 01:04:39 +00:00
Francois Cartegnie 413ffdd36b demux: libmp4: do not store elst version 2023-03-24 01:04:39 +00:00
Francois Cartegnie 7c94acd145 demux: mp4: return only last sample dts 2023-03-24 01:04:39 +00:00
Pierre Lamot 199de0535b qt: report 0 size when the ml cache is loaded but empty
7d70397c7d doesn't work properly without this,
model remains in loading state
2023-03-23 15:09:15 +00:00
Simon Latapie f7d4afc821 doc: QtPlayer: fix file opening on Windows
Using a raw path from the QFileDialog can lead to wrong native
separators in the provided string.
Using URLs instead of paths should be more cross-platform compliant.
2023-03-23 14:36:25 +00:00
Pierre Lamot f808bdd6b8 interop_dxva2: fix flickering effect 2023-03-22 14:32:07 +00:00
Steve Lhomme 3e838637ae interop_dxva2: use container_of instead of object cast 2023-03-21 15:35:57 +00:00
Steve Lhomme 2e335eba28 interop_dxva2: add comments about the processor output values
The same code in direct3d9 uses an output format that can vary.
2023-03-21 15:35:57 +00:00
Steve Lhomme dd8297d27a d3d9: use the official typedef for DXVAHD_CreateDevice()
It doesn't exist in mingw so we define it in that case.
2023-03-21 15:35:57 +00:00
Steve Lhomme b86fbe2e7a d3d9: explicitly set the processing input type
We do the processing on video files, not "graphics" generated sources.
2023-03-21 15:35:57 +00:00
Steve Lhomme 367b7e8eea d3d9: fully initialize DXVAHD_BLT_STATE_INPUT_COLOR_SPACE_DATA
Although we set all known usable bits, it seems that leaving reserved bits
"uninitialized" doesn't work in some case. In particular with LLVM builds,
which results in bogus output.
2023-03-21 15:35:57 +00:00
Steve Lhomme a7de762a71 d3d9: fully initialize DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE_DATA
Although we set all known usable bits, it seems that leaving reserved bits
"uninitialized" doesn't work in some case. In particular with LLVM builds,
which results in bogus output.

Co-authored-by: Pierre Lamot <pierre@videolabs.io>
2023-03-21 15:35:57 +00:00
Steve Lhomme 96a19e9410 contrib: mingw64: patch dxvahd.h before mingw-w64 11
The releases before 11 had bogus dxvahd
DXVAHD_STREAM_STATE_xxx_COLOR_SPACE_DATA structures. This was confusing the
initialization with LLVM.
2023-03-21 15:35:57 +00:00
Khalid Masum f9b271e02b es_out: remove unused variable
Creation and initialization of p_sys in EsOutSetEsDelay is not
necessary as it is performed in EsOutUpdateDelayJitter later
anyway.
2023-03-21 09:51:57 +00:00
Prince Gupta f5d795355e qml: handle Navigation Cancel in MainViewLoader 2023-03-20 10:02:14 +00:00
Prince Gupta 62e94c6d8f qt: allow navigation functions to fallback to default behaviour 2023-03-20 10:02:14 +00:00
Prince Gupta 84a5bed6ce qml: use MainViewLoader in MusicGenres component 2023-03-20 10:02:14 +00:00
Prince Gupta e3b13a6892 qml: use MainViewLoader in MusicAlbums component 2023-03-20 10:02:14 +00:00
Prince Gupta 4643f5564d qml: use MainViewLoader in MusicAllArtists component 2023-03-20 10:02:14 +00:00
Prince Gupta ea0eaffa40 qml: use MainViewLoader for PlaylistMediaList 2023-03-20 10:02:14 +00:00
Prince Gupta a9e02b669a qml: use MainViewLoader in VideoAll 2023-03-20 10:02:14 +00:00
Prince Gupta b0ae61dd55 qml: check nullability in Helpers.get 2023-03-20 10:02:14 +00:00
Prince Gupta ecf0c9ce9d qml: implement MainViewLoader 2023-03-20 10:02:14 +00:00
Steve Lhomme 869a03432a webservices/json: update the JSON parser to version 1.1.0
json_parse_ex() now requires the length of the JSON string to parse.

The following changes are integrated:
* 672dd79c40 (int64 on Windows),
* ecb7c84719 (proper include guards),
* c8edcab8cd (null deref),
* 894bab1c0a (fallthrough warning)

The (unused) json_relaxed_commas flag is gone.

We may also use it as a contrib.
2023-03-20 08:19:23 +00:00
Steve Lhomme 6f9b01e6f4 json_helper: get the size of the read buffer 2023-03-20 08:19:23 +00:00
Fatih Uzunoglu 7d70397c7d qt: discontinue hasContent and use isReady property in MLBaseModel 2023-03-19 08:12:33 +00:00
Pierre Lamot ff905bd558 qml: add missing color in EmptyLabelHint 2023-03-18 16:04:39 +00:00
Pierre Lamot 2aa07f5222 qml: add missing import for ColorContext 2023-03-18 16:04:39 +00:00
Pierre Lamot 9d87d210bd qml: fix label not colorized properly in the ToolbarEditor
it tries to use the colorContext of the WindowDialog which was not exposed
2023-03-18 16:04:39 +00:00
Pierre Lamot 8b9293f33d qt: update ColorContext colors when palette internally changes 2023-03-18 16:04:39 +00:00
Pierre Lamot 4d5606c58d qt: disable acrylic effect when high-contrast theme is used on windows 2023-03-17 21:06:26 +00:00
Pierre Lamot 1a4eb729d9 qt: use high-contrast colors on windows
when the user enable the high-contrast mode on windows, we must comply to the
system palette
2023-03-17 21:06:26 +00:00
Thomas Guillem e476328eb6 audiotrack: use precise latency
AudioTrack#getTimestamp, present since API 19, is the most precise,
[-20ms;0ms] delay tested with the Sync-One2.
2023-03-17 20:44:54 +00:00
Thomas Guillem 4bb250cd8b audiotrack: use TimingReport API
Remove the smoothpos hack that was only needed for time_get.
2023-03-17 20:44:54 +00:00
Thomas Guillem 8d0819f5c1 audiotrack: remove unused cond
Leftover from 582570aad1
2023-03-17 20:44:54 +00:00
Thomas Guillem 6202abd9e3 audiotrack: reorder to avoid forward declaration
No functional changes.
2023-03-17 20:44:54 +00:00
Benjamin Arnaud cb8d593013 qml/Player: Add pin background opacity 2023-03-17 13:28:56 +00:00
Benjamin Arnaud a965917a04 qml/Player: Update the 'pinned' behavior
When pinned in fullscreen, we want the controlbar to retain the default design and hide
everything at the top.
2023-03-17 13:28:56 +00:00