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

empty caps

parent 7ad6ec0f
...@@ -73,8 +73,9 @@ bool QGstreamerAppSrcPrivate::restart(QVideoFrame &frame) ...@@ -73,8 +73,9 @@ bool QGstreamerAppSrcPrivate::restart(QVideoFrame &frame)
cc << format; cc << format;
GstCaps *caps = QGstUtils::capsForFormats(cc); GstCaps *caps = QGstUtils::capsForFormats(cc);
if (!caps || gst_caps_is_empty(caps)) { if (gst_caps_is_empty(caps)) {
qWarning() << "Could not create caps for" << frame.pixelFormat(); qWarning() << "Could not create caps for" << format;
gst_caps_unref(caps);
return false; return false;
} }
...@@ -138,10 +139,10 @@ void QGstreamerAppSrc::timerEvent(QTimerEvent *event) ...@@ -138,10 +139,10 @@ void QGstreamerAppSrc::timerEvent(QTimerEvent *event)
return; return;
QVideoFrame frame = readFrame(); QVideoFrame frame = readFrame();
if (d->size != frame.size() && !d->restart(frame)) if (!frame.isValid() || (d->size != frame.size() && !d->restart(frame)))
return; return;
if (!frame.isValid() || !frame.map(QAbstractVideoBuffer::ReadOnly)) if (!frame.map(QAbstractVideoBuffer::ReadOnly))
return; return;
auto app_buffer = gst_buffer_new(); 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