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

Fix indentation.

This commit is contained in:
Dirk Nehring 2019-11-18 13:01:19 +01:00
parent 695a6495dd
commit 1a56d620ac
4 changed files with 413 additions and 411 deletions

View File

@ -217,12 +217,12 @@ class cSoftRemote:public cRemote, private cThread
**
** @param name remote name
*/
cSoftRemote(void) : cRemote("XKeySym")
cSoftRemote(void):cRemote("XKeySym")
{
Start();
}
virtual ~cSoftRemote()
virtual ~ cSoftRemote()
{
Cancel(3);
}
@ -232,8 +232,10 @@ class cSoftRemote:public cRemote, private cThread
**
** @param code key code
*/
void Receive(const char *code) {
void Receive(const char *code)
{
cMutexLock MutexLock(&mutex);
Command = code;
keyReceived.Broadcast();
}
@ -251,48 +253,44 @@ void cSoftRemote::Action(void)
while (Running()) {
cMutexLock MutexLock(&mutex);
if (keyReceived.TimedWait(mutex, Setup.RcRepeatDelta * 3 / 2) && **Command) {
if (strcmp(Command, LastCommand) == 0) {
// If two keyboard events with the same command come in without an intermediate
// timeout, this is a long key press that caused the repeat function to kick in:
Delayed = false;
FirstCommand = "";
if (FirstTime.Elapsed() < (uint)Setup.RcRepeatDelay)
if (FirstTime.Elapsed() < (uint) Setup.RcRepeatDelay)
continue; // repeat function kicks in after a short delay
if (LastTime.Elapsed() < (uint)Setup.RcRepeatDelta)
if (LastTime.Elapsed() < (uint) Setup.RcRepeatDelta)
continue; // skip same keys coming in too fast
cRemote::Put(Command, true);
Repeat = true;
LastTime.Set();
}
else if (strcmp(Command, FirstCommand) == 0) {
} else if (strcmp(Command, FirstCommand) == 0) {
// If the same command comes in twice with an intermediate timeout, we
// need to delay the second command to see whether it is going to be
// a repeat function or a separate key press:
Delayed = true;
}
else {
} else {
// This is a totally new key press, so we accept it immediately:
cRemote::Put(Command);
Delayed = false;
FirstCommand = Command;
FirstTime.Set();
}
}
else if (Repeat) {
} else if (Repeat) {
// Timeout after a repeat function, so we generate a 'release':
cRemote::Put(LastCommand, false, true);
Repeat = false;
}
else if (Delayed && *FirstCommand) {
} else if (Delayed && *FirstCommand) {
// Timeout after two normal key presses of the same key, so accept the
// delayed key:
cRemote::Put(FirstCommand);
Delayed = false;
FirstCommand = "";
FirstTime.Set();
}
else if (**FirstCommand && FirstTime.Elapsed() > (uint)Setup.RcRepeatDelay) {
} else if (**FirstCommand && FirstTime.Elapsed() > (uint) Setup.RcRepeatDelay) {
Delayed = false;
FirstCommand = "";
FirstTime.Set();
@ -303,6 +301,7 @@ void cSoftRemote::Action(void)
}
static cSoftRemote *csoft = NULL;
/**
** Feed key press as remote input (called from C part).
**
@ -3145,6 +3144,7 @@ void cPluginSoftHdDevice::Stop(void)
::Stop();
delete csoft;
csoft = NULL;
}

34
video.c
View File

@ -2855,11 +2855,12 @@ int get_RGB(CuvidDecoder * decoder)
glActiveTexture(GL_TEXTURE0);
if (OsdShown && decoder->grab == 2) {
int x,y,h,w;
int x, y, h, w;
GLint texLoc;
if (OsdShown == 1) {
if (OSDtexture)
glDeleteTextures(1,&OSDtexture);
glDeleteTextures(1, &OSDtexture);
pthread_mutex_lock(&OSDMutex);
glGenTextures(1, &OSDtexture);
glBindTexture(GL_TEXTURE_2D, OSDtexture);
@ -2872,11 +2873,11 @@ int get_RGB(CuvidDecoder * decoder)
OsdShown = 2;
}
y = OSDy*height/VideoWindowHeight;
x = OSDx*width/VideoWindowWidth;
h = OSDysize*height/VideoWindowHeight;
w = OSDxsize*width/VideoWindowWidth;
glViewport(x,(height - h - y) , w, h);
y = OSDy * height / VideoWindowHeight;
x = OSDx * width / VideoWindowWidth;
h = OSDysize * height / VideoWindowHeight;
w = OSDxsize * width / VideoWindowWidth;
glViewport(x, (height - h - y), w, h);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@ -3645,7 +3646,7 @@ void make_osd_overlay(int x, int y, int width, int height)
}
// make texture for OSD
if (pl->plane.texture == NULL ) {
if (pl->plane.texture == NULL) {
pl->plane.texture = pl_tex_create(p->gpu, &(struct pl_tex_params) {
.w = width,
.h = height,
@ -3878,11 +3879,12 @@ static void CuvidDisplayFrame(void)
if (OsdShown && valid_frame) {
GLint texLoc;
int x,y,w,h;
int x, y, w, h;
glBindTexture(GL_TEXTURE_2D, 0);
if (OsdShown == 1) {
if (OSDtexture)
glDeleteTextures(1,&OSDtexture);
glDeleteTextures(1, &OSDtexture);
pthread_mutex_lock(&OSDMutex);
glGenTextures(1, &OSDtexture);
glBindTexture(GL_TEXTURE_2D, OSDtexture);
@ -3901,11 +3903,11 @@ static void CuvidDisplayFrame(void)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GlxCheck();
y = OSDy*VideoWindowHeight/OsdHeight;
x = OSDx*VideoWindowWidth/OsdWidth;
h = OSDysize*VideoWindowHeight/OsdHeight;
w = OSDxsize*VideoWindowWidth/OsdWidth;
glViewport(x,(VideoWindowHeight - h - y) , w, h);
y = OSDy * VideoWindowHeight / OsdHeight;
x = OSDx * VideoWindowWidth / OsdWidth;
h = OSDysize * VideoWindowHeight / OsdHeight;
w = OSDxsize * VideoWindowWidth / OsdWidth;
glViewport(x, (VideoWindowHeight - h - y), w, h);
if (gl_prog_osd == 0)
gl_prog_osd = sc_generate_osd(gl_prog_osd); // generate shader programm
@ -5218,7 +5220,7 @@ static void VideoThreadExit(void)
#ifndef PLACEBO
if (OSDtexture)
glDeleteTextures(1,&OSDtexture);
glDeleteTextures(1, &OSDtexture);
if (gl_prog_osd) {
glDeleteProgram(gl_prog_osd);
gl_prog_osd = 0;