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
6a258c95
Commit
6a258c95
authored
Oct 10, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: unify interface for video acceleration
parent
f95cb82f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
37 deletions
+22
-37
modules/codec/avcodec/dxva2.c
modules/codec/avcodec/dxva2.c
+6
-1
modules/codec/avcodec/va.h
modules/codec/avcodec/va.h
+1
-4
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+7
-1
modules/codec/avcodec/vda.c
modules/codec/avcodec/vda.c
+7
-6
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+1
-25
No files found.
modules/codec/avcodec/dxva2.c
View file @
6a258c95
...
...
@@ -496,8 +496,12 @@ static void Close(vlc_va_t *external)
free
(
va
);
}
vlc_va_t
*
vlc_va_NewDxva2
(
vlc_object_t
*
log
,
int
codec_id
)
vlc_va_t
*
vlc_va_New
(
vlc_object_t
*
log
,
int
pixfmt
,
int
codec_id
,
const
es_format_t
*
fmt
)
{
if
(
pixfmt
!=
PIX_FMT_DXVA2_VLD
)
return
NULL
;
vlc_va_dxva2_t
*
va
=
calloc
(
1
,
sizeof
(
*
va
));
if
(
!
va
)
return
NULL
;
...
...
@@ -505,6 +509,7 @@ vlc_va_t *vlc_va_NewDxva2(vlc_object_t *log, int codec_id)
/* */
va
->
log
=
log
;
va
->
codec_id
=
codec_id
;
(
void
)
fmt
;
/* Load dll*/
va
->
hd3d9_dll
=
LoadLibrary
(
TEXT
(
"D3D9.DLL"
));
...
...
modules/codec/avcodec/va.h
View file @
6a258c95
...
...
@@ -58,9 +58,6 @@ static inline void vlc_va_Delete(vlc_va_t *va)
va
->
close
(
va
);
}
vlc_va_t
*
vlc_va_NewVaapi
(
vlc_object_t
*
obj
,
int
codec_id
);
vlc_va_t
*
vlc_va_NewDxva2
(
vlc_object_t
*
log
,
int
codec_id
);
vlc_va_t
*
vlc_va_NewVDA
(
vlc_object_t
*
log
,
int
i_codec_id
,
void
*
p_extra
,
int
i_extra
);
vlc_va_t
*
vlc_va_New
(
vlc_object_t
*
,
int
pix
,
int
codec
,
const
es_format_t
*
);
#endif
modules/codec/avcodec/vaapi.c
View file @
6a258c95
...
...
@@ -506,8 +506,13 @@ static void Delete( vlc_va_t *p_external )
}
/* */
vlc_va_t
*
vlc_va_NewVaapi
(
vlc_object_t
*
obj
,
int
i_codec_id
)
vlc_va_t
*
vlc_va_New
(
vlc_object_t
*
obj
,
int
pixfmt
,
int
i_codec_id
,
const
es_format_t
*
fmt
)
{
/* Only VLD supported */
if
(
pixfmt
!=
PIX_FMT_VAAPI_VLD
)
return
NULL
;
if
(
!
vlc_xlib_init
(
obj
)
)
{
msg_Warn
(
obj
,
"Ignoring VA API"
);
...
...
@@ -519,6 +524,7 @@ vlc_va_t *vlc_va_NewVaapi( vlc_object_t *obj, int i_codec_id )
return
NULL
;
p_va
->
log
=
obj
;
(
void
)
fmt
;
if
(
Open
(
p_va
,
i_codec_id
)
)
{
...
...
modules/codec/avcodec/vda.c
View file @
6a258c95
...
...
@@ -44,7 +44,7 @@ typedef struct
vlc_va_t
va
;
struct
vda_context
hw_ctx
;
uint8_t
*
p_extradata
;
const
uint8_t
*
p_extradata
;
int
i_extradata
;
vlc_fourcc_t
i_chroma
;
...
...
@@ -242,12 +242,13 @@ static void Close( vlc_va_t *p_external )
free
(
p_va
);
}
vlc_va_t
*
vlc_va_NewVDA
(
vlc_object_t
*
p_log
,
int
i_codec_id
,
void
*
p_extra
,
int
i_extra
)
vlc_va_t
*
vlc_va_New
(
vlc_object_t
*
p_log
,
int
pixfmt
,
int
i_codec_id
,
const
es_format_t
*
fmt
)
{
if
(
i_codec_id
!=
CODEC_ID_H264
)
if
(
pixfmt
!=
PIX_FMT_VDA_VLD
||
i_codec_id
!=
CODEC_ID_H264
)
return
NULL
;
if
(
!
p_extra
||
i_extra
<
7
)
if
(
fmt
->
p_extra
==
NULL
||
fmt
->
i_extra
<
7
)
{
msg_Warn
(
p_log
,
"VDA requires extradata."
);
return
NULL
;
...
...
@@ -258,8 +259,8 @@ vlc_va_t *vlc_va_NewVDA( vlc_object_t *p_log, int i_codec_id, void *p_extra, int
return
NULL
;
p_va
->
p_log
=
p_log
;
p_va
->
p_extradata
=
p_extra
;
p_va
->
i_extradata
=
i_extra
;
p_va
->
p_extradata
=
fmt
->
p_extra
;
p_va
->
i_extradata
=
fmt
->
i_extra
;
p_va
->
va
.
setup
=
Setup
;
p_va
->
va
.
get
=
Get
;
...
...
modules/codec/avcodec/video.c
View file @
6a258c95
...
...
@@ -1144,31 +1144,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
msg_Dbg
(
p_dec
,
"Available decoder output format %d (%s)"
,
pi_fmt
[
i
],
name
?
name
:
"unknown"
);
vlc_va_t
*
p_va
=
NULL
;
#ifdef HAVE_AVCODEC_VAAPI
/* Only VLD supported */
if
(
pi_fmt
[
i
]
==
PIX_FMT_VAAPI_VLD
)
{
msg_Dbg
(
p_dec
,
"Trying VA API"
);
p_va
=
vlc_va_NewVaapi
(
VLC_OBJECT
(
p_dec
),
p_sys
->
i_codec_id
);
}
#endif
#ifdef HAVE_AVCODEC_DXVA2
if
(
pi_fmt
[
i
]
==
PIX_FMT_DXVA2_VLD
)
{
msg_Dbg
(
p_dec
,
"Trying DXVA2"
);
p_va
=
vlc_va_NewDxva2
(
VLC_OBJECT
(
p_dec
),
p_sys
->
i_codec_id
);
}
#endif
#ifdef HAVE_AVCODEC_VDA
if
(
pi_fmt
[
i
]
==
PIX_FMT_VDA_VLD
)
{
msg_Dbg
(
p_dec
,
"Trying VDA"
);
p_va
=
vlc_va_NewVDA
(
VLC_OBJECT
(
p_dec
),
p_sys
->
i_codec_id
,
p_dec
->
fmt_in
.
p_extra
,
p_dec
->
fmt_in
.
i_extra
);
}
#endif
vlc_va_t
*
p_va
=
vlc_va_New
(
VLC_OBJECT
(
p_dec
),
pi_fmt
[
i
],
p_sys
->
i_codec_id
,
&
p_dec
->
fmt_in
);
if
(
p_va
==
NULL
)
{
msg_Dbg
(
p_dec
,
"acceleration not available"
);
...
...
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