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
1337cbe7
Commit
1337cbe7
authored
Mar 04, 2012
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VAAPI-XCB: move FindVAFourCC() to common code.
Move FindVAFourCC() to common code file.
parent
e3a7fd1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
44 deletions
+46
-44
modules/codec/avcodec/vaapi_x11.c
modules/codec/avcodec/vaapi_x11.c
+1
-44
modules/codec/avcodec/vasub.c
modules/codec/avcodec/vasub.c
+44
-0
modules/codec/avcodec/vasub.h
modules/codec/avcodec/vasub.h
+1
-0
No files found.
modules/codec/avcodec/vaapi_x11.c
View file @
1337cbe7
...
...
@@ -105,50 +105,7 @@ static void DisplayPicture(vout_display_t *, picture_t *, subpicture_t *);
static
int
Control
(
vout_display_t
*
,
int
,
va_list
);
static
void
Manage
(
vout_display_t
*
);
/* VA API support functions */
static
int
FindVAFourCC
(
vlc_va_conn_t
*
vaconn
,
VAImageFormat
*
fmt
,
vlc_fourcc_t
*
i_chroma
,
int32_t
*
i_bits_per_pixel
)
{
vaconn
->
lock
();
/* Find and create a supported image chroma */
int
i_fmt_count
=
vaMaxNumImageFormats
(
vaconn
->
p_display
);
VAImageFormat
*
p_fmt
=
calloc
(
i_fmt_count
,
sizeof
(
*
p_fmt
));
if
(
!
p_fmt
)
goto
error
;
if
(
vaQueryImageFormats
(
vaconn
->
p_display
,
p_fmt
,
&
i_fmt_count
)
)
{
free
(
p_fmt
);
goto
error
;
}
*
i_chroma
=
0
;
*
i_bits_per_pixel
=
0
;
for
(
int
i
=
0
;
i
<
i_fmt_count
;
i
++
)
{
if
(
p_fmt
[
i
].
fourcc
==
VA_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
)
||
p_fmt
[
i
].
fourcc
==
VA_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
)
||
p_fmt
[
i
].
fourcc
==
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
)
)
{
memcpy
((
void
*
)
fmt
,
(
void
*
)
&
p_fmt
[
i
],
sizeof
(
VAImageFormat
));
*
i_chroma
=
VLC_CODEC_YV12
;
*
i_bits_per_pixel
=
p_fmt
[
i
].
bits_per_pixel
;
break
;
}
}
free
(
p_fmt
);
if
(
*
i_chroma
==
0
)
goto
error
;
vaconn
->
unlock
();
return
VLC_SUCCESS
;
error:
vaconn
->
unlock
();
return
VLC_EGENERIC
;
}
/* */
static
vout_window_t
*
MakeWindow
(
vout_display_t
*
vd
)
{
vout_window_cfg_t
wnd_cfg
;
...
...
modules/codec/avcodec/vasub.c
View file @
1337cbe7
...
...
@@ -188,6 +188,50 @@ out_warning:
return
VLC_EGENERIC
;
}
/* VA API support functions */
int
FindVAFourCC
(
vlc_va_conn_t
*
vaconn
,
VAImageFormat
*
fmt
,
vlc_fourcc_t
*
i_chroma
,
int32_t
*
i_bits_per_pixel
)
{
vaconn
->
lock
();
/* Find and create a supported image chroma */
int
i_fmt_count
=
vaMaxNumImageFormats
(
vaconn
->
p_display
);
VAImageFormat
*
p_fmt
=
calloc
(
i_fmt_count
,
sizeof
(
*
p_fmt
));
if
(
!
p_fmt
)
goto
error
;
if
(
vaQueryImageFormats
(
vaconn
->
p_display
,
p_fmt
,
&
i_fmt_count
)
)
{
free
(
p_fmt
);
goto
error
;
}
*
i_chroma
=
0
;
*
i_bits_per_pixel
=
0
;
for
(
int
i
=
0
;
i
<
i_fmt_count
;
i
++
)
{
if
(
p_fmt
[
i
].
fourcc
==
VA_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
)
||
p_fmt
[
i
].
fourcc
==
VA_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
)
||
p_fmt
[
i
].
fourcc
==
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
)
)
{
memcpy
((
void
*
)
fmt
,
(
void
*
)
&
p_fmt
[
i
],
sizeof
(
VAImageFormat
));
*
i_chroma
=
VLC_CODEC_YV12
;
*
i_bits_per_pixel
=
p_fmt
[
i
].
bits_per_pixel
;
break
;
}
}
free
(
p_fmt
);
if
(
*
i_chroma
==
0
)
goto
error
;
vaconn
->
unlock
();
return
VLC_SUCCESS
;
error:
vaconn
->
unlock
();
return
VLC_EGENERIC
;
}
static
inline
void
vaapi_fixup_alpha
(
uint8_t
*
p_pixel
,
size_t
i_size
)
{
for
(
size_t
p
=
0
;
p
<
i_size
;
p
+=
4
)
...
...
modules/codec/avcodec/vasub.h
View file @
1337cbe7
...
...
@@ -22,6 +22,7 @@
/* Check if subtitle format is supported by VA API */
int
VASubtitleFourCC
(
vlc_va_conn_t
*
vaconn
,
const
unsigned
int
vafourcc
,
VAImageFormat
*
sub_fmt
,
int
*
flags
);
int
FindVAFourCC
(
vlc_va_conn_t
*
vaconn
,
VAImageFormat
*
fmt
,
vlc_fourcc_t
*
i_chroma
,
int32_t
*
i_bits_per_pixel
);
/* */
typedef
struct
vasubpicture_cache_t
vasubpicture_cache_t
;
...
...
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