| 606 | } |
| 607 | |
| 608 | std::unique_ptr<platf::avcodec_encode_device_t> make_avcodec_encode_device(int width, int height, file_t &&card, int offset_x, int offset_y, bool vram) { |
| 609 | if (vram) { |
| 610 | auto egl = std::make_unique<va::va_vram_t>(); |
| 611 | if (egl->init(width, height, std::move(card), offset_x, offset_y)) { |
| 612 | return nullptr; |
| 613 | } |
| 614 | |
| 615 | return egl; |
| 616 | } |
| 617 | |
| 618 | else { |
| 619 | auto egl = std::make_unique<va::va_ram_t>(); |
| 620 | if (egl->init(width, height, std::move(card))) { |
| 621 | return nullptr; |
| 622 | } |
| 623 | |
| 624 | return egl; |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | std::unique_ptr<platf::avcodec_encode_device_t> make_avcodec_encode_device(int width, int height, int offset_x, int offset_y, bool vram) { |
| 629 | auto render_device = config::video.adapter_name.empty() ? "/dev/dri/renderD128" : config::video.adapter_name.c_str(); |