Fix blank video for vaapi

This commit is contained in:
Loki
2021-08-28 17:48:28 +02:00
parent 00de30d336
commit 39f9506446
3 changed files with 8 additions and 6 deletions
+3 -1
View File
@@ -640,7 +640,9 @@ std::optional<sws_t> sws_t::make(int in_width, int in_height, int out_width, int
} }
void sws_t::load_ram(platf::img_t &img) { void sws_t::load_ram(platf::img_t &img) {
gl::ctx.BindTexture(GL_TEXTURE_2D, tex[0]); loaded_texture = tex[0];
gl::ctx.BindTexture(GL_TEXTURE_2D, loaded_texture);
gl::ctx.TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, img.width, img.height, GL_BGRA, GL_UNSIGNED_BYTE, img.data); gl::ctx.TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, img.width, img.height, GL_BGRA, GL_UNSIGNED_BYTE, img.data);
} }
+4 -3
View File
@@ -12,9 +12,10 @@
#include "sunshine/platform/common.h" #include "sunshine/platform/common.h"
#include "sunshine/utility.h" #include "sunshine/utility.h"
#define SUNSHINE_STRINGIFY(x) #x #define SUNSHINE_STRINGIFY_HELPER(x) #x
#define gl_drain_errors_helper(x) gl::drain_errors("line " SUNSHINE_STRINGIFY(x)) #define SUNSHINE_STRINGIFY(x) SUNSHINE_STRINGIFY_HELPER(x)
#define gl_drain_errors gl_drain_errors_helper(__LINE__) #define gl_drain_errors_helper(x) gl::drain_errors(x)
#define gl_drain_errors gl_drain_errors_helper(__FILE__ ":" SUNSHINE_STRINGIFY(__LINE__))
extern "C" int close(int __fd); extern "C" int close(int __fd);
+1 -2
View File
@@ -452,7 +452,7 @@ public:
fb_fd.el, fb_fd.el,
img_width, img_width,
img_height, img_height,
0, offset,
pitch, pitch,
}); });
@@ -530,7 +530,6 @@ public:
} }
int dummy_img(platf::img_t *img) override { int dummy_img(platf::img_t *img) override {
snapshot(img, 1s, false);
return 0; return 0;
} }