mirror of
https://github.com/jojo61/vdr-plugin-softhdcuvid.git
synced 2023-10-10 13:37:41 +02:00
OSD fixes
This commit is contained in:
parent
49db402de6
commit
b9fed82109
@ -1263,6 +1263,7 @@ cOglCmdDrawImage::~cOglCmdDrawImage(void) {
|
|||||||
bool cOglCmdDrawImage::Execute(void) {
|
bool cOglCmdDrawImage::Execute(void) {
|
||||||
GLuint texture;
|
GLuint texture;
|
||||||
#ifdef USE_DRM
|
#ifdef USE_DRM
|
||||||
|
pthread_mutex_lock(&OSDMutex);
|
||||||
GlxDrawopengl(); // here we need the Shared Context for upload
|
GlxDrawopengl(); // here we need the Shared Context for upload
|
||||||
GlxCheck();
|
GlxCheck();
|
||||||
#endif
|
#endif
|
||||||
@ -1287,6 +1288,7 @@ bool cOglCmdDrawImage::Execute(void) {
|
|||||||
#ifdef USE_DRM
|
#ifdef USE_DRM
|
||||||
GlxInitopengl(); // Reset Context
|
GlxInitopengl(); // Reset Context
|
||||||
GlxCheck();
|
GlxCheck();
|
||||||
|
pthread_mutex_unlock(&OSDMutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GLfloat x1 = x; //left
|
GLfloat x1 = x; //left
|
||||||
@ -1378,6 +1380,7 @@ cOglCmdStoreImage::~cOglCmdStoreImage(void) {
|
|||||||
|
|
||||||
bool cOglCmdStoreImage::Execute(void) {
|
bool cOglCmdStoreImage::Execute(void) {
|
||||||
#ifdef USE_DRM
|
#ifdef USE_DRM
|
||||||
|
pthread_mutex_lock(&OSDMutex);
|
||||||
GlxDrawopengl(); // here we need the Shared Context for upload
|
GlxDrawopengl(); // here we need the Shared Context for upload
|
||||||
GlxCheck();
|
GlxCheck();
|
||||||
#endif
|
#endif
|
||||||
@ -1402,6 +1405,7 @@ bool cOglCmdStoreImage::Execute(void) {
|
|||||||
#ifdef USE_DRM
|
#ifdef USE_DRM
|
||||||
GlxInitopengl(); // Reset Context
|
GlxInitopengl(); // Reset Context
|
||||||
GlxCheck();
|
GlxCheck();
|
||||||
|
pthread_mutex_lock(&OSDMutex);
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
30
video.c
30
video.c
@ -2421,6 +2421,9 @@ void createTextureDst(CuvidDecoder * decoder, int anz, unsigned int size_x, unsi
|
|||||||
glXMakeCurrent(XlibDisplay, VideoWindow, glxSharedContext);
|
glXMakeCurrent(XlibDisplay, VideoWindow, glxSharedContext);
|
||||||
GlxCheck();
|
GlxCheck();
|
||||||
#else
|
#else
|
||||||
|
#ifdef USE_DRM
|
||||||
|
pthread_mutex_lock(&OSDMutex);
|
||||||
|
#endif
|
||||||
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, eglSharedContext);
|
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, eglSharedContext);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2467,6 +2470,9 @@ void createTextureDst(CuvidDecoder * decoder, int anz, unsigned int size_x, unsi
|
|||||||
GlxCheck();
|
GlxCheck();
|
||||||
#ifdef VAAPI
|
#ifdef VAAPI
|
||||||
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
|
#ifdef USE_DRM
|
||||||
|
pthread_mutex_unlock(&OSDMutex);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4015,6 +4021,9 @@ static void CuvidDisplayFrame(void)
|
|||||||
memcpy(&target.color, &pl_color_space_monitor, sizeof(struct pl_color_space));
|
memcpy(&target.color, &pl_color_space_monitor, sizeof(struct pl_color_space));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef GAMMA
|
||||||
|
target.color.transfer = PL_COLOR_TRC_LINEAR;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
//
|
//
|
||||||
// Render videos into output
|
// Render videos into output
|
||||||
@ -4288,6 +4297,11 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
|
|||||||
int err = 0;
|
int err = 0;
|
||||||
static uint64_t last_time;
|
static uint64_t last_time;
|
||||||
|
|
||||||
|
#ifdef GAMMA
|
||||||
|
Get_Gamma();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// video_clock = CuvidGetClock(decoder);
|
// video_clock = CuvidGetClock(decoder);
|
||||||
video_clock = decoder->PTS - (90 * 20 * 1); // 1 Frame in Output
|
video_clock = decoder->PTS - (90 * 20 * 1); // 1 Frame in Output
|
||||||
filled = atomic_read(&decoder->SurfacesFilled);
|
filled = atomic_read(&decoder->SurfacesFilled);
|
||||||
@ -4325,7 +4339,7 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder)
|
|||||||
if (!VideoSoftStartSync && decoder->StartCounter < VideoSoftStartFrames && video_clock != (int64_t) AV_NOPTS_VALUE
|
if (!VideoSoftStartSync && decoder->StartCounter < VideoSoftStartFrames && video_clock != (int64_t) AV_NOPTS_VALUE
|
||||||
&& (audio_clock == (int64_t) AV_NOPTS_VALUE || video_clock > audio_clock + VideoAudioDelay + 120 * 90)) {
|
&& (audio_clock == (int64_t) AV_NOPTS_VALUE || video_clock > audio_clock + VideoAudioDelay + 120 * 90)) {
|
||||||
Debug(4, "video: initial slow down video, frame %d\n", decoder->StartCounter);
|
Debug(4, "video: initial slow down video, frame %d\n", decoder->StartCounter);
|
||||||
goto out;
|
goto skip_sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decoder->SyncCounter && decoder->SyncCounter--) {
|
if (decoder->SyncCounter && decoder->SyncCounter--) {
|
||||||
@ -5186,7 +5200,7 @@ void InitPlacebo()
|
|||||||
char xcbext[] = { "VK_KHR_xcb_surface" };
|
char xcbext[] = { "VK_KHR_xcb_surface" };
|
||||||
char surfext[] = { "VK_KHR_surface" };
|
char surfext[] = { "VK_KHR_surface" };
|
||||||
|
|
||||||
Debug(3, "Init Placebo\n");
|
Debug(3, "Init Placebo mit API %d\n",PL_API_VER);
|
||||||
|
|
||||||
p = calloc(1, sizeof(struct priv));
|
p = calloc(1, sizeof(struct priv));
|
||||||
if (!p)
|
if (!p)
|
||||||
@ -5282,7 +5296,7 @@ void delete_decode() {
|
|||||||
static void *VideoDisplayHandlerThread(void *dummy)
|
static void *VideoDisplayHandlerThread(void *dummy)
|
||||||
{
|
{
|
||||||
|
|
||||||
prctl(PR_SET_NAME, "video decode", 0, 0, 0);
|
prctl(PR_SET_NAME, "video decoder", 0, 0, 0);
|
||||||
sleep(2);
|
sleep(2);
|
||||||
pthread_cleanup_push(delete_decode, NULL);
|
pthread_cleanup_push(delete_decode, NULL);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -5299,6 +5313,11 @@ static void *VideoDisplayHandlerThread(void *dummy)
|
|||||||
|
|
||||||
void exit_display()
|
void exit_display()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef GAMMA
|
||||||
|
Exit_Gamma();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PLACEBO
|
#ifdef PLACEBO
|
||||||
Debug(3, "delete placebo\n");
|
Debug(3, "delete placebo\n");
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
@ -5347,6 +5366,11 @@ static void *VideoHandlerThread(void *dummy)
|
|||||||
|
|
||||||
prctl(PR_SET_NAME, "video display", 0, 0, 0);
|
prctl(PR_SET_NAME, "video display", 0, 0, 0);
|
||||||
|
|
||||||
|
#ifdef GAMMA
|
||||||
|
Init_Gamma();
|
||||||
|
Set_Gamma(2.2,6500);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PLACEBO
|
#ifdef PLACEBO
|
||||||
InitPlacebo();
|
InitPlacebo();
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user