Omit single copy of frame with VAAPI if possible

This commit is contained in:
Loki 2021-08-26 23:59:32 +02:00
commit 00de30d336
5 changed files with 42 additions and 39 deletions

View file

@ -417,8 +417,6 @@ public:
if(descriptor.sequence > sequence) {
sequence = descriptor.sequence;
framebuffer.bind(nullptr, nullptr);
auto rgb_opt = egl::import_source(display.get(),
{
descriptor.fds[0],
@ -433,11 +431,9 @@ public:
}
rgb = std::move(*rgb_opt);
framebuffer.bind(std::begin(rgb->tex), std::end(rgb->tex));
}
sws.load_vram(descriptor, offset_x, offset_y, framebuffer[0]);
sws.load_vram(descriptor, offset_x, offset_y, rgb->tex[0]);
sws.convert(nv12);
return 0;
@ -448,8 +444,6 @@ public:
return -1;
}
framebuffer = gl::frame_buf_t::make(1);
sequence = 0;
this->offset_x = offset_x;
@ -460,7 +454,6 @@ public:
std::uint64_t sequence;
egl::rgb_t rgb;
gl::frame_buf_t framebuffer;
int offset_x, offset_y;
};