Commit c924cdc8 authored by Val Doroshchuk's avatar Val Doroshchuk

argb

parent 02361a35
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
void AppSrc::imageReady() void AppSrc::imageReady()
{ {
m_frame = m_grabResult->image(); auto img = m_grabResult->image();
img.reinterpretAsFormat(QImage::Format_ARGB32);
m_frame = img;
m_grabResult.reset(); m_grabResult.reset();
} }
......
...@@ -67,14 +67,10 @@ private: ...@@ -67,14 +67,10 @@ private:
bool QGstreamerAppSrcPrivate::restart(QVideoFrame &frame) bool QGstreamerAppSrcPrivate::restart(QVideoFrame &frame)
{ {
QList<QVideoFrame::PixelFormat> cc; QList<QVideoFrame::PixelFormat> cc;
auto format = frame.pixelFormat(); cc << frame.pixelFormat();
if (format == QVideoFrame::Format_ARGB32_Premultiplied)
format = QVideoFrame::Format_RGB32;
cc << format;
GstCaps *caps = QGstUtils::capsForFormats(cc); GstCaps *caps = QGstUtils::capsForFormats(cc);
if (gst_caps_is_empty(caps)) { if (gst_caps_is_empty(caps)) {
qWarning() << "Could not create caps for" << format; qWarning() << "Could not create caps for" << frame.pixelFormat();
gst_caps_unref(caps); gst_caps_unref(caps);
return false; return false;
} }
......
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