mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
qmlglsink: allow to set force-aspect-ratio property
Add the forceAspectRatio Q_PROPERTY to allow changing the aspect ratio from QML code as well. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/937>
This commit is contained in:
parent
63c1e2ed60
commit
8e8dab7a4d
2 changed files with 7 additions and 0 deletions
|
@ -184,6 +184,8 @@ void
|
|||
QtGLVideoItem::setForceAspectRatio(bool force_aspect_ratio)
|
||||
{
|
||||
this->priv->force_aspect_ratio = !!force_aspect_ratio;
|
||||
|
||||
emit forceAspectRatioChanged(force_aspect_ratio);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -68,6 +68,10 @@ class QtGLVideoItem : public QQuickItem, protected QOpenGLFunctions
|
|||
Q_PROPERTY(bool itemInitialized
|
||||
READ itemInitialized
|
||||
NOTIFY itemInitializedChanged)
|
||||
Q_PROPERTY(bool forceAspectRatio
|
||||
READ getForceAspectRatio
|
||||
WRITE setForceAspectRatio
|
||||
NOTIFY forceAspectRatioChanged)
|
||||
|
||||
public:
|
||||
QtGLVideoItem();
|
||||
|
@ -85,6 +89,7 @@ public:
|
|||
|
||||
Q_SIGNALS:
|
||||
void itemInitializedChanged();
|
||||
void forceAspectRatioChanged(bool);
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleWindowChanged(QQuickWindow * win);
|
||||
|
|
Loading…
Reference in a new issue