Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
616df9fe
Commit
616df9fe
authored
Mar 24, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gestures: Defines p_intf->change_lock rules, and apply them.
parent
ae17ca1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
modules/control/gestures.c
modules/control/gestures.c
+17
-9
No files found.
modules/control/gestures.c
View file @
616df9fe
...
...
@@ -214,9 +214,6 @@ static void RunIntf( intf_thread_t *p_intf )
p_intf
->
p_sys
->
b_got_gesture
=
VLC_FALSE
;
}
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
/*
* video output
*/
...
...
@@ -243,6 +240,8 @@ static void RunIntf( intf_thread_t *p_intf )
}
}
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
/* Wait a bit */
msleep
(
INTF_IDLE_SLEEP
);
}
...
...
@@ -259,16 +258,19 @@ static int InitThread( intf_thread_t * p_intf )
/* we might need some locking here */
if
(
!
intf_ShouldDie
(
p_intf
)
)
{
input_thread_t
*
p_input
;
/* p_intf->change_lock locking strategy:
* - Every access to p_intf->p_sys are locked threw p_intf->change_lock
* - make sure there won't be cross increment/decrement ref count
* of p_intf->p_sys members p_intf->change_lock should be locked
* during those operations */
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
/* p_intf->p_sys->p_input references counting strategy:
* - InitThread is responsible for only one ref count retaining
* - EndThread is responsible for the corresponding release */
p_input
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
p_intf
->
p_sys
->
p_input
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
p_intf
->
p_sys
->
p_input
=
p_input
;
p_intf
->
p_sys
->
b_got_gesture
=
VLC_FALSE
;
p_intf
->
p_sys
->
b_button_pressed
=
VLC_FALSE
;
p_intf
->
p_sys
->
i_threshold
=
...
...
@@ -304,6 +306,8 @@ static int InitThread( intf_thread_t * p_intf )
*****************************************************************************/
static
void
EndThread
(
intf_thread_t
*
p_intf
)
{
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
if
(
p_intf
->
p_sys
->
p_vout
)
{
var_DelCallback
(
p_intf
->
p_sys
->
p_vout
,
"mouse-moved"
,
...
...
@@ -317,6 +321,8 @@ static void EndThread( intf_thread_t * p_intf )
{
vlc_object_release
(
p_intf
->
p_sys
->
p_input
);
}
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
}
/*****************************************************************************
...
...
@@ -331,13 +337,15 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
signed
int
i_horizontal
,
i_vertical
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_data
;
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
/* don't process new gestures before the last events are processed */
if
(
p_intf
->
p_sys
->
b_got_gesture
)
{
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
return
VLC_SUCCESS
;
}
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
if
(
!
strcmp
(
psz_var
,
"mouse-moved"
)
&&
p_intf
->
p_sys
->
b_button_pressed
)
{
var_Get
(
p_intf
->
p_sys
->
p_vout
,
"mouse-x"
,
&
val
);
...
...
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