diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-01-29 15:32:55 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-02-05 13:12:01 +0000 |
commit | 3058e21af0f36d78e5515cef0fe88969310fa912 (patch) | |
tree | 9c73cda7d109b2bdd1cf2884ef4de60a2fbed203 /src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp | |
parent | 38c6d10bc83dedf9283b7a89d076ea2980de7843 (diff) |
eglfs_kms_vsp2: Add support for setting layer alpha
Exposed through QEglFSFunctions::vsp2SetLayerAlpha.
Change-Id: I2a600971d5a2aa56d4bf7cde03df3323f17249cd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp index 21de052b87..25b0c39050 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qlinuxmediadevice.cpp @@ -533,6 +533,14 @@ bool QLinuxMediaDevice::OutputSubDevice::streamOff() return QLinuxMediaDevice::streamOff(m_subdevFd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE); } +int QLinuxMediaDevice::openVideoDevice(media_pad *pad) +{ + const char *deviceName = media_entity_get_devname(pad->entity); + int fd = open(deviceName, O_RDWR); + qCDebug(qLcEglfsKmsDebug) << "Opened video device:" << deviceName << "with fd" << fd; + return fd; +} + bool QLinuxMediaDevice::setSubdevFormat(struct media_pad *pad, const QSize &size, uint32_t mbusFormat) { Q_ASSERT(size.isValid()); @@ -556,6 +564,18 @@ bool QLinuxMediaDevice::setSubdevFormat(struct media_pad *pad, const QSize &size return true; } +bool QLinuxMediaDevice::setSubdevAlpha(int subdevFd, qreal alpha) +{ + struct v4l2_control control; + control.id = V4L2_CID_ALPHA_COMPONENT; + control.value = static_cast<__s32>(alpha * 0xff); + if (ioctl(subdevFd, VIDIOC_S_CTRL, &control) == -1) { + qErrnoWarning("Setting alpha (%d) failed", control.value); + return false; + } + return true; +} + bool QLinuxMediaDevice::setSubdevSelection(struct media_pad *pad, const QRect &geometry, uint target) { Q_ASSERT(geometry.isValid()); |