summaryrefslogtreecommitdiff
path: root/avmedia
AgeCommit message (Collapse)Author
2023-11-08loplugin:stringstatic, lopluign:ostr (clang-cl)Stephan Bergmann
Change-Id: I7a928a2385286f6d1ab3887c8d315af3f47c052d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159135 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-05tdf#158068: an example of "abc" -> u"abc"_ustr conversionMike Kaganski
Change-Id: I1225548ebc313cac98c4b924a8fb53f53bada76d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158946 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-05tdf#158067: an example of OUStringLiteral -> operator u""_ustr replacementMike Kaganski
Change-Id: I0a15d1d30ee59d8f574a5a9c79ab11e316dbe76c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158945 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-03avoid the neeed to escape url passed to gstreamerCaolán McNamara
Change-Id: I13d0cee911a3c9af99b494dde16b8d51f78d954a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158889 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-03escape url passed to gstreamerCaolán McNamara
Change-Id: I3c93ee34800cc8563370f75ef3ef6f8a9220e6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158884 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...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>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: avmediaStephan Bergmann
Change-Id: Ib56a05e171f485ad01cb54ed87e01c3536ea733d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158142 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
...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>
2023-09-23Use less epoxy external headers dependencyGabor Kelemen
Change-Id: If5d4e5a65a0fcea6bd67cdba48742f6aaec0811d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156556 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-08-08avmedia : use std::recursive_mutex instead of osl::Mutex.Arnaud Versini
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>
2023-06-27loplugin:stringstatic look for more stringsNoel Grandin
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>
2023-06-24Change LocaleDataWrapper::getDuration() parameter to tools::DurationEike Rathke
... 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
2023-04-29Use getXWeak in avmediaMike Kaganski
Change-Id: I1dc1e597c50b0081375b9216ac4e6436b84aaa0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150832 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-21Fix some getImplementationNameStephan Bergmann
...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>
2023-04-05avmedia,*: guess the mime type of media files based on file nameMichael Stahl
.. 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>
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski
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>
2023-03-23rtl::Static to thread-safe-staticNoel Grandin
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-22Revert "avmedia : use std::mutex instead of osl::Mutex"Michael Stahl
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>
2023-03-15Silence -Werror=deprecated-declarations for nowStephan Bergmann
...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>
2023-03-11osl::Mutex->std::mutex in avmedia::win::WindowNoel Grandin
Change-Id: I4e6e7fd03c4aa7847edbc48bccac88ec361c8237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148637 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-12drop internal support for 1-bit imagesNoel Grandin
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>
2022-09-10unique_ptr->optional for GraphicNoel Grandin
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>
2022-08-26tdf#149971 avmedia: implement video crop support in the gsteamer backendMiklos Vajna
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
2022-08-25Related: tdf#149971 avmedia: add doc model and render for crop of media objectsMiklos Vajna
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
2022-08-25avmedia gtk: Fix build for Gtk >= 4.7.2 ('-Werror=deprecated-declarations')Michael Weghorn
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>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...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>
2022-08-15Fix typoAndrea Gelmini
Change-Id: I1bc4d4649fbf4d2cfe8e93bc3a4fca64804de6b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138241 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-07elide some string copiesNoel Grandin
Change-Id: I3e0d9f7e5a446689e007b9d01fb1c6bf9bc068e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-28improve debug output for gstreamer backendNoel Grandin
Change-Id: I9fd7af5726ebbca933d69a38669281f40c6c0319 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136576 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02clang-tidy modernize-pass-by-value in avmediaNoel Grandin
Change-Id: Ia579341951d3fa0a227cdfa888c380b032e2ee2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135312 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19tdf#148923 PPTX import: fix incorrect image in media fileTünde Tóth
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>
2022-05-05Just use Any ctor instead of makeAny in avmediaStephan Bergmann
Change-Id: Ib43fa3be2e63de8ad6967682c2b00e702eb527ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133850 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13Fix typoxuenhua
Change-Id: I77ee60e6e7c5482f49cb671d793687f831856628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132918 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-04-10loplugin:stringview check for getToken and trimNoel Grandin
since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-29tdf#145614 Convert #define to constexprofftkp
Change-Id: I2c57e2021a224fb7f69d1de5cf0f809a7d2422b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132151 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-22Move BSTR wrapper to systools, and fix some wrong BSTR usesMike Kaganski
BSTR is documented [1] to be prefixed by a 32-bit integer specifying its length *in bytes* (not characters), so passing wchar_t* as BSTR is wrong, and the length member of rtl_uString can't substitute the proper BSTR length, since rtl_uString::length specifies length in characters. Any code taking BSTR and using SysStringLen to get its length would only get half of the passed OUString data. In dbaccess/source/ui/dlg/adodatalinks.cxx, the abovementioned error was implemented. OTOH, OLEVariant::getByteSequence() in connectivity/source/drivers/ado/Aolevariant.cxx passed BSTR from tagVARIANT to ctor of OLEString, which resulted in the BSTR being freed in both dtors of OLEString and OLEVariant (the latter calls VariantClear, which itself clears string when vtfield is VT_BSTR). [1] https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/bstr Change-Id: Iedbd62b20133644258af3660616add7b63cac258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131950 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-22Simplify CoCreateInstance / CoGetClassObject with COMReferenceMike Kaganski
Change-Id: Ieb1035410c3c6c4b40ea779e829a940460d19b5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131922 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-04Fix typosAndrea Gelmini
Change-Id: I4b26b105e4c16b1860389deb7a629ff139bd260c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130976 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-01gtk4: media dimensions are only reliably available asyncCaolán McNamara
this is also the case for the direct gstreamer use in gtk3 but more egregious when abstracted away from it in gtk4 Change-Id: If90069308d67929585722c079c482cd4ad196e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130468 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-21gtk4: get getPreferredPlayerWindowSize workingCaolán McNamara
Change-Id: I5e5b02be6a902232c24120db513cdf3fc68b4421 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130224 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-21gtk4: get XFrameGrabber to workCaolán McNamara
Change-Id: I737fd72d11b11d0c3592857113e422f29da76e77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130223 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-19update video pos and size after change if currently playingCaolán McNamara
I'd prefer if it changed size during the resizing/repositioning, but at least make it immediately take the final size after the resize/reposition has happened. Change-Id: Ic3b4dd23921ad5cf6092f1514dd6538f9946998a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130178 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-19gtk4: use gtk_widget_set_can_target so the video can be picked up and movedCaolán McNamara
at least the rect it should stick to can be picked up and moved Change-Id: I71b53865049fef8dc3efa09dd441d66003ed1f47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130177 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-19gtk4: the assumption is that video is supposed to fit to the windowCaolán McNamara
Change-Id: Iacc31ee978a1279c23ac895fb6f8fd610ab3113d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130176 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-18first cut at using Gtk4 built in video playbackCaolán McNamara
Change-Id: Ib996cd3f5ddbf20a81cdbe4b1c6546d6df478fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129783 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-18there's only one media backend per platform currentlyCaolán McNamara
Change-Id: I8722395617929f7d710713934dd619134a318071 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130170 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-14update play/pause/stop when one of the other changesCaolán McNamara
so (esp under gtk) that when pause is enabled and pause is clicked again that it remains visually enabled Change-Id: I779bb1491d2473db926b8075a0b574ef5767337d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-14Related: tdf#34759 ditch PlayPending hack and use GST_STATE_TARGETCaolán McNamara
which seems to resolve the various problems here like that pressing stop makes it rewind to start but continue to play and that rewind/seek makes it start when it shouldn't Change-Id: I3df44f82205b7e81ecbc4ac86240e02d52a92e62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129907 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-14Related: tdf#100007 pause state not always updating "play" state to offCaolán McNamara
if I press pause then the UI gets stuck with both pause and stop pressed in, the check against time here seems insufficient so change merge and the setters to return true if there was a real change and use that as the guard to update the UI Change-Id: I550624fa3dcd5655d715a1f965bba9345b25ded7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129906 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>