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
72aabd94
Commit
72aabd94
authored
May 01, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added mouse support to sub-filter.
parent
5d51dfe0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
4 deletions
+62
-4
include/vlc_filter.h
include/vlc_filter.h
+15
-3
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/filter_chain.c
src/misc/filter_chain.c
+19
-0
src/video_output/display.c
src/video_output/display.c
+3
-0
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+3
-0
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+21
-1
No files found.
include/vlc_filter.h
View file @
72aabd94
...
...
@@ -101,13 +101,18 @@ struct filter_t
struct
{
subpicture_t
*
(
*
pf_filter
)
(
filter_t
*
,
mtime_t
);
subpicture_t
*
(
*
pf_buffer_new
)
(
filter_t
*
);
void
(
*
pf_buffer_del
)
(
filter_t
*
,
subpicture_t
*
);
subpicture_t
*
(
*
pf_filter
)
(
filter_t
*
,
mtime_t
);
subpicture_t
*
(
*
pf_buffer_new
)(
filter_t
*
);
void
(
*
pf_buffer_del
)(
filter_t
*
,
subpicture_t
*
);
int
(
*
pf_mouse
)
(
filter_t
*
,
const
vlc_mouse_t
*
p_old
,
const
vlc_mouse_t
*
p_new
,
const
video_format_t
*
);
}
sub
;
#define pf_sub_filter u.sub.pf_filter
#define pf_sub_buffer_new u.sub.pf_buffer_new
#define pf_sub_buffer_del u.sub.pf_buffer_del
#define pf_sub_mouse u.sub.pf_mouse
struct
{
...
...
@@ -370,5 +375,12 @@ VLC_EXPORT( void, filter_chain_SubFilter, ( filter_chain_t *, mtime_t ) );
*/
VLC_EXPORT
(
int
,
filter_chain_MouseFilter
,
(
filter_chain_t
*
,
vlc_mouse_t
*
,
const
vlc_mouse_t
*
)
);
/**
* Inform the filter chain of mouse state.
*
* It makes sense only for a sub filter chain.
*/
VLC_EXPORT
(
int
,
filter_chain_MouseEvent
,
(
filter_chain_t
*
,
const
vlc_mouse_t
*
,
const
video_format_t
*
)
);
#endif
/* _VLC_FILTER_H */
src/libvlccore.sym
View file @
72aabd94
...
...
@@ -131,6 +131,7 @@ filter_chain_DeleteFilter
filter_chain_GetFmtOut
filter_chain_GetLength
filter_chain_MouseFilter
filter_chain_MouseEvent
filter_chain_New
filter_chain_Reset
filter_chain_SubFilter
...
...
src/misc/filter_chain.c
View file @
72aabd94
...
...
@@ -284,6 +284,25 @@ int filter_chain_MouseFilter( filter_chain_t *p_chain, vlc_mouse_t *p_dst, const
return
VLC_SUCCESS
;
}
int
filter_chain_MouseEvent
(
filter_chain_t
*
p_chain
,
const
vlc_mouse_t
*
p_mouse
,
const
video_format_t
*
p_fmt
)
{
for
(
chained_filter_t
*
f
=
p_chain
->
first
;
f
!=
NULL
;
f
=
f
->
next
)
{
filter_t
*
p_filter
=
&
f
->
filter
;
if
(
p_filter
->
pf_sub_mouse
)
{
vlc_mouse_t
old
=
*
f
->
mouse
;
*
f
->
mouse
=
*
p_mouse
;
if
(
p_filter
->
pf_sub_mouse
(
p_filter
,
&
old
,
p_mouse
,
p_fmt
)
)
return
VLC_EGENERIC
;
}
}
return
VLC_SUCCESS
;
}
/* Helpers */
static
filter_t
*
filter_chain_AppendFilterInternal
(
filter_chain_t
*
p_chain
,
...
...
src/video_output/display.c
View file @
72aabd94
...
...
@@ -1411,6 +1411,9 @@ void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
{
vlc_mouse_t
tmp
;
if
(
spu_ProcessMouse
(
vout
->
p
->
p_spu
,
m
,
&
vout
->
fmt_out
))
return
;
vlc_mutex_lock
(
&
vout
->
p
->
vfilter_lock
);
if
(
vout
->
p
->
p_vf2_chain
)
{
if
(
!
filter_chain_MouseFilter
(
vout
->
p
->
p_vf2_chain
,
&
tmp
,
m
))
...
...
src/video_output/vout_internal.h
View file @
72aabd94
...
...
@@ -161,5 +161,8 @@ int vout_ManageWrapper(vout_thread_t *);
void
vout_RenderWrapper
(
vout_thread_t
*
,
picture_t
*
);
void
vout_DisplayWrapper
(
vout_thread_t
*
,
picture_t
*
);
/* */
int
spu_ProcessMouse
(
spu_t
*
,
const
vlc_mouse_t
*
,
const
video_format_t
*
);
#endif
src/video_output/vout_subpictures.c
View file @
72aabd94
...
...
@@ -88,6 +88,7 @@ struct spu_private_t
/* Subpiture filters */
char
*
psz_chain_update
;
vlc_mutex_t
chain_lock
;
filter_chain_t
*
p_chain
;
/* */
...
...
@@ -226,6 +227,7 @@ spu_t *spu_Create( vlc_object_t *p_this )
p_sys
->
i_channel
=
2
;
p_sys
->
psz_chain_update
=
NULL
;
vlc_mutex_init
(
&
p_sys
->
chain_lock
);
p_sys
->
p_chain
=
filter_chain_New
(
p_spu
,
"sub filter"
,
false
,
SubFilterAllocationInit
,
SubFilterAllocationClean
,
...
...
@@ -279,6 +281,7 @@ void spu_Destroy( spu_t *p_spu )
FilterRelease
(
p_sys
->
p_scale
);
filter_chain_Delete
(
p_sys
->
p_chain
);
vlc_mutex_destroy
(
&
p_sys
->
chain_lock
);
free
(
p_sys
->
psz_chain_update
);
/* Destroy all remaining subpictures */
...
...
@@ -326,6 +329,22 @@ void spu_Attach( spu_t *p_spu, vlc_object_t *p_this, bool b_attach )
}
}
/**
* Inform the SPU filters of mouse event
*/
int
spu_ProcessMouse
(
spu_t
*
p_spu
,
const
vlc_mouse_t
*
p_mouse
,
const
video_format_t
*
p_fmt
)
{
spu_private_t
*
p_sys
=
p_spu
->
p
;
vlc_mutex_lock
(
&
p_sys
->
chain_lock
);
filter_chain_MouseEvent
(
p_sys
->
p_chain
,
p_mouse
,
p_fmt
);
vlc_mutex_unlock
(
&
p_sys
->
chain_lock
);
return
VLC_SUCCESS
;
}
/**
* Display a subpicture
*
...
...
@@ -552,6 +571,7 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t render_subtitle_date,
p_sys
->
psz_chain_update
=
NULL
;
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_mutex_lock
(
&
p_sys
->
chain_lock
);
if
(
psz_chain_update
)
{
filter_chain_Reset
(
p_sys
->
p_chain
,
NULL
,
NULL
);
...
...
@@ -560,9 +580,9 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t render_subtitle_date,
free
(
psz_chain_update
);
}
/* Run subpicture filters */
filter_chain_SubFilter
(
p_sys
->
p_chain
,
render_osd_date
);
vlc_mutex_unlock
(
&
p_sys
->
chain_lock
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
...
...
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