我为网络摄像头显示编写了一个示例 QML-qt5 应用程序,给出了一个错误:OS:UBUNTU 13.04 Qt Creator 2.7.1 Based on Qt 5.0.2 (64 bit)
Failed to start video surface due to main thread blocked.
Failed to start video surface
CameraBin error: "Internal data flow error."
PS:这个错误是随机发生的,而且大多数时候;假设 20 次 18-19 次
这是代码:
import QtQuick 2.0
import QtMultimedia 5.0
Item {
width: 320
height: 240
VideoOutput {
id:camOutput
source: camera
anchors.fill: parent
focus : visible // to receive focus and capture key events when visible
}
Camera {
id: camera
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
exposure {
exposureCompensation: -1.0
exposureMode: Camera.ExposurePortrait
}
flash.mode: Camera.FlashRedEyeReduction
imageCapture {
onImageCaptured: {
photoPreview.source = preview // Show the preview in an Image
}
}
}
Image {
id: photoPreview
}
}