1
0
mirror of https://github.com/jojo61/vdr-plugin-softhdcuvid.git synced 2023-10-10 13:37:41 +02:00

more drm DETA/ATTA fixes

This commit is contained in:
jojo61 2020-01-13 18:17:07 +01:00
parent ce3813a9e9
commit 269c396a2c
3 changed files with 24 additions and 2 deletions

3
drm.c
View File

@ -558,6 +558,7 @@ static void drm_clean_up () {
EglCheck();
eglDestroyContext (eglDisplay, eglSharedContext);
EglCheck();
eglSharedContext = NULL;
eglTerminate (eglDisplay);
EglCheck();
@ -565,7 +566,7 @@ static void drm_clean_up () {
gbm_device_destroy (gbm.dev);
drmDropMaster(render->fd_drm);
close (render->fd_drm);
eglDisplay = NULL;
free(render);
}

View File

@ -330,6 +330,7 @@ void cOglGlyph::LoadTexture(FT_BitmapGlyph ftGlyph) {
extern "C" void GlxInitopengl();
extern "C" void GlxDrawopengl();
extern "C" void GlxDestroy();
/****************************************************************************************
* cOglFont
****************************************************************************************/
@ -1733,6 +1734,8 @@ void cOglThread::Cleanup(void) {
cOglFont::Cleanup();
#ifndef USE_DRM
glutExit();
#else
GlxDestroy();
#endif
pthread_mutex_unlock(&OSDMutex);
}

20
video.c
View File

@ -2858,7 +2858,11 @@ static enum AVPixelFormat Cuvid_get_format(CuvidDecoder * decoder, AVCodecContex
#ifdef CUVID
ist->active_hwaccel_id = HWACCEL_CUVID;
#else
ist->filter = 1; // init deint vaapi
if (VideoDeinterlace[decoder->Resolution]) // need deinterlace
ist->filter = 1; // init deint vaapi
else
ist->filter = 0;
ist->active_hwaccel_id = HWACCEL_VAAPI;
#endif
ist->hwaccel_pix_fmt = PIXEL_FORMAT;
@ -6392,11 +6396,19 @@ void VideoSetAbove()
///
void VideoSetDeinterlace(int mode[VideoResolutionMax])
{
#ifdef CUVID
VideoDeinterlace[0] = mode[0]; // 576i
VideoDeinterlace[1] = 1; //mode[1]; // 720p
VideoDeinterlace[2] = mode[2]; // fake 1080
VideoDeinterlace[3] = mode[3]; // 1080
VideoDeinterlace[4] = 1, //mode[4]; 2160p
#else
VideoDeinterlace[0] = 1; // 576i
VideoDeinterlace[1] = 0; //mode[1]; // 720p
VideoDeinterlace[2] = 1; // fake 1080
VideoDeinterlace[3] = 1; // 1080
VideoDeinterlace[4] = 0, //mode[4]; 2160p
#endif
VideoSurfaceModesChanged = 1;
}
@ -6819,5 +6831,11 @@ int GlxDrawopengl () {
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, eglSharedContext);
return;
}
void GlxDestroy() {
eglDestroyContext (eglDisplay, eglOSDContext);
eglOSDContext = NULL;
}
#endif