Passing NULL ends up using the same value.
We use vd->cfg in all cases so no need to pass it.
Also clean subsequent place_dest calls so we can tell which are not using
vd->source.
Cherry picks must:
- have the (cherry picked from commit <hash>) line
- have a Signed-off-by: line
- mention if the patch has been rebased (same changes, differing code around
the patch) or edited (modified to adapt to this branch)
(edited) or (rebased) text is added after the (cherry picked from commit <hash>) text
edited: or rebased: is added to explain what was differs from the original commit
When mismatching are detected the patches are put in patches-orig/ and
patches-new/ folder.
The longtext help is implying that --sout-keep will automatically add
the gather stream output filter which is not accurate.
It has never been the case as seen in original commit adding this:
4b7cff4d24.
The m_cover field is exposed (via getCover()) as a QML property, so it
must always be changed from the UI thread.
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
If cancel() was called before the first lock was acquired in run(), then
cancel() would return immediately and run() would continue as if it was
not canceled (which could cause segfaults).
To avoid the problem, always set the "canceled" flag on cancel, so that
any future execution of run() will return immediately.
Note: we could alternatively track the "finished" state, and wait until
the task is finished on cancel(). However, if run() may not start
immediately (if the thread pool is full), this strategy would cause to
block on cancel() until run() is actually executed, which is
unnecessary.
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
Now that the UI state is always accessed from the UI thread, locks and
atomics are not necessary anymore.
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
The medialib events notify changes that must be reflected in the UI, but
they can be executed from any thread, so it is incorrect to update the
UI from there (for example calling dataChanged() using an index not
necessary valid within the UI thread).
The callbacks provide an event structure pointing to data which are only
valid during the callback, so create a struct to copy the values and
dispatch the events to the UI thread.
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
A call to rowCount() only needs the number of items, there is no need to
fetch the actual data.
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
cfg, out, width and height are needed when the user want to adapt the
aspect ratio of the video on the rendering surface, but the sample
doesn't show this, so silence the warnings anyway.
Since there were two threads running concurrently for the same context,
eglMakeCurrent could fail almost everytime.
When two such threads exist, different OpenGL context must be assigned
to each of them and the correct resource sharing mechanism must be
enabled so that the rendering thread can use the resources generated by
the producing (VLC) thread.
In addition, we need the OpenGL context from the actual window for the
rendering, which will not be available right in the constructor, so
synchronize its creation through a semaphore, delaying the opening of
the vglmem module on the VLC side until the video is ready to be
rendered on the Qt side too.
The sample can now be built using either directly `qmake` (using
pkg-config to find the library on the system) or with the longer
`PKG_CONFIG_PATH=/path/where/vlc/is/installed qmake`.