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

34
video.c
View File

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