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
8cc373ed
Commit
8cc373ed
authored
Dec 15, 2009
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout_fb: get pitch from line_length field
parent
f67c7ae0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
modules/video_output/fb.c
modules/video_output/fb.c
+7
-12
No files found.
modules/video_output/fb.c
View file @
8cc373ed
...
@@ -129,6 +129,7 @@ struct vout_display_sys_t {
...
@@ -129,6 +129,7 @@ struct vout_display_sys_t {
int
fd
;
/* device handle */
int
fd
;
/* device handle */
struct
fb_var_screeninfo
old_info
;
/* original mode information */
struct
fb_var_screeninfo
old_info
;
/* original mode information */
struct
fb_var_screeninfo
var_info
;
/* current mode information */
struct
fb_var_screeninfo
var_info
;
/* current mode information */
struct
fb_fix_screeninfo
fix_info
;
/* framebuffer fix information */
bool
has_pan
;
/* does device supports panning ? */
bool
has_pan
;
/* does device supports panning ? */
struct
fb_cmap
fb_cmap
;
/* original colormap */
struct
fb_cmap
fb_cmap
;
/* original colormap */
uint16_t
*
palette
;
/* original palette */
uint16_t
*
palette
;
/* original palette */
...
@@ -307,12 +308,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
...
@@ -307,12 +308,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
memset
(
&
rsc
,
0
,
sizeof
(
rsc
));
memset
(
&
rsc
,
0
,
sizeof
(
rsc
));
rsc
.
p
[
0
].
p_pixels
=
sys
->
video_ptr
;
rsc
.
p
[
0
].
p_pixels
=
sys
->
video_ptr
;
rsc
.
p
[
0
].
i_lines
=
sys
->
var_info
.
yres
;
rsc
.
p
[
0
].
i_lines
=
sys
->
var_info
.
yres
;
if
(
sys
->
var_info
.
xres_virtual
)
rsc
.
p
[
0
].
i_pitch
=
sys
->
fix_info
.
line_length
;
rsc
.
p
[
0
].
i_pitch
=
sys
->
var_info
.
xres_virtual
*
sys
->
bytes_per_pixel
;
else
rsc
.
p
[
0
].
i_pitch
=
sys
->
var_info
.
xres
*
sys
->
bytes_per_pixel
;
sys
->
picture
=
picture_NewFromResource
(
&
vd
->
fmt
,
&
rsc
);
sys
->
picture
=
picture_NewFromResource
(
&
vd
->
fmt
,
&
rsc
);
if
(
!
sys
->
picture
)
if
(
!
sys
->
picture
)
...
@@ -484,7 +480,6 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
...
@@ -484,7 +480,6 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
{
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
char
*
psz_device
;
/* framebuffer device path */
char
*
psz_device
;
/* framebuffer device path */
struct
fb_fix_screeninfo
fix_info
;
/* framebuffer fix information */
/* Open framebuffer device */
/* Open framebuffer device */
if
(
!
(
psz_device
=
config_GetPsz
(
vd
,
FB_DEV_VAR
)))
{
if
(
!
(
psz_device
=
config_GetPsz
(
vd
,
FB_DEV_VAR
)))
{
...
@@ -527,7 +522,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
...
@@ -527,7 +522,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
}
}
/* Get some information again, in the definitive configuration */
/* Get some information again, in the definitive configuration */
if
(
ioctl
(
sys
->
fd
,
FBIOGET_FSCREENINFO
,
&
fix_info
)
||
if
(
ioctl
(
sys
->
fd
,
FBIOGET_FSCREENINFO
,
&
sys
->
fix_info
)
||
ioctl
(
sys
->
fd
,
FBIOGET_VSCREENINFO
,
&
sys
->
var_info
))
{
ioctl
(
sys
->
fd
,
FBIOGET_VSCREENINFO
,
&
sys
->
var_info
))
{
msg_Err
(
vd
,
"cannot get additional fb info (%m)"
);
msg_Err
(
vd
,
"cannot get additional fb info (%m)"
);
...
@@ -559,7 +554,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
...
@@ -559,7 +554,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
sys
->
width
,
sys
->
height
);
sys
->
width
,
sys
->
height
);
sys
->
palette
=
NULL
;
sys
->
palette
=
NULL
;
sys
->
has_pan
=
(
fix_info
.
ypanstep
||
fix_info
.
ywrapstep
);
sys
->
has_pan
=
(
sys
->
fix_info
.
ypanstep
||
sys
->
fix_info
.
ywrapstep
);
switch
(
sys
->
var_info
.
bits_per_pixel
)
{
switch
(
sys
->
var_info
.
bits_per_pixel
)
{
case
8
:
case
8
:
...
@@ -608,7 +603,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
...
@@ -608,7 +603,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
sys
->
video_size
=
sys
->
width
*
sys
->
height
*
sys
->
bytes_per_pixe
l
;
sys
->
video_size
=
sys
->
fix_info
.
line_length
*
sys
->
var_info
.
yres_virtua
l
;
/* Map a framebuffer at the beginning */
/* Map a framebuffer at the beginning */
sys
->
video_ptr
=
mmap
(
NULL
,
sys
->
video_size
,
sys
->
video_ptr
=
mmap
(
NULL
,
sys
->
video_size
,
...
@@ -633,8 +628,8 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
...
@@ -633,8 +628,8 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
msg_Dbg
(
vd
,
msg_Dbg
(
vd
,
"framebuffer type=%d, visual=%d, ypanstep=%d, ywrap=%d, accel=%d"
,
"framebuffer type=%d, visual=%d, ypanstep=%d, ywrap=%d, accel=%d"
,
fix_info
.
type
,
fix_info
.
visual
,
sys
->
fix_info
.
type
,
sys
->
fix_info
.
visual
,
fix_info
.
ypanstep
,
fix_info
.
ywrapstep
,
fix_info
.
accel
);
sys
->
fix_info
.
ypanstep
,
sys
->
fix_info
.
ywrapstep
,
sys
->
fix_info
.
accel
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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