Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f240f03f
Commit
f240f03f
authored
May 30, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the signals interface
parent
82a5a07b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
134 deletions
+0
-134
modules/control/Modules.am
modules/control/Modules.am
+0
-2
modules/control/signals.c
modules/control/signals.c
+0
-132
No files found.
modules/control/Modules.am
View file @
f240f03f
...
...
@@ -7,7 +7,6 @@ SOURCES_hotkeys = hotkeys.c
SOURCES_lirc = lirc.c
SOURCES_oldrc = rc.c
SOURCES_dbus = dbus.c dbus.h
SOURCES_signals = signals.c
if HAVE_DARWIN
motion_extra = unimotion.c unimotion.h
else
...
...
@@ -27,7 +26,6 @@ libvlc_LTLIBRARIES += \
liboldrc_plugin.la
if !HAVE_WIN32
libvlc_LTLIBRARIES += \
libsignals_plugin.la \
libmotion_plugin.la
else
libvlc_LTLIBRARIES += \
...
...
modules/control/signals.c
deleted
100644 → 0
View file @
82a5a07b
/*****************************************************************************
* signals.c : signals handler module for vlc
*****************************************************************************
* Copyright (C) 2008 Rémi Denis-Courmont
*
* 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <signal.h>
#include <time.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_interface.h>
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
*
SigThread
(
void
*
);
vlc_module_begin
()
set_shortname
(
N_
(
"Signals"
))
set_category
(
CAT_INTERFACE
)
set_subcategory
(
SUBCAT_INTERFACE_CONTROL
)
set_description
(
N_
(
"POSIX signals handling interface"
))
set_capability
(
"interface"
,
0
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
struct
intf_sys_t
{
vlc_thread_t
thread
;
};
static
int
Open
(
vlc_object_t
*
obj
)
{
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
obj
;
intf_sys_t
*
p_sys
=
malloc
(
sizeof
(
*
p_sys
));
if
(
p_sys
==
NULL
)
return
VLC_ENOMEM
;
intf
->
p_sys
=
p_sys
;
if
(
vlc_clone
(
&
p_sys
->
thread
,
SigThread
,
obj
,
VLC_THREAD_PRIORITY_LOW
))
{
free
(
p_sys
);
intf
->
p_sys
=
NULL
;
return
VLC_ENOMEM
;
}
intf
->
pf_run
=
NULL
;
return
0
;
}
static
void
Close
(
vlc_object_t
*
obj
)
{
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
obj
;
intf_sys_t
*
p_sys
=
intf
->
p_sys
;
vlc_cancel
(
p_sys
->
thread
);
#ifdef __APPLE__
/* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
* cancellation point, so we throw a dummy quit signal to end
* sigwait() in the sigth thread */
pthread_kill
(
p_sys
->
thread
,
SIGQUIT
);
# endif
vlc_join
(
p_sys
->
thread
,
NULL
);
free
(
p_sys
);
}
static
bool
ignored
(
int
signum
)
{
struct
sigaction
sa
;
if
(
sigaction
(
signum
,
NULL
,
&
sa
))
return
false
;
return
((
sa
.
sa_flags
&
SA_SIGINFO
)
?
(
void
*
)
sa
.
sa_sigaction
:
(
void
*
)
sa
.
sa_handler
)
==
SIG_IGN
;
}
static
void
*
SigThread
(
void
*
data
)
{
intf_thread_t
*
obj
=
data
;
sigset_t
set
;
int
signum
;
sigemptyset
(
&
set
);
if
(
!
ignored
(
SIGHUP
))
/* <- needed to handle nohup properly */
sigaddset
(
&
set
,
SIGHUP
);
sigaddset
(
&
set
,
SIGINT
);
sigaddset
(
&
set
,
SIGQUIT
);
sigaddset
(
&
set
,
SIGTERM
);
sigaddset
(
&
set
,
SIGCHLD
);
do
{
while
(
sigwait
(
&
set
,
&
signum
));
#ifdef __APPLE__
/* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
* cancellation point */
vlc_testcancel
();
#endif
}
while
(
signum
==
SIGCHLD
);
msg_Err
(
obj
,
"Caught %s signal, exiting..."
,
strsignal
(
signum
));
libvlc_Quit
(
obj
->
p_libvlc
);
/* After 3 seconds, fallback to normal signal handling */
msleep
(
3
*
CLOCK_FREQ
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
NULL
);
for
(;;)
pause
();
}
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