X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fpbo_frame_allocator.cpp;h=d7204f283927426b18e6c831174dd101c8dd5d6a;hb=8850f9468d6a1727e7be302d2a9b4360f69210cc;hp=ba5322602a47e4f0903fda950a96e597bd6c5660;hpb=2f8f882defb23abe8b2c54e195b72c57fba55cd6;p=nageru diff --git a/nageru/pbo_frame_allocator.cpp b/nageru/pbo_frame_allocator.cpp index ba53226..d7204f2 100644 --- a/nageru/pbo_frame_allocator.cpp +++ b/nageru/pbo_frame_allocator.cpp @@ -10,7 +10,7 @@ #include "flags.h" #include "mjpeg_encoder.h" #include "v210_converter.h" -#include "va_display_with_cleanup.h" +#include "shared/va_display.h" using namespace std; @@ -236,7 +236,7 @@ void PBOFrameAllocator::destroy_frame(Frame *frame) check_error(); glDeleteBuffers(1, &pbo); check_error(); - switch (pixel_format) { + switch (ud->pixel_format) { case bmusb::PixelFormat_10BitYCbCr: glDeleteTextures(2, ud->tex_v210); check_error(); @@ -328,8 +328,8 @@ bmusb::FrameAllocator::Frame PBOFrameAllocator::create_frame(size_t width, size_ mjpeg_encoder->should_encode_mjpeg_for_card(card_index)) { if (mjpeg_encoder->using_vaapi()) { VADisplay va_dpy = mjpeg_encoder->va_dpy->va_dpy; - MJPEGEncoder::VAResources resources = mjpeg_encoder->get_va_resources(width, height, VA_FOURCC_UYVY); // Only used by DeckLinkCapture, so always 4:2:2. - MJPEGEncoder::ReleaseVAResources release(mjpeg_encoder, resources); + VAResourcePool::VAResources resources = mjpeg_encoder->get_va_pool()->get_va_resources(width, height, VA_FOURCC_UYVY); // Only used by DeckLinkCapture, so always 4:2:2. + ReleaseVAResources release(mjpeg_encoder->get_va_pool(), resources); if (resources.image.pitches[0] == stride) { userdata->va_resources = move(resources); @@ -393,8 +393,8 @@ void PBOFrameAllocator::release_frame(Frame frame) { // In case we never got to upload the frame to MJPEGEncoder. Userdata *userdata = (Userdata *)frame.userdata; - MJPEGEncoder::VAResources resources __attribute__((unused)) = move(userdata->va_resources); - MJPEGEncoder::ReleaseVAResources release = move(userdata->va_resources_release); + VAResourcePool::VAResources resources __attribute__((unused)) = move(userdata->va_resources); + ReleaseVAResources release = move(userdata->va_resources_release); if (frame.data_copy != nullptr && userdata->data_copy_current_src == Userdata::FROM_VA_API) { VADisplay va_dpy = mjpeg_encoder->va_dpy->va_dpy;