improved render channel count system

This commit is contained in:
itsmattkc
2020-11-15 22:16:40 +11:00
parent ee5307336e
commit 0d0766e4fb
83 changed files with 1017 additions and 1132 deletions
+13 -6
View File
@@ -67,11 +67,15 @@ void RenderProcessor::Run()
frame_params.set_height(frame_size.height());
}
PixelFormat::Format frame_format = static_cast<PixelFormat::Format>(ticket_->property("format").toInt());
if (frame_format != PixelFormat::PIX_FMT_INVALID) {
VideoParams::Format frame_format = static_cast<VideoParams::Format>(ticket_->property("format").toInt());
if (frame_format != VideoParams::kFormatInvalid) {
frame_params.set_format(frame_format);
}
if (texture) {
frame_params.set_channel_count(texture->channel_count());
}
FramePtr frame = Frame::Create();
frame->set_timestamp(time);
frame->set_video_params(frame_params);
@@ -448,9 +452,14 @@ QVariant RenderProcessor::ProcessFrameGeneration(const Node *node, const Generat
{
FramePtr frame = Frame::Create();
const VideoParams& video_params = ticket_->property("vparam").value<VideoParams>();
VideoParams frame_params = ticket_->property("vparam").value<VideoParams>();
if (job.GetAlphaChannelRequired()) {
frame_params.set_channel_count(VideoParams::kRGBAChannelCount);
} else {
frame_params.set_channel_count(VideoParams::kRGBChannelCount);
}
frame->set_video_params(video_params);
frame->set_video_params(frame_params);
frame->allocate();
node->GenerateFrame(frame, job);
@@ -459,8 +468,6 @@ QVariant RenderProcessor::ProcessFrameGeneration(const Node *node, const Generat
frame->data(),
frame->linesize_pixels());
texture->set_has_meaningful_alpha(job.GetAlphaChannelRequired());
return QVariant::fromValue(texture);
}