Age | Commit message (Collapse) | Author | Files | Lines |
|
For the gtk4 VCL plugin, require GTK version >= 4.10
and drop code for older versions.
This simplifies maintenance, in particular since
requiring 4.10 ensures that the basic GtkAccessible API
is available.
GTK 4.10 was released on 2023-03-04 [1], so it
will be almost 2 years by the time that LO 25.2
will be released.
Given that the gtk4 VCL plugin is still experimental,
providing support for older GTK 4 releases shouldn't
have to be a concern.
[1] https://gitlab.gnome.org/GNOME/gtk/-/blob/4.10.0/NEWS?ref_type=tags
Change-Id: I6f361b533391225d0e74c174e0479b767b9d827a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169324
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
|
|
While opending a slide with a video worked fine for
me with the qt6 VCL plugin and a local Qt development
build on Debian testing (qtbase as of
8915ae3a75c4a356d94962dd9b31e1458f2a506f,
qtwayland as of deae8b9ce9f551b29ef98d0bb827a8543af2797e,
qtmultimedia as of 235ba5f273fbb7dfed8ba3736e4444a85aee5770),
this resulted in a freeze when using Debian's system-provided
Qt packages instead (libqt6multimedia6:amd64 6.4.2-11+b2).
While the self-compiled Qt dev is using `QFFmpegMediaPlayer`
which asynchronously loads media, the system QtMultimedia
is using `QGstreamerMediaPlayer` (s. frame 37 in below backtrace)
that apparently doesn't use multiple threads.
Therefore, using `Qt::BlockingQueuedConnection` is problematic,
as its documentation [1] says:
> Same as Qt::QueuedConnection, except that the signalling thread blocks
> until the slot returns. This connection must not be used if the receiver
> lives in the signalling thread, or else the application will deadlock.
Use `Qt::AutoConnection` (= 0, the default) instead and specify the
`Qt::SingleShotConnection` flag in addition to ensure the slot
gets called only once:
> This is a flag that can be combined with any one of the above connection
> types, using a bitwise OR. When Qt::SingleShotConnection is set, the
> slot is going to be called only once; the connection will be
> automatically broken when the signal is emitted. This flag was
> introduced in Qt 6.0.
Drop the now no longer needed manual disconnect.
This makes the scenario work with both, the custom-compiled
Qt dev using `QFFmpegMediaPlayer` and the system-provided
Qt 6.4.2 using `QGstreamerMediaPlayer`.
Side note: Unrelated to the issue addressed here, using the
system-provided Qt with `QGstreamerMediaPlayer` results
in a crash when started via the soffice shell script wrapper
with a LibreOffice debug build or when using soffice.bin directly
and manually setting `MALLOC_PERTURB_=153`, which indicates
some memory issue. That could be within Qt, though, haven't
analyzed that further.
Backtrace of deadlock:
1 syscall syscall.S 38 0x7f40a83249f9
2 QSemaphore::acquire(int) 0x7f40948714e2
3 ?? 0x7f409477fede
4 QVideoSink::videoFrameChanged(QVideoFrame const&) const 0x7f4095195376
5 ?? 0x7f405c219f5c
6 ?? 0x7f405c21a25b
7 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7f4093782d62
8 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7f40947356d8
9 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *) 0x7f40947358b7
10 ?? 0x7f4094925257
11 ?? 0x7f409ab0de3f
12 ?? 0x7f409ab0fec7
13 g_main_context_iteration 0x7f409ab104e0
14 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x7f4094922f60
15 QtInstance::ImplYield QtInstance.cxx 455 0x7f4094e534e0
16 QtInstance::DoYield QtInstance.cxx 464 0x7f4094e568a5
17 ImplYield svapp.cxx 384 0x7f409f3c48cc
18 Scheduler::ProcessEventsToIdle svapp.cxx 419 0x7f409f3c4bc8
19 avmedia::qt::QtFrameGrabber::grabFrame QtFrameGrabber.cxx 106 0x7f405cac5524
20 non-virtual thunk to avmedia::qt::QtFrameGrabber::grabFrame(double) 0x7f405cac564e
21 avmedia::MediaWindow::grabFrame mediawindow.cxx 385 0x7f40a03e41ad
22 SdrMediaObj::getSnapshot() const::$_0::operator()(com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) const svdomedia.cxx 195 0x7f40a249e5b5
23 std::__invoke_impl<void, SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&>(std::__invoke_other, SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) invoke.h 61 0x7f40a249e52d
24 std::__invoke_r<void, SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&>(SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) invoke.h 111 0x7f40a249e4dd
25 std::_Function_handler<void (com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&), SdrMediaObj::getSnapshot() const::$_0>::_M_invoke(std::_Any_data const&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) std_function.h 290 0x7f40a249e345
26 std::function<void (com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&)>::operator()(com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) const std_function.h 591 0x7f40a03e96cd
27 avmedia::PlayerListener::callPlayerWindowSizeAvailable mediawindow.hxx 76 0x7f40a03e6bf1
28 avmedia::PlayerListener::preferredPlayerWindowSizeAvailable mediawindow.cxx 496 0x7f40a03e5055
29 avmedia::qt::QtPlayer::notifyListeners QtPlayer.cxx 395 0x7f405cacfd53
30 avmedia::qt::QtPlayer::notifyIfReady QtPlayer.cxx 326 0x7f405cacfb42
31 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QMediaPlayer::MediaStatus>, void, void (avmedia::qt::QtPlayer:: *)(QMediaPlayer::MediaStatus)>::call qobjectdefs_impl.h 135 0x7f405cad477b
32 QtPrivate::FunctionPointer<void (avmedia::qt::QtPlayer:: *)(QMediaPlayer::MediaStatus)>::call<QtPrivate::List<QMediaPlayer::MediaStatus>, void> qobjectdefs_impl.h 172 0x7f405cad46cd
33 QtPrivate::QSlotObject<void (avmedia::qt::QtPlayer:: *)(QMediaPlayer::MediaStatus), QtPrivate::List<QMediaPlayer::MediaStatus>, void>::impl qobjectdefs_impl.h 383 0x7f405cad4612
34 ?? 0x7f409477fbbe
35 QMediaPlayer::mediaStatusChanged(QMediaPlayer::MediaStatus) 0x7f4095184a05
36 ?? 0x7f405c210740
37 non-virtual thunk to QGstreamerMediaPlayer::processBusMessage(QGstreamerMessage const&) 0x7f405c2009f7
38 ?? 0x7f405c21aa94
39 QObject::event(QEvent *) 0x7f40947723e0
40 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7f4093782d62
41 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7f40947356d8
42 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *) 0x7f40947358b7
43 ?? 0x7f4094925257
44 ?? 0x7f409ab0de3f
45 ?? 0x7f409ab0fec7
46 g_main_context_iteration 0x7f409ab104e0
47 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x7f4094922f60
48 QtInstance::ImplYield QtInstance.cxx 455 0x7f4094e534e0
49 QtInstance::DoYield QtInstance.cxx 464 0x7f4094e568a5
50 ImplYield svapp.cxx 384 0x7f409f3c48cc
51 Scheduler::ProcessEventsToIdle svapp.cxx 419 0x7f409f3c4bc8
52 avmedia::qt::QtFrameGrabber::grabFrame QtFrameGrabber.cxx 106 0x7f405cac5524
53 non-virtual thunk to avmedia::qt::QtFrameGrabber::grabFrame(double) 0x7f405cac564e
54 avmedia::MediaWindow::grabFrame mediawindow.cxx 385 0x7f40a03e41ad
55 SdrMediaObj::getSnapshot() const::$_0::operator()(com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) const svdomedia.cxx 195 0x7f40a249e5b5
56 std::__invoke_impl<void, SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&>(std::__invoke_other, SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) invoke.h 61 0x7f40a249e52d
57 std::__invoke_r<void, SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&>(SdrMediaObj::getSnapshot() const::$_0&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) invoke.h 111 0x7f40a249e4dd
58 std::_Function_handler<void (com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&), SdrMediaObj::getSnapshot() const::$_0>::_M_invoke(std::_Any_data const&, com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) std_function.h 290 0x7f40a249e345
59 std::function<void (com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&)>::operator()(com::sun::star::uno::Reference<com::sun::star::media::XPlayer> const&) const std_function.h 591 0x7f40a03e96cd
60 avmedia::PlayerListener::callPlayerWindowSizeAvailable mediawindow.hxx 76 0x7f40a03e6bf1
61 avmedia::PlayerListener::preferredPlayerWindowSizeAvailable mediawindow.cxx 496 0x7f40a03e5055
62 avmedia::qt::QtPlayer::notifyListeners QtPlayer.cxx 395 0x7f405cacfd53
63 avmedia::qt::QtPlayer::notifyIfReady QtPlayer.cxx 326 0x7f405cacfb42
64 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QMediaPlayer::MediaStatus>, void, void (avmedia::qt::QtPlayer:: *)(QMediaPlayer::MediaStatus)>::call qobjectdefs_impl.h 135 0x7f405cad477b
65 QtPrivate::FunctionPointer<void (avmedia::qt::QtPlayer:: *)(QMediaPlayer::MediaStatus)>::call<QtPrivate::List<QMediaPlayer::MediaStatus>, void> qobjectdefs_impl.h 172 0x7f405cad46cd
66 QtPrivate::QSlotObject<void (avmedia::qt::QtPlayer:: *)(QMediaPlayer::MediaStatus), QtPrivate::List<QMediaPlayer::MediaStatus>, void>::impl qobjectdefs_impl.h 383 0x7f405cad4612
[1] https://doc.qt.io/qt-6/qt.html#ConnectionType-enum
Change-Id: Ia8bfd19b0c0c4f970a5eb200c2a0b45784ef25fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169036
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
So far, `QtPlayer::createPlayerWindow` was unconditionally
creating a video widget.
However, audio-only media files can be used as well,
therefore handle that case, too and create a widget
holding an audio icon as a placeholder instead if
the media doesn't contain video.
(This is the same icon shown when using qt5 that
doesn't use QtMultimedia).
As described in
commit a99575f04fa9c858bfcd996f037444135810d43f
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sat Jun 1 07:32:22 2024 +0200
tdf#194504 qt avmedia: Don't wait for video frame if there's none
, `QMediaPlayer::hasVideo()` only returns a useful
result once loading media has finished. Therefore,
if the player is still in that state in
`QtPlayer::createPlayerWindow`, defer
creating the widget to when the media status
changes.
With this commit in place, opening an Impress presentation
that contains an audio file (like attachment 194504
from tdf#145735) and starting presentation mode now shows an
"audio icon" as placeholder as expected when using
the qt6 VCL plugin.
(This commit here makes that work for presentation
mode, while the above-mentioned commit already made
the icon show as expected for non-presentation mode.)
Change-Id: I1ff7e8b8659162a748abc3f97a8d2181375c0e7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169009
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
The SfxPoolItem has a new member SfxItemType m_eItemType to
compare types based on enums instead of typeinfo() which
consumes a lot of time e.g. while AutoFormat is running
Change-Id: I033ce67bc9a28ee4790f162380314de85fb4154e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166452
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
If the media doesn't have video, then don't try to
grab a frame, but stop waiting for the
`QVideoSink::videoFrameChanged` signal to be emitted
in `QtFrameGrabber::grabFrame`.
Don't call `QMediaPlayer::hasVideo` while the media
is still being loaded, as the result is only valid once loading
the media has been finished (`false` is returned otherwise
even if the media file contains video), s. the platform
implementation in qtmultimedia's `QFFmpegMediaPlayer::setMedia`,
which loads the media in a separate thread: Once the media
has been loaded, `QFFmpegMediaPlayer::setMediaAsync`
calls `QPlatformMediaPlayer::videoAvailableChanged`
to specify whether video is available.
With this commit in place, opening an Impress presentation
that contains an audio file (like attachment 194504
from tdf#145735) now shows an "audio icon" as placeholder
as expected and the application exits properly on close,
rather than blocking as it's still waiting for a video frame.
Change-Id: I5448a9f7396d4c419d76a2400e3f2a1ef52a7e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168305
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Change-Id: I904fb00c7aa934b27d6e4435a2495607f18b3abf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168290
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Add a new `QtFrameGrabber` class that implements
the `css::media::XFrameGrabber` interface and
return an instance of it in
`QtPlayer::createFrameGrabber`.
As there seems to be no direct way to retrieve
the image/frame of a video at a certain point
in time, create a separate `QMediaPlayer` instance
for the `QtFrameGrabber`, set a video sink, connect
to its `&QVideoSink::videoFrameChanged` signal and
start playing the video (and stop it again once the
first frame has been received) in order to retrieve
a corresponding frame.
From that `QVideoFrame`, a `QImage` can be retrieved
that can then be converted to an `XGraphic`.
With this in place, a frame from the actual video
is now displaced in Impress in non-presentation
mode instead of just a generic "video icon" placeholder
when opening a presentation containing a video,
(e.g. attachment 145517 from tdf#120452) when the
qt6 VCL plugin is in use.
Change-Id: I3bba3c0fb62a219ac632ceed03ec17f9078f18d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168255
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
In `QtPlayer::getPreferredPlayerWindowSize`, retrieve the
video resolution from the meta data and return that for the
preferred window size if available, instead of always returning
an empty rect.
For the sample presentation referenced in tdf#145735,
the size retrieved this way also matches what
`GtkPlayer::getPreferredPlayerWindowSize` returns
(720x400).
As mentioned in
commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Mon May 20 16:25:09 2024 +0200
tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback
, the behaviour without this was:
> * In non-presentation mode, the placeholder
> shown until the video gets started using the controls
> in the sidebar is just an "audio icon", not a frame
> from the actual video. (This might be related to the
> fact that `QtPlayer::createFrameGrabber` currently
> returns an empty reference.)
With this in place, the placeholder is now a different
icon, a "video icon" (but still not a frame from the actual
video).
Change-Id: I295abe6b7973fece3fcaf9a38af2602cb08610a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168013
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Similar to the way that GTK 4's native facilities for
video playback are used for the gtk4 VCL plugin, initially
added in commit
commit d0a527ec09516bc7215baf229adb90cd21ffa27a
Author: Caolán McNamara <caolanm@redhat.com>
Date: Thu Feb 10 12:55:18 2022 +0000
first cut at using Gtk4 built in video playback
, implement media playback using QtMultimedia for the
Qt 6 based VCL plugins (qt6/kf6) via a new service
"com.sun.star.comp.avmedia.Manager_Qt".
Video playback with the mechanism used for qt5 no
longer works with qt6, as "qwidget5videosink"
that gets used on Wayland for qt5 wasn't ported
to Qt 6 and is unmaintained, s. the commit message of
commit 88d57cf241209ffec9eaed3e523942ab51af6db6
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Sep 29 11:09:51 2021 +0200
qt6: Add a qt6 VCL plugin
for more details. Additionally, this also doesn't work
properly any more on X11/with the xcb Qt QPA platform, see
tdf#145735 comment 7.
Instead of using GStreamer directly, let Qt handle
the low-level stuff by using the QtMultimedia module [1]
instead.
This adds a new dependency on QtMultimedia.
For building, this requires installing the Qt 6 QtMultimedia
development headers (e.g. package `qt6-multimedia-dev`
on current Debian testing).
Except for WASM, the use of QtMultimedia is enabled by
default when building with autogen options `--enable-qt6`
or `--enable-kf6`, but can explicitly be disabled using
`--disable-qt6-multimedia`.
In tests with the qt6 VCL plugin on Debian testing, with a
sample presentation containing an embedded
video, attachment 145517 from tdf#120452, video playback
generally works for both, the xcb and the wayland
Qt QPA platforms:
* Video and audio are played as expected on the external
screen in presentation mode when using the presenter
console
* Video and audio playback work in non-presentation
mode by clicking on the video and using the controls
in the Impress sidebar (play, pause,...).
However, the following issues were observed with
the current implementation:
* There's an odd frame/margin around the video.
* In non-presentation mode, the placeholder
shown until the video gets started using the controls
in the sidebar is just an "audio icon", not a frame
from the actual video. (This might be related to the
fact that `QtPlayer::createFrameGrabber` currently
returns an empty reference.)
* At least on Wayland (issue not observed with
QT_QPA_PLATFORM=xcb so far), when using the presenter
console, video playback in the presenter console (i.e. on the
non-presentation screen) is unreliable: The video
sometimes shows, but sometimes doesn't. At least the
(more important) one on the presentation screen was
reliably shown in my tests, however.
Tested with git dev versions of qtbase
(as of commit 8d5e7d50d8dbf1ad79bd8ff9f6ef6028eba481c9),
qtwayland (as of commit 6f0ebd916f176f6fbe35af28caeb52b62768ac94)
and qtmultimedia (as of commit
264b7e8d7d5683252102b5e5149685c8b8a70c2d).
[1] https://doc.qt.io/qt-6/qtmultimedia-index.html
Change-Id: I29c3c7ded01c61b49b192fa5c313d8a92c942185
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167869
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
In the same way that `vcl/Library_vclplug_gtk4.mk` does
it, set the `GTK4_CFLAGS` (which have the includes) via
`gb_Library_set_include`, not `gb_Library_add_cxxflags`.
This makes sure that they end up in the `INCLUDE`
section in `workdir/GbuildToJson/Library/libavmediagtk.so`
and thus end up in the IDE integrations as includes,
which makes Qt Creator's Clang Code Model find them
instead of showing an error
("gtkplayer.cxx:28:10: 'gtk/gtk.h' file not found").
See also this similar commit for more details:
commit 6a53832080cf201e960113de8e1887d99e857606
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Mon Dec 17 15:35:58 2018 +0100
Use 'gb_Library_set_include' for GTK3_CFLAGS
Change-Id: I5ef01aff32073d37b8add0b2250402ccaa48b2dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167857
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Change-Id: Ice017029f0b93ae92e76d3905f38c730cc5a2fc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167189
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I19f466a272c821185bea4b45efd34392e525c0d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165785
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I167354cbf998dd08ef8b5ffba744758539cabec5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165547
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I1b9975841a702d7ad3e05adef3d849c63ddf264a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163009
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
|
|
Change-Id: I0b7f8dda1d266f6d71b5781bea65242ff235bc47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161593
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
|
|
There are some CrashReports in 7.6 which have
DeleteItemOnIdle on the stack, but there is nothing
reproducable. So I took a look...
I first thought it's a MCGR regression, due to classes
on the stack. But the Item involved is just random, can
happen with any Item.
Then I thought it may have to do with ITEM refactorings,
but it happens with DeleteItemOnIdle involved, so also
not the case. I already saw DeleteItemOnIdle when doing
these and qualified as 'hack' in the way. already
It is only on Windows and DeleteItemOnIdle is involved.
This again (took a deeper look now) is an old hack to
keep an SfxPoolItem 'alive' for some 'time'. For that,
it triggers an async reschedule which then deletes the
Item when being called. If the Item will be used after
that is pure coincidence - seems to work in most cases.
It seems as if for Windows the timing slightly changed
for some scenarios, so a reschedule is too early. This
can happen with this hack anytime.
DeleteItemOnIdle is used in scenarios where SfxPoolItem*
is e.g. returned, but is *not* anchored, so e.g. not
member of an SfxItemSet. Or in short: Lifetime is not
safe.
DeleteItemOnIdle exists since 1st import, but was
changed to AsyncEvent ca. 4 months ago (see
57145acf9ec47c23e307b7a5c0029d21d937cc35), so that may
have caused it. It is possible that these errors happen
on Windows since then. Before something more complicated
was used to delete it late, but surely also not really
safe.
Due to ITEM refactor I have the knowledge/tooling to
solve this. It will not be a 1-5 lines fix, but it is
a hack and in the way for further ITEM refactor anyways.
What we have nowadays is a SfxPoolItemHolder -> it's
like an SfxItemSet for a single Item. It safely holds/
controls the lifetime of an SfxPoolItem. It is already
used in quite some places. It helps to solve many hacks,
also the ones putting Items directly to the Pool - due
to there never was an alternative for that. In principle
the ItemPool/ItemSet/Item paradigm was never complete
without SfxPoolItemHolder.
Thus I started to fix that (and remove that hack for
good, sooo many changes over the years, sigh), but as
said is not straightforward. Will have to change
retvals of involved stuff to SfxPoolItemHolder - it's
just two pointers and designed to be copied (one is a
Pool, needed to cleanup when destructing).
CopyConstruct/destroy just counts the RefCnt up/down,
so cheap.
1st version compiling, let's check on gerrit...
Corrected one error in QueryState for securitypage, also
added some security features/asserts.
Change-Id: Ida49fd35ca88ead84b11d93e18b978cb9e395090
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161083
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
and
cid#1545748 COPY_INSTEAD_OF_MOVE
cid#1545741 COPY_INSTEAD_OF_MOVE
cid#1545698 COPY_INSTEAD_OF_MOVE
cid#1545594 COPY_INSTEAD_OF_MOVE
cid#1545588 COPY_INSTEAD_OF_MOVE
cid#1545558 COPY_INSTEAD_OF_MOVE
cid#1545545 COPY_INSTEAD_OF_MOVE
Change-Id: I5dfec77a68959b9384fc71a2fc0908c5d1b42869
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160448
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
Change-Id: I7a928a2385286f6d1ab3887c8d315af3f47c052d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159135
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I1225548ebc313cac98c4b924a8fb53f53bada76d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158946
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I0a15d1d30ee59d8f574a5a9c79ab11e316dbe76c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158945
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I13d0cee911a3c9af99b494dde16b8d51f78d954a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158889
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
Change-Id: I3c93ee34800cc8563370f75ef3ef6f8a9220e6ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158884
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
...in include files. This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.
Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Ib56a05e171f485ad01cb54ed87e01c3536ea733d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158142
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr
paths into a new TranslateId::getId. And demonstrate constexpr'ability by
making the aCategories var in OApplicationIconControl::Fill
(dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more
such cases that could now be made constexpr.)
Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: If5d4e5a65a0fcea6bd67cdba48742f6aaec0811d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156556
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
|
|
Mostly reverts 621143588b3cb438baf27fb6893ab02e7b06f9dd but using recursive_mutex instead.
Change-Id: I4b23410720834e19c5dd28c43bc84ed1b3e08072
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153236
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
|
|
that can be initialised at compile-time instead of runtime
Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
... instead of tools::Time
Change-Id: I8e49de43a1870541d75add34089eec67b7a8be31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153533
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
|
|
Change-Id: I1dc1e597c50b0081375b9216ac4e6436b84aaa0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150832
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
...to match the corresponding .component entries
Change-Id: I280619b9c5660910ecc5386b39aa2c8d2ba23f9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150692
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
.. at least for the most popular types, and do it automatically in
MediaItem::setURL().
This should work in practice in most cases and is much simpler than
adding some type detection or calling into platform dependent avmedia
backends.
Remove the parameter that was only ever set to
"application/vnd.sun.star.media" anyway, the same value that would be
used if it's missing.
Stop using that silly type for everything, only use it when guessing
fails.
In case an ODF document is loaded, it will use the mime type loaded from
the file (see setting of MediaMimeType in SdXMLPluginShapeContext) and
not guess it because that would require updating the entry in
manifest.xml as well.
Change-Id: I8ce29cf7425678ae11dda1d8c875be818f8623af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150049
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
|
|
Standardize on OUString, which is the main internal string class.
Convert from/to OUString only when communicating with respective
external APIs.
Removes about 200 conversions from the code.
Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
This reverts commit 477fa6c3cb92f578032dee60482718efdb8f44f2.
MissingPluginInstaller requires a recursive lock:
Thread 2 (Thread 0x7f8e73d69700 (LWP 29931)):
0 __lll_lock_wait () at /lib64/libpthread.so.0
...
5 std::unique_lock<std::mutex>::lock() (this=0x7f8e73d65a88) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/std_mutex.h:267
6 std::unique_lock<std::mutex>::unique_lock(std::mutex&) (this=0x7f8e73d65a88, __m=...) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/std_mutex.h:197
7 avmedia::gstreamer::(anonymous namespace)::MissingPluginInstaller::detach(avmedia::gstreamer::Player const*) (this=0x7f8e644c6be0 <rtl::Static<avmedia::gstreamer::(anonymous namespace)::MissingPluginInstaller, avmedia::gstreamer::(anonymous namespace)::TheMissingPluginInstaller>::get()::instance>, source=0x75d2fa0) at avmedia/source/gstreamer/gstplayer.cxx:187
8 avmedia::gstreamer::Player::disposing() (this=0x75d2fa0) at avmedia/source/gstreamer/gstplayer.cxx:334
9 cppu::WeakComponentImplHelperBase::dispose() (this=0x75d2fa0) at cppuhelper/source/implbase.cxx:104
10 cppu::PartialWeakComponentImplHelper<com::sun::star::media::XPlayer, com::sun::star::lang::XServiceInfo>::dispose() (this=0x75d2fa0) at include/cppuhelper/compbase.hxx:90
11 cppu::WeakComponentImplHelperBase::release() (this=0x75d2fa0) at cppuhelper/source/implbase.cxx:79
13 rtl::Reference<avmedia::gstreamer::Player>::~Reference() (this=0x7f8e7c028f20) at include/rtl/ref.hxx:129
...
21 std::__debug::set<rtl::Reference<avmedia::gstreamer::Player>, std::less<rtl::Reference<avmedia::gstreamer::Player> >, std::allocator<rtl::Reference<avmedia::gstreamer::Player> > >::clear() (this=0x7f8e644c6cd8 <rtl::Static<avmedia::gstreamer::(anonymous namespace)::MissingPluginInstaller, avmedia::gstreamer::(anonymous namespace)::TheMissingPluginInstaller>::get()::instance+248>) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/set.h:426
22 avmedia::gstreamer::(anonymous namespace)::MissingPluginInstaller::report(rtl::Reference<avmedia::gstreamer::Player> const&, _GstMessage*) (this=0x7f8e644c6be0 <rtl::Static<avmedia::gstreamer::(anonymous namespace)::MissingPluginInstaller, avmedia::gstreamer::(anonymous namespace)::TheMissingPluginInstaller>::get()::instance>, source=..., message=0x7cdb400) at avmedia/source/gstreamer/gstplayer.cxx:156
23 avmedia::gstreamer::Player::processSyncMessage(_GstMessage*) (this=0x75abfe0, message=0x7cdb400) at avmedia/source/gstreamer/gstplayer.cxx:536
24 avmedia::gstreamer::pipeline_bus_sync_handler(_GstBus*, _GstMessage*, void*) (message=0x7cdb400, data=0x75abfe0) at avmedia/source/gstreamer/gstplayer.cxx:382
25 gst_bus_post () at /lib64/libgstreamer-1.0.so.0
Change-Id: Ia8e7fef4d4cee2dde7189702af6dddf883b6cceb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149233
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
|
|
...as seen with gtk4-devel-4.10.0-3.fc38.x86_64,
> avmedia/source/gtk/gtkplayer.cxx: In member function ‘virtual com::sun::star::uno::Reference<com::sun::star::media::XPlayerWindow> avmedia::gtk::GtkPlayer::createPlayerWindow(const com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)’:
> avmedia/source/gtk/gtkplayer.cxx:358:20: error: ‘void gtk_widget_show(GtkWidget*)’ is deprecated: Use 'gtk_widget_set_visible or gtk_window_present' instead [-Werror=deprecated-declarations]
> 358 | gtk_widget_show(m_pVideo);
> | ~~~~~~~~~~~~~~~^~~~~~~~~~
> In file included from /usr/include/gtk-4.0/gtk/gtkapplication.h:27,
> from /usr/include/gtk-4.0/gtk/gtkwindow.h:33,
> from /usr/include/gtk-4.0/gtk/gtkaboutdialog.h:30,
> from /usr/include/gtk-4.0/gtk/gtk.h:34,
> from avmedia/source/gtk/gtkplayer.cxx:28:
> /usr/include/gtk-4.0/gtk/gtkwidget.h:273:12: note: declared here
> 273 | void gtk_widget_show (GtkWidget *widget);
> | ^~~~~~~~~~~~~~~
> avmedia/source/gtk/gtkplayer.cxx:359:20: error: ‘void gtk_widget_show(GtkWidget*)’ is deprecated: Use 'gtk_widget_set_visible or gtk_window_present' instead [-Werror=deprecated-declarations]
> 359 | gtk_widget_show(pParent);
> | ~~~~~~~~~~~~~~~^~~~~~~~~
> /usr/include/gtk-4.0/gtk/gtkwidget.h:273:12: note: declared here
> 273 | void gtk_widget_show (GtkWidget *widget);
> | ^~~~~~~~~~~~~~~
Change-Id: I1cb2988cec6cda3dd3e43a3773647a3ddaf211e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148899
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I4e6e7fd03c4aa7847edbc48bccac88ec361c8237
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148637
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
on modern hardware, these are less efficient than regular alpha
channels.
Also, this greatly simplies the range of stuff that vcl needs to deal
with, which will make the upcoming transparency->alpha patch easier to
deal with.
Enhance vcl::CreateFromData to convert incoming 1-bit data to 8-bit
image.
Change-Id: I35829da750029fe373d0d2911a669d10bab6ad23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Graphic is just a wrapper around shared_ptr, so no need to
allocate this separately
Change-Id: Ie657dea1c021e66a6876e814090a44cb6f995b91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139739
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
If a media shape had cropping defined, we already took that into account
when presenting a preview for it, but not during video playback.
The reason for this is that the preview may be set by a file importer
(e.g. PPTX) explicitly, in which case the preview is a bitmap we get
without any video processing.
As a start, implement video crop for the gstreamer backend (used on
Linux), and also pass in the media item (containing crop and other
properties) both during the edit view (MediaWindowImpl) and presenting
(ViewMediaShape). We pass in the whole media item, so in case later
other filters (e.g. black-and-white) are wanted, we have all that info
in the backends already.
Other backends (avmediaMacAVF and avmediawin) are untouched so far.
svx/qa/unit/data/video-snapshot.pptx is modified to have a yellow border
when cropping is unimplemented, which is now not visible with the
gtreamer backend, matching PowerPoint behavior. PPTX export was working
out of the box already.
Change-Id: If26b7a4391bcffe9cbddd9933e1bab69be52924e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138867
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
It is possible to provide an explicit preview of media objects since
commit 8fa1d453c94cdbb03dac646fb8db2ebd1a0e84bd (Related: tdf#149971
svx: support explicitly provided snapshots for media shapes,
2022-08-24), however they can't be cropped.
This means that media shapes from PPTX with cropping show unexpected
content and can also have a buggy aspect ratio.
Extend avmedia::MediaItem to store cropping and take it into account
when returning the preview bitmap in SdrMediaObj::getSnapshot(). PPTX
import works out of the box, as oox/ already tried to set a cropping
property on the media shape.
This is just the preview, the cropping of the video itself is not yet
implemented.
Change-Id: I8db3e0dcf252613d56eb0e6139adf097e53b15cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138808
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Failed like this:
.../libreoffice/avmedia/source/gtk/gtkplayer.cxx: In member function ‘virtual com::sun::star::uno::Reference<com::sun::star::media::XPlayerWindow> avmedia::gtk::GtkPlayer::createPlayerWindow(const com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)’:
.../libreoffice/avmedia/source/gtk/gtkplayer.cxx:346:38: error: ‘void gtk_picture_set_keep_aspect_ratio(GtkPicture*, gboolean)’ is deprecated: Use 'gtk_picture_set_content_fit' instead [-Werror=deprecated-declarations]
346 | gtk_picture_set_keep_aspect_ratio(GTK_PICTURE(m_pVideo), false);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:196,
from .../libreoffice/avmedia/source/gtk/gtkplayer.cxx:28:
/usr/include/gtk-4.0/gtk/gtkpicture.h:73:17: note: declared here
73 | void gtk_picture_set_keep_aspect_ratio (GtkPicture *self,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [.../libreoffice/solenv/gbuild/LinkTarget.mk:337: .../libreoffice/workdir/CxxObject/avmedia/source/gtk/gtkplayer.o] Error 1
make: *** [Makefile:289: build] Error 2
Corresponding Gtk commit [1]:
commit d8a73cbd03118e94bd75f5fa183a646fecb053ce
Author: Marco Melorio <marco.melorio@protonmail.com>
Date: Fri Jul 15 18:18:26 2022 +0200
picture: Add content-fit property
It allows to specify the resize mode of the paintable inside the
GtkPicture allocation. This also deprecates the keep-aspect-ratio
property.
Fixes #5027.
While the doc [2] says its deprecated for 4.8, that sems to refer to stable
Gtk version only and it's already the case for the unstable version
4.7.2 (as packaged in Debian testing now):
$ git tag --contains d8a73cbd03118e94bd75f5fa183a646fecb053ce
4.7.2
Use `gtk_picture_set_content_fit` with `GTK_CONTENT_FIT_FILL`
that results in the same behavior for Gtk >= 4.7.2.
[1] https://gitlab.gnome.org/GNOME/gtk/-/commit/d8a73cbd03118e94bd75f5fa183a646fecb053ce
[2] https://docs.gtk.org/gtk4/method.Picture.set_keep_aspect_ratio.html
Change-Id: I9fc527e6674cb8e4774adbe7d14cce2a264a5a67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138797
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now. Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)
Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I1bc4d4649fbf4d2cfe8e93bc3a4fca64804de6b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138241
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I3e0d9f7e5a446689e007b9d01fb1c6bf9bc068e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136880
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I9fd7af5726ebbca933d69a38669281f40c6c0319
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136576
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ia579341951d3fa0a227cdfa888c380b032e2ee2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Linked media file was imported with incorrect image,
if the Impress couldn't play the media file.
Regression from commit 9564747d2fd5d2c859a359dd7fa6242c6859c0d7
(tdf#53970 PPTX: fix import of linked media files).
Change-Id: Ib277a61e83c3794376d2c090b7f742707e779832
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134394
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
|
|
Change-Id: Ib43fa3be2e63de8ad6967682c2b00e702eb527ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133850
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|