Commit 794c0455 authored by Val Doroshchuk's avatar Val Doroshchuk

empty caps

parent 7ad6ec0f
......@@ -73,8 +73,9 @@ bool QGstreamerAppSrcPrivate::restart(QVideoFrame &frame)
cc << format;
GstCaps *caps = QGstUtils::capsForFormats(cc);
if (!caps || gst_caps_is_empty(caps)) {
qWarning() << "Could not create caps for" << frame.pixelFormat();
if (gst_caps_is_empty(caps)) {
qWarning() << "Could not create caps for" << format;
gst_caps_unref(caps);
return false;
}
......@@ -138,10 +139,10 @@ void QGstreamerAppSrc::timerEvent(QTimerEvent *event)
return;
QVideoFrame frame = readFrame();
if (d->size != frame.size() && !d->restart(frame))
if (!frame.isValid() || (d->size != frame.size() && !d->restart(frame)))
return;
if (!frame.isValid() || !frame.map(QAbstractVideoBuffer::ReadOnly))
if (!frame.map(QAbstractVideoBuffer::ReadOnly))
return;
auto app_buffer = gst_buffer_new();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment