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
52d191ff
Commit
52d191ff
authored
May 27, 2013
by
Rafaël Carré
Committed by
Rémi Denis-Courmont
Jun 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg_GetFrameBuf: split out va code
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
0ec02c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
22 deletions
+27
-22
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+27
-22
No files found.
modules/codec/avcodec/video.c
View file @
52d191ff
...
...
@@ -886,6 +886,31 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
}
}
static
int
ffmpeg_va_GetFrameBuf
(
struct
AVCodecContext
*
p_context
,
AVFrame
*
p_ff_pic
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_context
->
opaque
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
vlc_va_t
*
p_va
=
p_sys
->
p_va
;
/* hwaccel_context is not present in old ffmpeg version */
if
(
vlc_va_Setup
(
p_va
,
&
p_context
->
hwaccel_context
,
&
p_dec
->
fmt_out
.
video
.
i_chroma
,
p_context
->
width
,
p_context
->
height
)
)
{
msg_Err
(
p_dec
,
"vlc_va_Setup failed"
);
return
-
1
;
}
if
(
vlc_va_Get
(
p_va
,
p_ff_pic
)
)
{
msg_Err
(
p_dec
,
"VaGrabSurface failed"
);
return
-
1
;
}
p_ff_pic
->
type
=
FF_BUFFER_TYPE_USER
;
return
0
;
}
/*****************************************************************************
* ffmpeg_GetFrameBuf: callback used by ffmpeg to get a frame buffer.
*****************************************************************************
...
...
@@ -906,30 +931,10 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
#endif
if
(
p_sys
->
p_va
)
{
/* hwaccel_context is not present in old ffmpeg version */
if
(
vlc_va_Setup
(
p_sys
->
p_va
,
&
p_context
->
hwaccel_context
,
&
p_dec
->
fmt_out
.
video
.
i_chroma
,
p_context
->
width
,
p_context
->
height
)
)
{
msg_Err
(
p_dec
,
"vlc_va_Setup failed"
);
return
-
1
;
}
return
ffmpeg_va_GetFrameBuf
(
p_context
,
p_ff_pic
);
if
(
vlc_va_Get
(
p_sys
->
p_va
,
p_ff_pic
)
)
{
msg_Err
(
p_dec
,
"VaGrabSurface failed"
);
return
-
1
;
}
p_ff_pic
->
type
=
FF_BUFFER_TYPE_USER
;
return
0
;
}
else
if
(
!
p_sys
->
b_direct_rendering
)
{
/* Not much to do in indirect rendering mode. */
if
(
!
p_sys
->
b_direct_rendering
)
return
avcodec_default_get_buffer
(
p_context
,
p_ff_pic
);
}
wait_mt
(
p_sys
);
/* Some codecs set pix_fmt only after the 1st frame has been decoded,
...
...
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