Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
c8f8e474
Commit
c8f8e474
authored
Dec 07, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xscreensaver: remove unused plugin
xdg-screensaver has higher priority, so xscreensaver was never used.
parent
beec9e78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
173 deletions
+1
-173
modules/LIST
modules/LIST
+0
-1
modules/misc/Modules.am
modules/misc/Modules.am
+1
-5
modules/misc/inhibit/xscreensaver.c
modules/misc/inhibit/xscreensaver.c
+0
-166
po/POTFILES.in
po/POTFILES.in
+0
-1
No files found.
modules/LIST
View file @
c8f8e474
...
...
@@ -383,7 +383,6 @@ $Id$
* xcb_xv: a XVideo video output using XCB
* xdg_screensaver: xdg-utils screensaver inhibition
* xml: LibXML xml parser
* xscreensaver: Xscreensaver inhibition
* yuv: yuv video output
* yuv_rgb_neon: yuv->RGB chroma converter for NEON devices
* yuvp: YUVP to YUVA/RGBA chroma converter
...
...
modules/misc/Modules.am
View file @
c8f8e474
...
...
@@ -32,13 +32,9 @@ endif
libxdg_screensaver_plugin_la_SOURCES = inhibit/xdg.c
libxdg_screensaver_plugin_la_CFLAGS = $(AM_CFLAGS)
libxdg_screensaver_plugin_la_LIBADD = $(AM_LIBADD)
libxscreensaver_plugin_la_SOURCES = inhibit/xscreensaver.c
libxscreensaver_plugin_la_CFLAGS = $(AM_CFLAGS)
libxscreensaver_plugin_la_LIBADD = $(AM_LIBADD)
if HAVE_XCB
libvlc_LTLIBRARIES += \
libxdg_screensaver_plugin.la \
libxscreensaver_plugin.la
libxdg_screensaver_plugin.la
endif
libdbus_screensaver_plugin_la_SOURCES = inhibit/dbus.c
...
...
modules/misc/inhibit/xscreensaver.c
deleted
100644 → 0
View file @
beec9e78
/*****************************************************************************
* xscreensaver.c : disable screen savers when VLC is playing
*****************************************************************************
* Copyright (C) 2006-2009 the VideoLAN team
* $Id$
*
* Authors: Sam Hocevar <sam@zoy.org>
* Benjamin Pracht <bigben AT videolan DOT org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_inhibit.h>
#include <vlc_fs.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <spawn.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
int
Activate
(
vlc_object_t
*
);
static
void
Deactivate
(
vlc_object_t
*
);
static
void
Timer
(
void
*
);
static
void
Inhibit
(
vlc_inhibit_t
*
,
unsigned
);
struct
vlc_inhibit_sys
{
vlc_timer_t
timer
;
posix_spawn_file_actions_t
actions
;
posix_spawnattr_t
attr
;
int
nullfd
;
};
extern
char
**
environ
;
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin
()
set_description
(
N_
(
"X Screensaver disabler"
)
)
set_capability
(
"inhibit"
,
5
)
set_callbacks
(
Activate
,
Deactivate
)
vlc_module_end
()
/*****************************************************************************
* Activate: initialize and create stuff
*****************************************************************************/
static
int
Activate
(
vlc_object_t
*
p_this
)
{
vlc_inhibit_t
*
p_ih
=
(
vlc_inhibit_t
*
)
p_this
;
vlc_inhibit_sys_t
*
p_sys
;
p_sys
=
p_ih
->
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
if
(
vlc_timer_create
(
&
p_sys
->
timer
,
Timer
,
p_ih
)
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
}
p_ih
->
inhibit
=
Inhibit
;
int
fd
=
vlc_open
(
"/dev/null"
,
O_WRONLY
);
posix_spawn_file_actions_init
(
&
p_sys
->
actions
);
if
(
fd
!=
-
1
)
{
posix_spawn_file_actions_adddup2
(
&
p_sys
->
actions
,
fd
,
1
);
posix_spawn_file_actions_adddup2
(
&
p_sys
->
actions
,
fd
,
2
);
posix_spawn_file_actions_addclose
(
&
p_sys
->
actions
,
fd
);
}
p_sys
->
nullfd
=
fd
;
sigset_t
set
;
posix_spawnattr_init
(
&
p_sys
->
attr
);
sigemptyset
(
&
set
);
posix_spawnattr_setsigmask
(
&
p_sys
->
attr
,
&
set
);
return
VLC_SUCCESS
;
}
/*****************************************************************************
* Deactivate: uninitialize and cleanup
*****************************************************************************/
static
void
Deactivate
(
vlc_object_t
*
p_this
)
{
vlc_inhibit_t
*
p_ih
=
(
vlc_inhibit_t
*
)
p_this
;
vlc_inhibit_sys_t
*
p_sys
=
p_ih
->
p_sys
;
vlc_timer_destroy
(
p_sys
->
timer
);
if
(
p_sys
->
nullfd
!=
-
1
)
close
(
p_sys
->
nullfd
);
posix_spawnattr_destroy
(
&
p_sys
->
attr
);
posix_spawn_file_actions_destroy
(
&
p_sys
->
actions
);
free
(
p_sys
);
}
static
void
Inhibit
(
vlc_inhibit_t
*
p_ih
,
unsigned
mask
)
{
bool
suspend
=
(
mask
&
VLC_INHIBIT_DISPLAY
)
!=
0
;
mtime_t
d
=
suspend
?
30
*
CLOCK_FREQ
:
0
;
vlc_timer_schedule
(
p_ih
->
p_sys
->
timer
,
false
,
d
,
d
);
}
/*****************************************************************************
* Execute: Spawns a process using execv()
*****************************************************************************/
static
void
Execute
(
vlc_inhibit_t
*
p_ih
,
const
char
*
const
*
argv
)
{
vlc_inhibit_sys_t
*
p_sys
=
p_ih
->
p_sys
;
pid_t
pid
;
if
(
posix_spawnp
(
&
pid
,
argv
[
0
],
&
p_sys
->
actions
,
&
p_sys
->
attr
,
(
char
**
)
argv
,
environ
)
==
0
)
{
while
(
waitpid
(
pid
,
NULL
,
0
)
!=
pid
);
}
}
/*****************************************************************************
* Run: main thread
*****************************************************************************
* This part of the module is in a separate thread so that we do not have
* too much system() overhead.
*****************************************************************************/
static
void
Timer
(
void
*
data
)
{
vlc_inhibit_t
*
p_ih
=
data
;
/* If there is a playing video output, disable xscreensaver */
/* http://www.jwz.org/xscreensaver/faq.html#dvd */
const
char
*
const
ppsz_xsargs
[]
=
{
"xscreensaver-command"
,
"-deactivate"
,
(
char
*
)
NULL
};
Execute
(
p_ih
,
ppsz_xsargs
);
const
char
*
const
ppsz_gsargs
[]
=
{
"gnome-screensaver-command"
,
"--poke"
,
(
char
*
)
NULL
};
Execute
(
p_ih
,
ppsz_gsargs
);
}
po/POTFILES.in
View file @
c8f8e474
...
...
@@ -948,7 +948,6 @@ modules/misc/gnutls.c
modules/misc/inhibit/dbus.c
modules/misc/inhibit/mce.c
modules/misc/inhibit/xdg.c
modules/misc/inhibit/xscreensaver.c
modules/misc/logger.c
modules/misc/osd/osd_menu.c
modules/misc/osd/osd_menu.h
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment