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
5184c7cb
Commit
5184c7cb
authored
Jun 05, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used the filter blend helpers in logo.
parent
eb24fa76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
39 deletions
+24
-39
modules/video_filter/logo.c
modules/video_filter/logo.c
+24
-39
No files found.
modules/video_filter/logo.c
View file @
5184c7cb
...
...
@@ -376,6 +376,9 @@ static int Init( vout_thread_t *p_vout )
(
p_logo_list
->
i_counter
+
1
)
%
p_logo_list
->
i_count
;
p_pic
=
p_logo_list
->
p_logo
[
p_logo_list
->
i_counter
].
p_pic
;
p_sys
->
i_width
=
p_pic
?
p_pic
->
p
[
Y_PLANE
].
i_visible_pitch
:
0
;
p_sys
->
i_height
=
p_pic
?
p_pic
->
p
[
Y_PLANE
].
i_visible_lines
:
0
;
/* Initialize the output structure */
p_vout
->
output
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
p_vout
->
output
.
i_width
=
p_vout
->
render
.
i_width
;
...
...
@@ -385,38 +388,20 @@ static int Init( vout_thread_t *p_vout )
fmt
=
p_vout
->
fmt_out
;
/* Load the video blending filter */
p_sys
->
p_blend
=
vlc_object_create
(
p_vout
,
sizeof
(
filter_t
)
);
vlc_object_attach
(
p_sys
->
p_blend
,
p_vout
);
p_sys
->
p_blend
->
fmt_out
.
video
.
i_x_offset
=
p_sys
->
p_blend
->
fmt_out
.
video
.
i_y_offset
=
0
;
p_sys
->
p_blend
->
fmt_in
.
video
.
i_x_offset
=
p_sys
->
p_blend
->
fmt_in
.
video
.
i_y_offset
=
0
;
p_sys
->
p_blend
->
fmt_out
.
video
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
p_sys
->
p_blend
->
fmt_out
.
video
.
i_chroma
=
p_vout
->
output
.
i_chroma
;
p_sys
->
p_blend
->
fmt_in
.
video
.
i_chroma
=
VLC_CODEC_YUVA
;
p_sys
->
p_blend
->
fmt_in
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
;
p_sys
->
i_width
=
p_sys
->
p_blend
->
fmt_in
.
video
.
i_width
=
p_sys
->
p_blend
->
fmt_in
.
video
.
i_visible_width
=
p_pic
?
p_pic
->
p
[
Y_PLANE
].
i_visible_pitch
:
0
;
p_sys
->
i_height
=
p_sys
->
p_blend
->
fmt_in
.
video
.
i_height
=
p_sys
->
p_blend
->
fmt_in
.
video
.
i_visible_height
=
p_pic
?
p_pic
->
p
[
Y_PLANE
].
i_visible_lines
:
0
;
p_sys
->
p_blend
->
fmt_out
.
video
.
i_width
=
p_sys
->
p_blend
->
fmt_out
.
video
.
i_visible_width
=
p_vout
->
output
.
i_width
;
p_sys
->
p_blend
->
fmt_out
.
video
.
i_height
=
p_sys
->
p_blend
->
fmt_out
.
video
.
i_visible_height
=
p_vout
->
output
.
i_height
;
p_sys
->
p_blend
->
p_module
=
module_need
(
p_sys
->
p_blend
,
"video blending"
,
NULL
,
false
);
if
(
!
p_sys
->
p_blend
->
p_module
)
{
msg_Err
(
p_vout
,
"can't open blending filter, aborting"
);
vlc_object_detach
(
p_sys
->
p_blend
);
vlc_object_release
(
p_sys
->
p_blend
);
p_sys
->
p_blend
=
filter_NewBlend
(
VLC_OBJECT
(
p_vout
),
p_vout
->
output
.
i_chroma
);
if
(
!
p_sys
->
p_blend
)
return
VLC_EGENERIC
;
video_format_t
fmt_blend
;
video_format_Setup
(
&
fmt_blend
,
VLC_CODEC_YUVA
,
p_sys
->
i_width
,
p_sys
->
i_height
,
0
);
if
(
filter_ConfigureBlend
(
p_sys
->
p_blend
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
&
fmt_blend
)
)
{
msg_Err
(
p_vout
,
"can't configure blending filter, aborting"
);
filter_DeleteBlend
(
p_sys
->
p_blend
);
return
VLC_EGENERIC
;
}
...
...
@@ -478,10 +463,7 @@ static void End( vout_thread_t *p_vout )
vout_filter_ReleaseDirectBuffers
(
p_vout
);
if
(
p_sys
->
p_blend
->
p_module
)
module_unneed
(
p_sys
->
p_blend
,
p_sys
->
p_blend
->
p_module
);
vlc_object_detach
(
p_sys
->
p_blend
);
vlc_object_release
(
p_sys
->
p_blend
);
filter_DeleteBlend
(
p_sys
->
p_blend
);
}
/*****************************************************************************
...
...
@@ -571,10 +553,13 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic )
picture_Copy
(
p_outpic
,
p_inpic
);
if
(
p_pic
)
p_sys
->
p_blend
->
pf_video_blend
(
p_sys
->
p_blend
,
p_outpic
,
p_pic
,
p_sys
->
posx
,
p_sys
->
posy
,
p_logo
->
i_alpha
!=
-
1
?
p_logo
->
i_alpha
:
p_logo_list
->
i_alpha
);
{
const
int
i_alpha
=
p_logo
->
i_alpha
!=
-
1
?
p_logo
->
i_alpha
:
p_logo_list
->
i_alpha
;
filter_Blend
(
p_sys
->
p_blend
,
p_outpic
,
p_sys
->
posx
,
p_sys
->
posy
,
p_pic
,
i_alpha
);
}
vout_DisplayPicture
(
p_sys
->
p_vout
,
p_outpic
);
}
...
...
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