equal
deleted
inserted
replaced
102 } |
102 } |
103 |
103 |
104 bool VideoItem::start(const QVideoSurfaceFormat &format) |
104 bool VideoItem::start(const QVideoSurfaceFormat &format) |
105 { |
105 { |
106 if (isFormatSupported(format)) { |
106 if (isFormatSupported(format)) { |
107 imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); |
107 imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); |
108 imageSize = format.frameSize(); |
108 imageSize = format.frameSize(); |
109 framePainted = true; |
109 framePainted = true; |
110 |
110 |
111 QAbstractVideoSurface::start(format); |
111 QAbstractVideoSurface::start(format); |
112 |
112 |
127 } |
127 } |
128 |
128 |
129 bool VideoItem::present(const QVideoFrame &frame) |
129 bool VideoItem::present(const QVideoFrame &frame) |
130 { |
130 { |
131 if (!framePainted) { |
131 if (!framePainted) { |
132 if (!isStarted()) |
132 if (!QAbstractVideoSurface::isActive()) |
133 setError(StoppedError); |
133 setError(StoppedError); |
134 |
134 |
135 return false; |
135 return false; |
136 } else { |
136 } else { |
137 currentFrame = frame; |
137 currentFrame = frame; |