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
fd28b417
Commit
fd28b417
authored
May 01, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated remoteosd to new sub-filter mouse API.
parent
dc0f32c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
26 deletions
+18
-26
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+18
-26
No files found.
modules/video_filter/remoteosd.c
View file @
fd28b417
...
...
@@ -153,8 +153,10 @@ vlc_module_end ()
/* subfilter functions */
static
subpicture_t
*
Filter
(
filter_t
*
,
mtime_t
);
static
int
MouseEvent
(
vlc_object_t
*
p_this
,
char
const
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
);
static
int
MouseEvent
(
filter_t
*
,
const
vlc_mouse_t
*
,
const
vlc_mouse_t
*
,
const
video_format_t
*
);
static
int
KeyEvent
(
vlc_object_t
*
p_this
,
char
const
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
);
...
...
@@ -306,15 +308,12 @@ static int CreateFilter ( vlc_object_t *p_this )
/* Attach subpicture filter callback */
p_filter
->
pf_sub_filter
=
Filter
;
p_filter
->
pf_sub_mouse
=
MouseEvent
;
p_sys
->
p_vout
=
vlc_object_find
(
p_this
,
VLC_OBJECT_VOUT
,
FIND_PARENT
);
if
(
p_sys
->
p_vout
)
{
var_AddCallback
(
p_sys
->
p_vout
,
"mouse-moved"
,
MouseEvent
,
p_this
);
var_AddCallback
(
p_sys
->
p_vout
,
"mouse-button-down"
,
MouseEvent
,
p_this
);
var_AddCallback
(
p_sys
->
p_vout
->
p_libvlc
,
"key-pressed"
,
KeyEvent
,
p_this
);
}
...
...
@@ -367,10 +366,6 @@ static void DestroyFilter( vlc_object_t *p_this )
if
(
p_sys
->
p_vout
)
{
var_DelCallback
(
p_sys
->
p_vout
,
"mouse-moved"
,
MouseEvent
,
p_this
);
var_DelCallback
(
p_sys
->
p_vout
,
"mouse-button-down"
,
MouseEvent
,
p_this
);
var_DelCallback
(
p_sys
->
p_vout
->
p_libvlc
,
"key-pressed"
,
KeyEvent
,
p_this
);
...
...
@@ -1319,36 +1314,33 @@ static inline bool raw_line( filter_sys_t* p_sys,
/*****************************************************************************
* MouseEvent: callback for mouse events
*****************************************************************************/
static
int
MouseEvent
(
vlc_object_t
*
p_this
,
char
const
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
static
int
MouseEvent
(
filter_t
*
p_filter
,
const
vlc_mouse_t
*
p_old
,
const
vlc_mouse_t
*
p_new
,
const
video_format_t
*
p_fmt
)
{
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
newval
);
VLC_UNUSED
(
psz_var
);
filter_t
*
p_filter
=
(
filter_t
*
)
p_data
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
VLC_UNUSED
(
p_old
);
if
(
!
p_sys
->
b_vnc_mouse_events
)
return
VLC_SUCCESS
;
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_sys
->
p_vout
;
int
i_x
,
i_y
;
int
i_v
;
i_v
=
var_GetInteger
(
p_sys
->
p_vout
,
"mouse-button-down"
);
var_GetCoords
(
p_sys
->
p_vout
,
"mouse-moved"
,
&
i_x
,
&
i_y
);
int
i_v
=
p_new
->
i_pressed
;
int
i_x
=
p_new
->
i_x
;
int
i_y
=
p_new
->
i_y
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
const
int
v_h
=
p_
vout
->
fmt_in
.
i_visible_height
;
const
int
v_h
=
p_
fmt
->
i_visible_height
;
const
int
v_w
=
p_sys
->
i_vnc_width
*
v_h
/
p_sys
->
i_vnc_height
;
const
int
v_x
=
(
p_
vout
->
fmt_in
.
i_visible_width
-
v_w
)
/
2
;
const
int
v_x
=
(
p_
fmt
->
i_visible_width
-
v_w
)
/
2
;
i_x
-=
v_x
;
if
(
i_y
<
0
||
i_x
<
0
||
i_y
>=
v_h
||
i_x
>=
v_w
)
{
vlc_mutex_unlock
(
&
p_sys
->
lock
);
msg_Dbg
(
p_
this
,
"invalid mouse event? x=%d y=%d btn=%x"
,
i_x
,
i_y
,
i_v
);
msg_Dbg
(
p_
filter
,
"invalid mouse event? x=%d y=%d btn=%x"
,
i_x
,
i_y
,
i_v
);
return
VLC_SUCCESS
;
}
if
(
!
p_sys
->
b_connection_active
)
...
...
@@ -1358,7 +1350,7 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
}
#ifdef VNC_DEBUG
msg_Dbg
(
p_
this
,
"mouse event x=%d y=%d btn=%x"
,
i_x
,
i_y
,
i_v
);
msg_Dbg
(
p_
filter
,
"mouse event x=%d y=%d btn=%x"
,
i_x
,
i_y
,
i_v
);
#endif
/* */
...
...
@@ -1377,7 +1369,7 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
VLC_
SUCCESS
;
return
VLC_
EGENERIC
;
}
/*****************************************************************************
...
...
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