office-gobmx/avmedia/CustomTarget_avmediaqt6_moc.mk
Michael Weghorn f04e711ea3 tdf#145735 qt avmedia: Implement frame grabber
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>
2024-05-31 09:24:01 +02:00

25 lines
945 B
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_CustomTarget_CustomTarget,avmedia/source/qt6))
$(call gb_CustomTarget_get_target,avmedia/source/qt6) : \
$(gb_CustomTarget_workdir)/avmedia/source/qt6/QtFrameGrabber.moc \
$(gb_CustomTarget_workdir)/avmedia/source/qt6/QtPlayer.moc
$(gb_CustomTarget_workdir)/avmedia/source/qt6/%.moc : \
$(SRCDIR)/avmedia/source/qt6/%.hxx \
| $(gb_CustomTarget_workdir)/avmedia/source/qt6/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1)
$(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),MOC)
$(MOC6) $< -o $@
$(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),MOC)
# vim: set noet sw=4: