Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
8c5c6c57
Commit
8c5c6c57
authored
Mar 01, 2005
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fix placement calculation when vborder or hborder are non zero
parent
00906ea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
31 deletions
+29
-31
modules/video_filter/mosaic.c
modules/video_filter/mosaic.c
+29
-31
No files found.
modules/video_filter/mosaic.c
View file @
8c5c6c57
...
...
@@ -227,7 +227,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
libvlc_t
*
p_libvlc
=
p_filter
->
p_libvlc
;
vlc_value_t
val
;
int
i_index
;
int
i_index
,
i_real_index
,
i_row
,
i_col
;
subpicture_region_t
*
p_region
;
subpicture_region_t
*
p_region_prev
=
NULL
;
...
...
@@ -275,6 +275,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
i_numpics
/
p_sys
->
i_rows
+
1
);
}
i_real_index
=
0
;
for
(
i_index
=
0
;
i_index
<
p_picture_vout
->
i_picture_num
;
i_index
++
)
{
...
...
@@ -293,6 +295,10 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
msg_Dbg
(
p_filter
,
"Picture Vout Element is empty"
);
break
;
}
i_real_index
++
;
i_row
=
(
i_real_index
/
p_sys
->
i_cols
)
%
p_sys
->
i_rows
;
i_col
=
i_real_index
%
p_sys
->
i_cols
;
/* Convert the images */
...
...
@@ -310,8 +316,12 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
fmt_out
.
i_chroma
=
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'A'
);
fmt_out
.
i_width
=
fmt_in
.
i_width
*
(
p_sys
->
i_width
/
p_sys
->
i_cols
)
/
fmt_in
.
i_width
;
fmt_out
.
i_height
=
fmt_in
.
i_height
*
(
p_sys
->
i_height
/
p_sys
->
i_rows
)
/
fmt_in
.
i_height
;
fmt_out
.
i_width
=
fmt_in
.
i_width
*
(
(
p_sys
->
i_width
-
(
p_sys
->
i_cols
-
1
)
*
p_sys
->
i_vborder
)
/
p_sys
->
i_cols
)
/
fmt_in
.
i_width
;
fmt_out
.
i_height
=
fmt_in
.
i_height
*
(
(
p_sys
->
i_height
-
(
p_sys
->
i_rows
-
1
)
*
p_sys
->
i_hborder
)
/
p_sys
->
i_rows
)
/
fmt_in
.
i_height
;
if
(
p_sys
->
i_ar
)
/* keep aspect ratio */
{
if
(
(
float
)
fmt_out
.
i_width
/
(
float
)
fmt_out
.
i_height
...
...
@@ -365,39 +375,27 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
if
(
p_sys
->
i_ar
)
/* keep aspect ratio */
{
/* center the video in the dedicated rectangle */
p_region
->
i_x
=
p_sys
->
i_xoffset
+
(
i_index
%
p_sys
->
i_cols
)
*
(
p_sys
->
i_width
/
p_sys
->
i_cols
+
p_sys
->
i_vborder
)
+
(
fmt_in
.
i_width
*
(
p_sys
->
i_width
/
p_sys
->
i_cols
)
/
fmt_in
.
i_width
-
fmt_out
.
i_width
)
/
2
;
p_region
->
i_x
=
p_sys
->
i_xoffset
+
i_col
*
(
p_sys
->
i_width
/
p_sys
->
i_cols
)
+
(
i_col
*
p_sys
->
i_vborder
)
/
p_sys
->
i_cols
+
(
fmt_in
.
i_width
*
(
(
p_sys
->
i_width
-
(
p_sys
->
i_cols
-
1
)
*
p_sys
->
i_vborder
)
/
p_sys
->
i_cols
)
/
fmt_in
.
i_width
-
fmt_out
.
i_width
)
/
2
;
p_region
->
i_y
=
p_sys
->
i_yoffset
+
(
(
i_index
/
p_sys
->
i_cols
)
%
p_sys
->
i_rows
)
*
(
p_sys
->
i_height
/
p_sys
->
i_rows
+
p_sys
->
i_hborder
)
+
(
fmt_in
.
i_height
*
(
p_sys
->
i_height
/
p_sys
->
i_rows
)
/
fmt_in
.
i_height
-
fmt_out
.
i_height
)
/
2
;
+
i_row
*
(
p_sys
->
i_height
/
p_sys
->
i_rows
)
+
(
i_row
*
p_sys
->
i_hborder
)
/
p_sys
->
i_rows
+
(
fmt_in
.
i_height
*
(
(
p_sys
->
i_height
-
(
p_sys
->
i_rows
-
1
)
*
p_sys
->
i_hborder
)
/
p_sys
->
i_rows
)
/
fmt_in
.
i_height
-
fmt_out
.
i_height
)
/
2
;
}
else
{
/* we don't have to center the video since it takes the
whole rectangle area */
p_region
->
i_x
=
p_sys
->
i_xoffset
+
(
i_index
%
p_sys
->
i_cols
)
*
(
p_sys
->
i_width
/
p_sys
->
i_cols
+
p_sys
->
i_vborder
)
;
p_region
->
i_x
=
p_sys
->
i_xoffset
+
i_col
*
(
p_sys
->
i_width
/
p_sys
->
i_cols
)
+
(
i_col
*
p_sys
->
i_vborder
)
/
p_sys
->
i_cols
;
p_region
->
i_y
=
p_sys
->
i_yoffset
+
(
(
i_index
/
p_sys
->
i_cols
)
%
p_sys
->
i_rows
)
*
(
p_sys
->
i_height
/
p_sys
->
i_rows
+
p_sys
->
i_hborder
);
}
if
(
1
)
{
uint8_t
*
p_a
=
p_region
->
picture
.
A_PIXELS
;
int
i_pitch
=
p_region
->
picture
.
Y_PITCH
;
int
x
,
y
;
for
(
x
=
0
,
y
=
0
;
x
+
y
<
20
;
x
++
,
y
++
){
p_a
[
x
+
i_pitch
*
y
]
=
0xff
;
}
+
i_row
*
(
p_sys
->
i_height
/
p_sys
->
i_rows
)
+
(
i_row
*
p_sys
->
i_hborder
)
/
p_sys
->
i_rows
;
}
if
(
p_region_prev
==
NULL
){
...
...
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