equal
deleted
inserted
replaced
71 bool VideoWidgetSurface::isFormatSupported( |
71 bool VideoWidgetSurface::isFormatSupported( |
72 const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const |
72 const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const |
73 { |
73 { |
74 Q_UNUSED(similar); |
74 Q_UNUSED(similar); |
75 |
75 |
76 const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); |
76 const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); |
77 const QSize size = format.frameSize(); |
77 const QSize size = format.frameSize(); |
78 |
78 |
79 return imageFormat != QImage::Format_Invalid |
79 return imageFormat != QImage::Format_Invalid |
80 && !size.isEmpty() |
80 && !size.isEmpty() |
81 && format.handleType() == QAbstractVideoBuffer::NoHandle; |
81 && format.handleType() == QAbstractVideoBuffer::NoHandle; |
83 //! [1] |
83 //! [1] |
84 |
84 |
85 //! [2] |
85 //! [2] |
86 bool VideoWidgetSurface::start(const QVideoSurfaceFormat &format) |
86 bool VideoWidgetSurface::start(const QVideoSurfaceFormat &format) |
87 { |
87 { |
88 const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); |
88 const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); |
89 const QSize size = format.frameSize(); |
89 const QSize size = format.frameSize(); |
90 |
90 |
91 if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) { |
91 if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) { |
92 this->imageFormat = imageFormat; |
92 this->imageFormat = imageFormat; |
93 imageSize = size; |
93 imageSize = size; |