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
405da960
Commit
405da960
authored
Nov 30, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inhibit: add separate flags for audio and video
parent
273641ac
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
13 deletions
+25
-13
include/vlc_inhibit.h
include/vlc_inhibit.h
+15
-1
modules/misc/inhibit/mce.c
modules/misc/inhibit/mce.c
+3
-2
modules/misc/inhibit/xdg.c
modules/misc/inhibit/xdg.c
+2
-1
modules/misc/inhibit/xscreensaver.c
modules/misc/inhibit/xscreensaver.c
+3
-2
src/video_output/inhibit.h
src/video_output/inhibit.h
+0
-5
src/video_output/window.c
src/video_output/window.c
+2
-2
No files found.
include/vlc_inhibit.h
View file @
405da960
...
@@ -29,12 +29,26 @@
...
@@ -29,12 +29,26 @@
typedef
struct
vlc_inhibit
vlc_inhibit_t
;
typedef
struct
vlc_inhibit
vlc_inhibit_t
;
typedef
struct
vlc_inhibit_sys
vlc_inhibit_sys_t
;
typedef
struct
vlc_inhibit_sys
vlc_inhibit_sys_t
;
enum
vlc_inhibit_flags
{
VLC_INHIBIT_NONE
=
0
/*< No inhibition */
,
VLC_INHIBIT_SUSPEND
=
0x1
/*< Processor is in use - do not suspend */
,
VLC_INHIBIT_DISPLAY
=
0x2
/*< Display is in use - do not blank/lock */
,
#define VLC_INHIBIT_AUDIO (VLC_INHIBIT_SUSPEND)
#define VLC_INHIBIT_VIDEO (VLC_INHIBIT_SUSPEND|VLC_INHIBIT_DISPLAY)
};
struct
vlc_inhibit
struct
vlc_inhibit
{
{
VLC_COMMON_MEMBERS
VLC_COMMON_MEMBERS
vlc_inhibit_sys_t
*
p_sys
;
vlc_inhibit_sys_t
*
p_sys
;
void
(
*
inhibit
)
(
vlc_inhibit_t
*
,
bool
);
void
(
*
inhibit
)
(
vlc_inhibit_t
*
,
unsigned
flags
);
};
};
static
inline
void
vlc_inhibit_Set
(
vlc_inhibit_t
*
ih
,
unsigned
flags
)
{
ih
->
inhibit
(
ih
,
flags
);
}
#endif
#endif
modules/misc/inhibit/mce.c
View file @
405da960
...
@@ -44,7 +44,7 @@ vlc_module_begin ()
...
@@ -44,7 +44,7 @@ vlc_module_begin ()
set_callbacks
(
Open
,
Close
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
vlc_module_end
()
static
void
Inhibit
(
vlc_inhibit_t
*
,
bool
);
static
void
Inhibit
(
vlc_inhibit_t
*
,
unsigned
);
static
void
Timer
(
void
*
data
);
static
void
Timer
(
void
*
data
);
struct
vlc_inhibit_sys
struct
vlc_inhibit_sys
...
@@ -97,9 +97,10 @@ static void Close (vlc_object_t *obj)
...
@@ -97,9 +97,10 @@ static void Close (vlc_object_t *obj)
free
(
sys
);
free
(
sys
);
}
}
static
void
Inhibit
(
vlc_inhibit_t
*
ih
,
bool
unblank
)
static
void
Inhibit
(
vlc_inhibit_t
*
ih
,
unsigned
flags
)
{
{
vlc_inhibit_sys_t
*
sys
=
ih
->
p_sys
;
vlc_inhibit_sys_t
*
sys
=
ih
->
p_sys
;
bool
unblank
=
(
flags
&
VLC_INHIBIT_DISPLAY
)
!=
0
;
/* The shortest blanking interval is 10s on N900, 15s on N9 */
/* The shortest blanking interval is 10s on N900, 15s on N9 */
const
mtime_t
interval
=
9
*
CLOCK_FREQ
;
const
mtime_t
interval
=
9
*
CLOCK_FREQ
;
...
...
modules/misc/inhibit/xdg.c
View file @
405da960
...
@@ -75,9 +75,10 @@ static void Timer (void *data)
...
@@ -75,9 +75,10 @@ static void Timer (void *data)
}
}
}
}
static
void
Inhibit
(
vlc_inhibit_t
*
ih
,
bool
suspend
)
static
void
Inhibit
(
vlc_inhibit_t
*
ih
,
unsigned
mask
)
{
{
vlc_inhibit_sys_t
*
sys
=
ih
->
p_sys
;
vlc_inhibit_sys_t
*
sys
=
ih
->
p_sys
;
bool
suspend
=
(
mask
&
VLC_INHIBIT_DISPLAY
)
!=
0
;
mtime_t
delay
=
suspend
?
30
*
CLOCK_FREQ
:
INT64_C
(
0
);
mtime_t
delay
=
suspend
?
30
*
CLOCK_FREQ
:
INT64_C
(
0
);
vlc_timer_schedule
(
sys
->
timer
,
false
,
delay
,
delay
);
vlc_timer_schedule
(
sys
->
timer
,
false
,
delay
,
delay
);
...
...
modules/misc/inhibit/xscreensaver.c
View file @
405da960
...
@@ -48,7 +48,7 @@ static int Activate ( vlc_object_t * );
...
@@ -48,7 +48,7 @@ static int Activate ( vlc_object_t * );
static
void
Deactivate
(
vlc_object_t
*
);
static
void
Deactivate
(
vlc_object_t
*
);
static
void
Timer
(
void
*
);
static
void
Timer
(
void
*
);
static
void
Inhibit
(
vlc_inhibit_t
*
,
bool
);
static
void
Inhibit
(
vlc_inhibit_t
*
,
unsigned
);
struct
vlc_inhibit_sys
struct
vlc_inhibit_sys
{
{
...
@@ -122,8 +122,9 @@ static void Deactivate( vlc_object_t *p_this )
...
@@ -122,8 +122,9 @@ static void Deactivate( vlc_object_t *p_this )
free
(
p_sys
);
free
(
p_sys
);
}
}
static
void
Inhibit
(
vlc_inhibit_t
*
p_ih
,
bool
suspend
)
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
;
mtime_t
d
=
suspend
?
30
*
CLOCK_FREQ
:
0
;
vlc_timer_schedule
(
p_ih
->
p_sys
->
timer
,
false
,
d
,
d
);
vlc_timer_schedule
(
p_ih
->
p_sys
->
timer
,
false
,
d
,
d
);
}
}
...
...
src/video_output/inhibit.h
View file @
405da960
...
@@ -25,9 +25,4 @@
...
@@ -25,9 +25,4 @@
vlc_inhibit_t
*
vlc_inhibit_Create
(
vlc_object_t
*
);
vlc_inhibit_t
*
vlc_inhibit_Create
(
vlc_object_t
*
);
void
vlc_inhibit_Destroy
(
vlc_inhibit_t
*
);
void
vlc_inhibit_Destroy
(
vlc_inhibit_t
*
);
static
inline
void
vlc_inhibit_Set
(
vlc_inhibit_t
*
ih
,
bool
suspend
)
{
ih
->
inhibit
(
ih
,
suspend
);
}
#endif
#endif
src/video_output/window.c
View file @
405da960
...
@@ -97,7 +97,7 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
...
@@ -97,7 +97,7 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
cfg
->
type
==
VOUT_WINDOW_TYPE_XID
)
{
cfg
->
type
==
VOUT_WINDOW_TYPE_XID
)
{
w
->
inhibit
=
vlc_inhibit_Create
(
VLC_OBJECT
(
window
));
w
->
inhibit
=
vlc_inhibit_Create
(
VLC_OBJECT
(
window
));
if
(
w
->
inhibit
!=
NULL
)
if
(
w
->
inhibit
!=
NULL
)
vlc_inhibit_Set
(
w
->
inhibit
,
true
);
vlc_inhibit_Set
(
w
->
inhibit
,
VLC_INHIBIT_VIDEO
);
/* FIXME: ^ wait for vout activation, pause */
/* FIXME: ^ wait for vout activation, pause */
}
}
else
else
...
@@ -121,7 +121,7 @@ void vout_window_Delete(vout_window_t *window)
...
@@ -121,7 +121,7 @@ void vout_window_Delete(vout_window_t *window)
window_t
*
w
=
(
window_t
*
)
window
;
window_t
*
w
=
(
window_t
*
)
window
;
if
(
w
->
inhibit
)
if
(
w
->
inhibit
)
{
{
vlc_inhibit_Set
(
w
->
inhibit
,
false
);
vlc_inhibit_Set
(
w
->
inhibit
,
VLC_INHIBIT_NONE
);
vlc_inhibit_Destroy
(
w
->
inhibit
);
vlc_inhibit_Destroy
(
w
->
inhibit
);
}
}
...
...
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