mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +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)
|
QtGLVideoItem::setForceAspectRatio(bool force_aspect_ratio)
|
||||||
{
|
{
|
||||||
this->priv->force_aspect_ratio = !!force_aspect_ratio;
|
this->priv->force_aspect_ratio = !!force_aspect_ratio;
|
||||||
|
|
||||||
|
emit forceAspectRatioChanged(force_aspect_ratio);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -68,6 +68,10 @@ class QtGLVideoItem : public QQuickItem, protected QOpenGLFunctions
|
||||||
Q_PROPERTY(bool itemInitialized
|
Q_PROPERTY(bool itemInitialized
|
||||||
READ itemInitialized
|
READ itemInitialized
|
||||||
NOTIFY itemInitializedChanged)
|
NOTIFY itemInitializedChanged)
|
||||||
|
Q_PROPERTY(bool forceAspectRatio
|
||||||
|
READ getForceAspectRatio
|
||||||
|
WRITE setForceAspectRatio
|
||||||
|
NOTIFY forceAspectRatioChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QtGLVideoItem();
|
QtGLVideoItem();
|
||||||
|
@ -85,6 +89,7 @@ public:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void itemInitializedChanged();
|
void itemInitializedChanged();
|
||||||
|
void forceAspectRatioChanged(bool);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void handleWindowChanged(QQuickWindow * win);
|
void handleWindowChanged(QQuickWindow * win);
|
||||||
|
|
Loading…
Reference in a new issue