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
a0e61ed6
Commit
a0e61ed6
authored
Apr 27, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: check video surface capabilities (fixes #8494)
parent
334e48a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
modules/codec/avcodec/vdpau.c
modules/codec/avcodec/vdpau.c
+38
-5
No files found.
modules/codec/avcodec/vdpau.c
View file @
a0e61ed6
...
...
@@ -67,6 +67,9 @@ struct vlc_va_sys_t
VdpGetErrorString
*
GetErrorString
;
VdpGetInformationString
*
GetInformationString
;
VdpDeviceDestroy
*
DeviceDestroy
;
VdpVideoSurfaceQueryCapabilities
*
VideoSurfaceQueryCapabilities
;
VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities
*
VideoSurfaceQueryGetPutBitsYCbCrCapabilities
;
VdpVideoSurfaceCreate
*
VideoSurfaceCreate
;
VdpVideoSurfaceDestroy
*
VideoSurfaceDestroy
;
VdpVideoSurfaceGetBitsYCbCr
*
VideoSurfaceGetBitsYCbCr
;
...
...
@@ -306,7 +309,7 @@ static int Open (vlc_va_t *va, int codec, const es_format_t *fmt)
#define PROC(id,name) \
do { \
void *ptr; \
err = GetProcAddress (
sys->
device, VDP_FUNC_ID_##id, &ptr); \
err = GetProcAddress (device, VDP_FUNC_ID_##id, &ptr); \
if (unlikely(err)) \
abort (); \
sys->name = ptr; \
...
...
@@ -317,6 +320,10 @@ static int Open (vlc_va_t *va, int codec, const es_format_t *fmt)
PROC
(
GET_ERROR_STRING
,
GetErrorString
);
PROC
(
GET_INFORMATION_STRING
,
GetInformationString
);
PROC
(
DEVICE_DESTROY
,
DeviceDestroy
);
/* NOTE: We do not really need to retain QueryCap pointers in *sys */
PROC
(
VIDEO_SURFACE_QUERY_CAPABILITIES
,
VideoSurfaceQueryCapabilities
);
PROC
(
VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES
,
VideoSurfaceQueryGetPutBitsYCbCrCapabilities
);
PROC
(
VIDEO_SURFACE_CREATE
,
VideoSurfaceCreate
);
PROC
(
VIDEO_SURFACE_DESTROY
,
VideoSurfaceDestroy
);
PROC
(
VIDEO_SURFACE_GET_BITS_Y_CB_CR
,
VideoSurfaceGetBitsYCbCr
);
...
...
@@ -325,7 +332,33 @@ static int Open (vlc_va_t *va, int codec, const es_format_t *fmt)
PROC
(
DECODER_RENDER
,
DecoderRender
);
sys
->
context
.
render
=
sys
->
DecoderRender
;
/* TODO: Query cap */
/* Check capabilities */
VdpBool
support
;
uint32_t
width
,
height
;
if
(
sys
->
VideoSurfaceQueryCapabilities
(
device
,
VDP_CHROMA_TYPE_420
,
&
support
,
&
width
,
&
height
)
!=
VDP_STATUS_OK
)
support
=
VDP_FALSE
;
if
(
!
support
||
width
<
fmt
->
video
.
i_width
||
height
<
fmt
->
video
.
i_height
)
{
msg_Err
(
va
,
"video surface not supported: %s %ux%u"
,
"YUV 4:2:0"
,
fmt
->
video
.
i_width
,
fmt
->
video
.
i_height
);
goto
error
;
}
msg_Dbg
(
va
,
"video surface supported maximum: %s %"
PRIu32
"x%"
PRIu32
,
"YUV 4:2:0"
,
width
,
height
);
if
(
sys
->
VideoSurfaceQueryGetPutBitsYCbCrCapabilities
(
device
,
VDP_CHROMA_TYPE_420
,
VDP_YCBCR_FORMAT_YV12
,
&
support
)
!=
VDP_STATUS_OK
)
support
=
VDP_FALSE
;
if
(
!
support
)
{
msg_Err
(
va
,
"video surface reading not supported: %s as %s"
,
"YUV 4:2:0"
,
"YV12"
);
goto
error
;
}
/* TODO: check decoder */
const
char
*
infos
;
if
(
sys
->
GetInformationString
(
&
infos
)
!=
VDP_STATUS_OK
)
...
...
@@ -338,13 +371,13 @@ static int Open (vlc_va_t *va, int codec, const es_format_t *fmt)
va
->
get
=
Lock
;
va
->
release
=
Unlock
;
va
->
extract
=
Copy
;
(
void
)
fmt
;
return
VLC_SUCCESS
;
/*error:
error:
sys
->
DeviceDestroy
(
device
);
XCloseDisplay
(
sys
->
display
);
free
(
sys
);
return VLC_EGENERIC;
*/
return
VLC_EGENERIC
;
}
static
void
Close
(
vlc_va_t
*
va
)
...
...
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