aboutsummaryrefslogtreecommitdiff
path: root/src/encoder/video
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoder/video')
-rw-r--r--src/encoder/video/software.c4
-rw-r--r--src/encoder/video/vaapi.c13
-rw-r--r--src/encoder/video/vulkan.c2
3 files changed, 12 insertions, 7 deletions
diff --git a/src/encoder/video/software.c b/src/encoder/video/software.c
index 3649ff1..627cdea 100644
--- a/src/encoder/video/software.c
+++ b/src/encoder/video/software.c
@@ -83,8 +83,8 @@ static void gsr_video_encoder_software_copy_textures_to_frame(gsr_video_encoder
self->params.egl->glBindTexture(GL_TEXTURE_2D, 0);
// cap_kms->kms.base.egl->eglSwapBuffers(cap_kms->kms.base.egl->egl_display, cap_kms->kms.base.egl->egl_surface);
- self->params.egl->glFlush();
- self->params.egl->glFinish();
+ //self->params.egl->glFlush();
+ //self->params.egl->glFinish();
}
static void gsr_video_encoder_software_get_textures(gsr_video_encoder *encoder, unsigned int *textures, int *num_textures, gsr_destination_color *destination_color) {
diff --git a/src/encoder/video/vaapi.c b/src/encoder/video/vaapi.c
index 8bb2f08..c7ccd26 100644
--- a/src/encoder/video/vaapi.c
+++ b/src/encoder/video/vaapi.c
@@ -92,6 +92,10 @@ static bool gsr_video_encoder_vaapi_setup_textures(gsr_video_encoder_vaapi *self
if(self->prime.fourcc == VA_FOURCC_NV12 || self->prime.fourcc == VA_FOURCC_P010) {
const uint32_t *formats = self->prime.fourcc == VA_FOURCC_NV12 ? formats_nv12 : formats_p010;
const int div[2] = {1, 2}; // divide UV texture size by 2 because chroma is half size
+ const float border_colors[2][4] = {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {0.5f, 0.5f, 0.0f, 1.0f}
+ };
self->params.egl->glGenTextures(2, self->target_textures);
for(int i = 0; i < 2; ++i) {
@@ -121,10 +125,11 @@ static bool gsr_video_encoder_vaapi_setup_textures(gsr_video_encoder_vaapi *self
}
self->params.egl->glBindTexture(GL_TEXTURE_2D, self->target_textures[i]);
- self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
+ self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
+ self->params.egl->glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, border_colors[i]);
+ self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
while(self->params.egl->glGetError()) {}
while(self->params.egl->eglGetError() != EGL_SUCCESS){}
diff --git a/src/encoder/video/vulkan.c b/src/encoder/video/vulkan.c
index 062967b..7210870 100644
--- a/src/encoder/video/vulkan.c
+++ b/src/encoder/video/vulkan.c
@@ -94,7 +94,7 @@ static bool gsr_video_encoder_vulkan_setup_textures(gsr_video_encoder_vulkan *se
//AVVkFrame *target_surface_id = (AVVkFrame*)frame->data[0];
self->vv = video_codec_context_get_vulkan_data(video_codec_context);
- const unsigned int internal_formats_nv12[2] = { GL_RGBA8, GL_RGBA8 };
+ const unsigned int internal_formats_nv12[2] = { GL_RGBA8, GL_RGBA8 }; // TODO: GL_R8, GL_R16
const unsigned int internal_formats_p010[2] = { GL_R16, GL_RG16 };
const unsigned int formats[2] = { GL_RED, GL_RG };
const int div[2] = {1, 2}; // divide UV texture size by 2 because chroma is half size