Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
2ef87815
Commit
2ef87815
authored
Jun 22, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hwcontext_dxva2: add support for p010
parent
e78e5b73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
hwcontext_dxva2.c
libavutil/hwcontext_dxva2.c
+15
-12
No files found.
libavutil/hwcontext_dxva2.c
View file @
2ef87815
...
...
@@ -65,6 +65,7 @@ static const struct {
enum
AVPixelFormat
pix_fmt
;
}
supported_formats
[]
=
{
{
MKTAG
(
'N'
,
'V'
,
'1'
,
'2'
),
AV_PIX_FMT_NV12
},
{
MKTAG
(
'P'
,
'0'
,
'1'
,
'0'
),
AV_PIX_FMT_P010
},
};
DEFINE_GUID
(
video_decoder_service
,
0xfc51a551
,
0xd5e7
,
0x11d9
,
0xaf
,
0x55
,
0x00
,
0x05
,
0x4e
,
0x43
,
0xff
,
0x02
);
...
...
@@ -248,6 +249,10 @@ static int dxva2_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
D3DLOCKED_RECT
LockedRect
;
HRESULT
hr
;
uint8_t
*
surf_data
[
4
]
=
{
NULL
};
int
surf_linesize
[
4
]
=
{
0
};
int
i
;
int
download
=
!!
src
->
hw_frames_ctx
;
surface
=
(
IDirect3DSurface9
*
)(
download
?
src
->
data
[
3
]
:
dst
->
data
[
3
]);
...
...
@@ -265,20 +270,18 @@ static int dxva2_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
return
AVERROR_UNKNOWN
;
}
for
(
i
=
0
;
download
?
dst
->
data
[
i
]
:
src
->
data
[
i
];
i
++
)
surf_linesize
[
i
]
=
LockedRect
.
Pitch
;
av_image_fill_pointers
(
surf_data
,
ctx
->
sw_format
,
surfaceDesc
.
Height
,
(
uint8_t
*
)
LockedRect
.
pBits
,
surf_linesize
);
if
(
download
)
{
av_image_copy_plane
(
dst
->
data
[
0
],
dst
->
linesize
[
0
],
(
uint8_t
*
)
LockedRect
.
pBits
,
LockedRect
.
Pitch
,
src
->
width
,
src
->
height
);
av_image_copy_plane
(
dst
->
data
[
1
],
dst
->
linesize
[
1
],
(
uint8_t
*
)
LockedRect
.
pBits
+
LockedRect
.
Pitch
*
surfaceDesc
.
Height
,
LockedRect
.
Pitch
,
src
->
width
,
src
->
height
/
2
);
av_image_copy
(
dst
->
data
,
dst
->
linesize
,
surf_data
,
surf_linesize
,
ctx
->
sw_format
,
src
->
width
,
src
->
height
);
}
else
{
av_image_copy_plane
((
uint8_t
*
)
LockedRect
.
pBits
,
LockedRect
.
Pitch
,
dst
->
data
[
0
],
dst
->
linesize
[
0
],
src
->
width
,
src
->
height
);
av_image_copy_plane
((
uint8_t
*
)
LockedRect
.
pBits
+
LockedRect
.
Pitch
*
surfaceDesc
.
Height
,
LockedRect
.
Pitch
,
dst
->
data
[
1
],
dst
->
linesize
[
1
],
src
->
width
,
src
->
height
/
2
);
av_image_copy
(
surf_data
,
surf_linesize
,
src
->
data
,
src
->
linesize
,
ctx
->
sw_format
,
src
->
width
,
src
->
height
);
}
IDirect3DSurface9_UnlockRect
(
surface
);
...
...
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