diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-10-22 14:29:44 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-01-05 16:05:47 +0100 |
commit | 8c9676fb0bb145704b7e8bdaf7832c03f14b47de (patch) | |
tree | 427519b54a43ab063531c9a7d3d1f8181e9ca0de /src/multimediawidgets/qvideowidget_p.h | |
parent | e530c303d8d9164888f8d6e1a935b81cda8bf426 (diff) |
Expose video surfaces in rendering components
* Currently QVideoWidget, QGraphicsVideoItem and QML Video Output
tightly depend on QMediaPlayer, QMediaService etc.
Since QMediaService is deprecated and will be removed from Qt6,
its usage must be removed from rendering components.
* Also it is a part of a task to make all components independent,
e.g. without dependencies to another components, like the media player,
or video producer.
These video consumer components should be reusable without QMediaPlayer too,
which today is not possible,
and should have responsibility for a single part of the functionality.
* It is a part of a task to allow users to decide how to render video,
using either video surface or native windows.
Introducing
QVideoWidget::videoSurface()
QGraphicsVideoItem::videoSurface()
QDeclarativeVideoOutput::videoSurface()
that create a surface, if necessary, and returns the underlying video surface
which provides a possibility to render video frames without knowledge of any services and controls.
Can be used like:
QMediaPlayer->setVideoOutput(QVideoWidget->videoSurface());
or
QMediaPlayer->setVideoOutput(QGraphicsVideoItem->videoSurface());
This allows QMediaPlayer to get video frames from a backend,
without using QVideoWidget/QGraphicsVideoItem, and to present these frames to provided surface.
Moreover, now it is possible to render video frames without QMediaPlayer:
QVideoSurfaceFormat format(img.size(), QVideoFrame::Format_ARGB32);
videoWidget->videoSurface()->start(format);
videoWidget->videoSurface()->present(img);
[ChangeLog] Introduced videoSurface property to QVideoWidget, QGraphicsVideoItem and
QDeclarativeVideoOutput.
Task-number: QTBUG-80431
Change-Id: I49641750537160832e29c297279e72b8288e974c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/multimediawidgets/qvideowidget_p.h')
-rw-r--r-- | src/multimediawidgets/qvideowidget_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/multimediawidgets/qvideowidget_p.h b/src/multimediawidgets/qvideowidget_p.h index 07912ee90..1db91f3f9 100644 --- a/src/multimediawidgets/qvideowidget_p.h +++ b/src/multimediawidgets/qvideowidget_p.h @@ -131,6 +131,8 @@ public: QRendererVideoWidgetBackend(QMediaService *service, QVideoRendererControl *control, QWidget *widget); ~QRendererVideoWidgetBackend(); + QAbstractVideoSurface *videoSurface() const; + void releaseControl(); void clearSurface(); |