441d8ed9be
Similar to the way that GTK 4's native facilities for video playback are used for the gtk4 VCL plugin, initially added in commit commitd0a527ec09
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 commit88d57cf241
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
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
#include <cppuhelper/supportsservice.hxx>
|
|
#include <rtl/ref.hxx>
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#include "QtManager.hxx"
|
|
#include "QtPlayer.hxx"
|
|
|
|
namespace avmedia::qt
|
|
{
|
|
QtManager::QtManager() {}
|
|
|
|
QtManager::~QtManager() {}
|
|
|
|
css::uno::Reference<css::media::XPlayer> SAL_CALL QtManager::createPlayer(const OUString& rURL)
|
|
{
|
|
const INetURLObject aURL(rURL);
|
|
OUString sMainURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
|
|
|
|
rtl::Reference<QtPlayer> xPlayer(new QtPlayer);
|
|
if (!xPlayer->create(sMainURL))
|
|
{
|
|
xPlayer->dispose();
|
|
xPlayer.clear();
|
|
}
|
|
return xPlayer;
|
|
}
|
|
|
|
OUString SAL_CALL QtManager::getImplementationName()
|
|
{
|
|
return u"com.sun.star.comp.media.Manager_Qt"_ustr;
|
|
}
|
|
|
|
sal_Bool SAL_CALL QtManager::supportsService(const OUString& ServiceName)
|
|
{
|
|
return cppu::supportsService(this, ServiceName);
|
|
}
|
|
|
|
css::uno::Sequence<OUString> SAL_CALL QtManager::getSupportedServiceNames()
|
|
{
|
|
return { u"com.sun.star.media.Manager"_ustr };
|
|
}
|
|
|
|
} // namespace
|
|
|
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
|
|
com_sun_star_comp_media_Manager_Qt_get_implementation(css::uno::XComponentContext*,
|
|
css::uno::Sequence<css::uno::Any> const&)
|
|
{
|
|
return cppu::acquire(new avmedia::qt::QtManager());
|
|
}
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|