Browse Source

videonode: Do not finish if material is different

Fix bluerobotics/qgroundcontrol#164

Signed-off-by: Patrick J.P <patrickelectric@gmail.com>
QGC4.4
Patrick J.P 7 years ago
parent
commit
3a18878b62
  1. 8
      src/VideoStreaming/gstqtvideosink/painters/videonode.cpp

8
src/VideoStreaming/gstqtvideosink/painters/videonode.cpp

@ -52,14 +52,18 @@ void VideoNode::setMaterialTypeSolidBlack()
void VideoNode::setCurrentFrame(GstBuffer* buffer) void VideoNode::setCurrentFrame(GstBuffer* buffer)
{ {
Q_ASSERT (m_materialType == MaterialTypeVideo); if (m_materialType != MaterialTypeVideo) {
return;
}
static_cast<VideoMaterial*>(material())->setCurrentFrame(buffer); static_cast<VideoMaterial*>(material())->setCurrentFrame(buffer);
markDirty(DirtyMaterial); markDirty(DirtyMaterial);
} }
void VideoNode::updateColors(int brightness, int contrast, int hue, int saturation) void VideoNode::updateColors(int brightness, int contrast, int hue, int saturation)
{ {
Q_ASSERT (m_materialType == MaterialTypeVideo); if (m_materialType != MaterialTypeVideo) {
return;
}
static_cast<VideoMaterial*>(material())->updateColors(brightness, contrast, hue, saturation); static_cast<VideoMaterial*>(material())->updateColors(brightness, contrast, hue, saturation);
markDirty(DirtyMaterial); markDirty(DirtyMaterial);
} }

Loading…
Cancel
Save