Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
5240dc3b
Commit
5240dc3b
authored
Jan 09, 2013
by
Jean-Paul Saman
Committed by
Jean-Paul Saman
Jan 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: cleanup VA API case in ffmpeg_GetFrameBuf.
parent
b0527b5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
26 deletions
+18
-26
modules/codec/avcodec/va.h
modules/codec/avcodec/va.h
+0
-2
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+18
-24
No files found.
modules/codec/avcodec/va.h
View file @
5240dc3b
...
@@ -30,8 +30,6 @@ struct vlc_va_t {
...
@@ -30,8 +30,6 @@ struct vlc_va_t {
char
*
description
;
char
*
description
;
vlc_object_t
*
obj
;
vlc_object_t
*
obj
;
bool
b_direct
;
int
(
*
setup
)(
vlc_va_t
*
,
void
**
hw
,
vlc_fourcc_t
*
output
,
int
(
*
setup
)(
vlc_va_t
*
,
void
**
hw
,
vlc_fourcc_t
*
output
,
int
width
,
int
height
);
int
width
,
int
height
);
int
(
*
get
)(
vlc_va_t
*
,
AVFrame
*
frame
);
int
(
*
get
)(
vlc_va_t
*
,
AVFrame
*
frame
);
...
...
modules/codec/avcodec/video.c
View file @
5240dc3b
...
@@ -754,7 +754,8 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
...
@@ -754,7 +754,8 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
p_va
&&
p_sys
->
p_ff_pic
->
opaque
)
if
(
p_sys
->
p_va
&&
p_sys
->
p_ff_pic
->
opaque
)
{
{
p_pic
=
(
picture_t
*
)
p_sys
->
p_ff_pic
->
opaque
;
p_pic
=
(
picture_t
*
)
p_sys
->
p_ff_pic
->
opaque
;
decoder_LinkPicture
(
p_dec
,
p_pic
);
if
(
p_pic
->
format
.
i_chroma
!=
VLC_CODEC_VAAPI_SURFACE
)
decoder_LinkPicture
(
p_dec
,
p_pic
);
/* Fill p_picture_t from AVVideoFrame and do chroma conversion
/* Fill p_picture_t from AVVideoFrame and do chroma conversion
* if needed */
* if needed */
...
@@ -796,7 +797,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
...
@@ -796,7 +797,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
}
}
/* Send decoded frame to vout */
/* Send decoded frame to vout */
if
(
i_pts
>
VLC_TS_INVALID
)
if
(
i_pts
>
VLC_TS_INVALID
)
{
{
p_pic
->
date
=
i_pts
;
p_pic
->
date
=
i_pts
;
...
@@ -999,25 +1000,26 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
...
@@ -999,25 +1000,26 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
if
(
p_sys
->
p_va
)
if
(
p_sys
->
p_va
)
{
{
do
/* */
{
p_ff_pic
->
type
=
FF_BUFFER_TYPE_USER
;
if
(
p_dec
->
b_die
)
#if LIBAVCODEC_VERSION_MAJOR < 54
return
-
1
;
/* FIXME what is that, should give good value */
p_pic
=
ffmpeg_NewPictBuf
(
p_dec
,
p_sys
->
p_context
);
p_ff_pic
->
age
=
256
*
256
*
256
*
64
;
// FIXME FIXME from ffmpeg
}
while
(
p_sys
->
p_va
->
b_direct
&&
p_pic
==
NULL
);
#endif
if
(
p_pic
&&
p_pic
->
format
.
i_chroma
==
VLC_CODEC_VAAPI_SURFACE
)
/* NOTE: Get first picture from video output instead of from the
* normal (non-accellerated vouts) mechanism. The drawback is that
* decoding the first pictures is delayed with the creation of the
* video output module.
*/
p_pic
=
ffmpeg_NewPictBuf
(
p_dec
,
p_sys
->
p_context
);
if
(
p_pic
&&
(
p_pic
->
format
.
i_chroma
==
VLC_CODEC_VAAPI_SURFACE
)
)
{
{
p_sys
->
p_va
->
b_direct
=
true
;
p_ff_pic
->
opaque
=
(
void
*
)
p_pic
;
p_ff_pic
->
opaque
=
(
void
*
)
p_pic
;
p_ff_pic
->
type
=
FF_BUFFER_TYPE_USER
;
decoder_LinkPicture
(
p_dec
,
p_pic
);
#if LIBAVCODEC_VERSION_MAJOR < 54
/* FIXME what is that, should give good value */
p_ff_pic
->
age
=
256
*
256
*
256
*
64
;
// FIXME FIXME from ffmpeg
#endif
vlc_va_Put
(
p_sys
->
p_va
,
p_ff_pic
,
p_pic
);
vlc_va_Put
(
p_sys
->
p_va
,
p_ff_pic
,
p_pic
);
}
}
else
if
(
!
p_sys
->
p_va
->
b_direct
)
else
{
{
if
(
p_pic
)
picture_Release
(
p_pic
);
if
(
p_pic
)
picture_Release
(
p_pic
);
#ifdef HAVE_AVCODEC_VA
#ifdef HAVE_AVCODEC_VA
...
@@ -1029,18 +1031,10 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
...
@@ -1029,18 +1031,10 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
msg_Err
(
p_dec
,
"vlc_va_Setup failed"
);
msg_Err
(
p_dec
,
"vlc_va_Setup failed"
);
return
-
1
;
return
-
1
;
}
}
msg_Info
(
p_dec
,
"vlc_va_Setup"
);
#else
#else
assert
(
0
);
assert
(
0
);
#endif
#endif
/* */
p_ff_pic
->
type
=
FF_BUFFER_TYPE_USER
;
#if LIBAVCODEC_VERSION_MAJOR < 54
/* FIXME what is that, should give good value */
p_ff_pic
->
age
=
256
*
256
*
256
*
64
;
// FIXME FIXME from ffmpeg
#endif
if
(
vlc_va_Get
(
p_sys
->
p_va
,
p_ff_pic
)
)
if
(
vlc_va_Get
(
p_sys
->
p_va
,
p_ff_pic
)
)
{
{
msg_Err
(
p_dec
,
"vaGrabSurface failed"
);
msg_Err
(
p_dec
,
"vaGrabSurface failed"
);
...
...
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