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
e259db6f
Commit
e259db6f
authored
Jun 04, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use filter chain in subpicture core.
parent
350148d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
74 deletions
+39
-74
include/vlc_osd.h
include/vlc_osd.h
+1
-2
src/misc/filter_chain.c
src/misc/filter_chain.c
+2
-0
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+36
-72
No files found.
include/vlc_osd.h
View file @
e259db6f
...
...
@@ -77,8 +77,7 @@ struct spu_t
int
(
*
pf_control
)
(
spu_t
*
,
int
,
va_list
);
/* Supciture filters */
filter_t
*
pp_filter
[
10
];
int
i_filter
;
filter_chain_t
*
p_chain
;
};
static
inline
int
spu_vaControl
(
spu_t
*
p_spu
,
int
i_query
,
va_list
args
)
...
...
src/misc/filter_chain.c
View file @
e259db6f
...
...
@@ -305,6 +305,8 @@ block_t *filter_chain_AudioFilter( filter_chain_t *p_chain, block_t *p_block )
return
p_block
;
}
#include <vlc_osd.h>
void
filter_chain_SubFilter
(
filter_chain_t
*
p_chain
,
mtime_t
display_date
)
{
...
...
src/video_output/vout_subpictures.c
View file @
e259db6f
...
...
@@ -58,6 +58,8 @@ static void spu_DeleteChain( spu_t * );
static
int
SubFilterCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
sub_filter_allocation_init
(
filter_t
*
,
void
*
);
static
void
sub_filter_allocation_clear
(
filter_t
*
);
struct
filter_owner_sys_t
{
spu_t
*
p_spu
;
...
...
@@ -69,6 +71,7 @@ enum {
SCALE_TEXT
,
SCALE_SIZE
};
/**
* Creates the subpicture unit
*
...
...
@@ -88,7 +91,6 @@ spu_t *__spu_Create( vlc_object_t *p_this )
p_spu
->
p_blend
=
NULL
;
p_spu
->
p_text
=
NULL
;
p_spu
->
p_scale
=
NULL
;
p_spu
->
i_filter
=
0
;
p_spu
->
pf_control
=
spu_vaControlDefault
;
/* Register the default subpicture channel */
...
...
@@ -98,6 +100,10 @@ spu_t *__spu_Create( vlc_object_t *p_this )
vlc_object_attach
(
p_spu
,
p_this
);
p_spu
->
p_chain
=
filter_chain_New
(
p_spu
,
"sub filter"
,
false
,
sub_filter_allocation_init
,
sub_filter_allocation_clear
,
p_spu
);
return
p_spu
;
}
...
...
@@ -125,59 +131,14 @@ int spu_Init( spu_t *p_spu )
int
spu_ParseChain
(
spu_t
*
p_spu
)
{
char
*
psz_parser
;
vlc_value_t
val
;
var_Get
(
p_spu
,
"sub-filter"
,
&
val
);
psz_parser
=
val
.
psz_string
;
while
(
psz_parser
&&
*
psz_parser
)
char
*
psz_parser
=
var_GetString
(
p_spu
,
"sub-filter"
);
if
(
filter_chain_AppendFromString
(
p_spu
->
p_chain
,
psz_parser
)
<
0
)
{
config_chain_t
*
p_cfg
;
char
*
psz_name
;
psz_parser
=
config_ChainCreate
(
&
psz_name
,
&
p_cfg
,
psz_parser
);
msg_Dbg
(
p_spu
,
"adding sub-filter: %s"
,
psz_name
);
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
=
vlc_object_create
(
p_spu
,
VLC_OBJECT_FILTER
);
vlc_object_attach
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
],
p_spu
);
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
pf_sub_buffer_new
=
sub_new_buffer
;
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
pf_sub_buffer_del
=
sub_del_buffer
;
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_cfg
=
p_cfg
;
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_module
=
module_Need
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
],
"sub filter"
,
psz_name
,
true
);
free
(
psz_name
);
if
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_module
)
{
filter_owner_sys_t
*
p_sys
=
malloc
(
sizeof
(
filter_owner_sys_t
)
);
if
(
p_sys
)
{
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_owner
=
p_sys
;
spu_Control
(
p_spu
,
SPU_CHANNEL_REGISTER
,
&
p_sys
->
i_channel
);
p_sys
->
p_spu
=
p_spu
;
p_spu
->
i_filter
++
;
}
}
else
{
msg_Dbg
(
p_spu
,
"no sub filter found"
);
config_ChainDestroy
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_cfg
);
vlc_object_detach
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
);
vlc_object_release
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
);
}
if
(
p_spu
->
i_filter
>=
10
)
{
msg_Dbg
(
p_spu
,
"can't add anymore filters"
);
break
;
}
free
(
psz_parser
);
return
VLC_EGENERIC
;
}
free
(
val
.
psz_string
);
free
(
psz_parser
);
return
VLC_SUCCESS
;
}
...
...
@@ -236,17 +197,7 @@ void spu_Destroy( spu_t *p_spu )
static
void
spu_DeleteChain
(
spu_t
*
p_spu
)
{
if
(
p_spu
->
i_filter
)
while
(
p_spu
->
i_filter
)
{
p_spu
->
i_filter
--
;
module_Unneed
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
],
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_module
);
free
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_owner
);
config_ChainDestroy
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
->
p_cfg
);
vlc_object_detach
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
);
vlc_object_release
(
p_spu
->
pp_filter
[
p_spu
->
i_filter
]
);
}
filter_chain_Delete
(
p_spu
->
p_chain
);
}
/**
...
...
@@ -1116,16 +1067,7 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
mtime_t
ephemer_date
;
/* Run subpicture filters */
for
(
i_index
=
0
;
i_index
<
p_spu
->
i_filter
;
i_index
++
)
{
subpicture_t
*
p_subpic_filter
;
p_subpic_filter
=
p_spu
->
pp_filter
[
i_index
]
->
pf_sub_filter
(
p_spu
->
pp_filter
[
i_index
],
display_date
);
if
(
p_subpic_filter
)
{
spu_DisplaySubpicture
(
p_spu
,
p_subpic_filter
);
}
}
filter_chain_SubFilter
(
p_spu
->
p_chain
,
display_date
);
/* We get an easily parsable chained list of subpictures which
* ends with NULL since p_subpic was initialized to NULL. */
...
...
@@ -1408,3 +1350,25 @@ static int SubFilterCallback( vlc_object_t *p_object, char const *psz_var,
vlc_mutex_unlock
(
&
p_spu
->
subpicture_lock
);
return
VLC_SUCCESS
;
}
static
int
sub_filter_allocation_init
(
filter_t
*
p_filter
,
void
*
p_data
)
{
spu_t
*
p_spu
=
(
spu_t
*
)
p_data
;
p_filter
->
pf_sub_buffer_new
=
sub_new_buffer
;
p_filter
->
pf_sub_buffer_del
=
sub_del_buffer
;
filter_owner_sys_t
*
p_sys
=
malloc
(
sizeof
(
filter_owner_sys_t
)
);
if
(
!
p_sys
)
return
VLC_EGENERIC
;
p_filter
->
p_owner
=
p_sys
;
spu_Control
(
p_spu
,
SPU_CHANNEL_REGISTER
,
&
p_sys
->
i_channel
);
p_sys
->
p_spu
=
p_spu
;
return
VLC_SUCCESS
;
}
static
void
sub_filter_allocation_clear
(
filter_t
*
p_filter
)
{
free
(
p_filter
->
p_owner
);
}
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