Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
e8bbacbf
Commit
e8bbacbf
authored
8 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
hwcontext_qsv: support frame mapping
Signed-off-by:
Maxym Dmytrychenko
<
maxym.dmytrychenko@intel.com
>
parent
8ea15afb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavutil/hwcontext_qsv.c
+37
-0
37 additions, 0 deletions
libavutil/hwcontext_qsv.c
with
37 additions
and
0 deletions
libavutil/hwcontext_qsv.c
+
37
−
0
View file @
e8bbacbf
...
...
@@ -559,6 +559,42 @@ static int qsv_transfer_get_formats(AVHWFramesContext *ctx,
return
0
;
}
static
int
qsv_map_from
(
AVHWFramesContext
*
ctx
,
AVFrame
*
dst
,
const
AVFrame
*
src
,
int
flags
)
{
QSVFramesContext
*
s
=
ctx
->
internal
->
priv
;
mfxFrameSurface1
*
surf
=
(
mfxFrameSurface1
*
)
src
->
data
[
3
];
AVHWFramesContext
*
child_frames_ctx
;
AVFrame
*
dummy
;
int
ret
=
0
;
if
(
!
s
->
child_frames_ref
)
return
AVERROR
(
ENOSYS
);
child_frames_ctx
=
(
AVHWFramesContext
*
)
s
->
child_frames_ref
->
data
;
dummy
=
av_frame_alloc
();
if
(
!
dummy
)
return
AVERROR
(
ENOMEM
);
dummy
->
buf
[
0
]
=
av_buffer_ref
(
src
->
buf
[
0
]);
dummy
->
hw_frames_ctx
=
av_buffer_ref
(
s
->
child_frames_ref
);
if
(
!
dummy
->
buf
[
0
]
||
!
dummy
->
hw_frames_ctx
)
goto
fail
;
dummy
->
format
=
child_frames_ctx
->
format
;
dummy
->
width
=
src
->
width
;
dummy
->
height
=
src
->
height
;
dummy
->
data
[
3
]
=
surf
->
Data
.
MemId
;
ret
=
av_hwframe_map
(
dst
,
dummy
,
flags
);
fail:
av_frame_free
(
&
dummy
);
return
ret
;
}
static
int
qsv_transfer_data_child
(
AVHWFramesContext
*
ctx
,
AVFrame
*
dst
,
const
AVFrame
*
src
)
{
...
...
@@ -840,6 +876,7 @@ const HWContextType ff_hwcontext_type_qsv = {
.
transfer_get_formats
=
qsv_transfer_get_formats
,
.
transfer_data_to
=
qsv_transfer_data_to
,
.
transfer_data_from
=
qsv_transfer_data_from
,
.
map_from
=
qsv_map_from
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_QSV
,
AV_PIX_FMT_NONE
},
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment