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
87df0e8a
Commit
87df0e8a
authored
Aug 04, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fb: select device file by name
parent
a6fb7aec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
9 deletions
+60
-9
modules/video_output/fb.c
modules/video_output/fb.c
+60
-9
No files found.
modules/video_output/fb.c
View file @
87df0e8a
...
...
@@ -80,6 +80,11 @@ static void GfxMode ( int i_tty );
#define DEVICE_LONGTEXT N_( \
"Framebuffer device to use for rendering (usually /dev/fb0).")
#define NAME_TEXT N_("Framebuffer device's name")
#define NAME_LONGTEXT N_( \
"If set, select framebuffer device by name rather than by path. " \
"Example: cat /sys/class/graphics/fb0/name" )
#define TTY_TEXT N_("Run fb on current tty.")
#define TTY_LONGTEXT N_( \
"Run framebuffer on current TTY device (default enabled). " \
...
...
@@ -110,6 +115,9 @@ vlc_module_begin ()
set_subcategory
(
SUBCAT_VIDEO_VOUT
)
add_file
(
FB_DEV_VAR
,
"/dev/fb0"
,
NULL
,
DEVICE_TEXT
,
DEVICE_LONGTEXT
,
false
)
add_string
(
"fb-name"
,
"dm_vid0_fb"
,
NULL
,
NAME_TEXT
,
NAME_LONGTEXT
,
false
);
add_bool
(
"fb-tty"
,
1
,
NULL
,
TTY_TEXT
,
TTY_LONGTEXT
,
true
)
add_string
(
"fb-chroma"
,
NULL
,
NULL
,
CHROMA_TEXT
,
CHROMA_LONGTEXT
,
true
)
...
...
@@ -754,7 +762,39 @@ static void SetPalette( vout_thread_t *p_vout, uint16_t *red, uint16_t *green,
}
#endif
/* following functions are local */
/*****************************************************************************
* OpenFbByName: select framebuffer by name
*****************************************************************************/
static
int
OpenFbByName
(
const
char
*
psz_name
)
{
int
i_fd
=
-
1
;
int
i
;
/* begins with /dev/fb0 */
char
*
psz_device
;
struct
fb_fix_screeninfo
info
;
for
(
i
=
0
;
i
<
FB_MAX
;
i
++
)
{
if
(
asprintf
(
&
psz_device
,
"/dev/fb%d"
,
i
++
)
==
-
1
)
return
-
1
;
i_fd
=
open
(
psz_device
,
O_RDWR
);
free
(
psz_device
);
if
(
i_fd
==
-
1
)
return
-
1
;
/* check errno */
if
(
ioctl
(
i_fd
,
FBIOGET_FSCREENINFO
,
&
info
)
==
-
1
)
{
close
(
i_fd
);
continue
;
}
if
(
!
strcmp
(
info
.
id
,
psz_name
)
)
return
i_fd
;
close
(
i_fd
);
}
return
-
1
;
}
/*****************************************************************************
* OpenDisplay: initialize framebuffer
...
...
@@ -766,17 +806,28 @@ static int OpenDisplay( vout_thread_t *p_vout )
struct
fb_fix_screeninfo
fix_info
;
/* framebuffer fix information */
/* Open framebuffer device */
if
(
!
(
psz_device
=
config_GetPsz
(
p_vout
,
FB_DEV_VAR
))
)
if
(
(
psz_device
=
config_GetPsz
(
p_vout
,
"fb-name"
))
)
{
msg_Err
(
p_vout
,
"don't know which fb device to open"
);
return
VLC_EGENERIC
;
if
(
(
p_sys
->
i_fd
=
OpenFbByName
(
psz_device
))
==
-
1
)
{
msg_Err
(
p_vout
,
"cannot open fb by name %s (%m)"
,
psz_device
);
free
(
psz_device
);
return
VLC_EGENERIC
;
}
}
p_sys
->
i_fd
=
open
(
psz_device
,
O_RDWR
);
if
(
p_sys
->
i_fd
==
-
1
)
else
if
(
(
psz_device
=
config_GetPsz
(
p_vout
,
FB_DEV_VAR
))
)
{
msg_Err
(
p_vout
,
"cannot open %s (%m)"
,
psz_device
);
free
(
psz_device
);
p_sys
->
i_fd
=
open
(
psz_device
,
O_RDWR
);
if
(
p_sys
->
i_fd
==
-
1
)
{
msg_Err
(
p_vout
,
"cannot open %s (%m)"
,
psz_device
);
free
(
psz_device
);
return
VLC_EGENERIC
;
}
}
else
{
msg_Err
(
p_vout
,
"don't know which fb device to open"
);
return
VLC_EGENERIC
;
}
free
(
psz_device
);
...
...
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