Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bf58285a
Commit
bf58285a
authored
May 09, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/sample: Optimize copying to 2d buffer.
parent
ac4a2c4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
sample.c
dlls/mfplat/sample.c
+22
-2
No files found.
dlls/mfplat/sample.c
View file @
bf58285a
...
...
@@ -796,8 +796,9 @@ static HRESULT WINAPI sample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buff
struct
sample
*
sample
=
impl_from_IMFSample
(
iface
);
DWORD
total_length
,
dst_length
,
dst_current_length
,
src_max_length
,
current_length
;
BYTE
*
src_ptr
,
*
dst_ptr
;
BOOL
locked
;
HRESULT
hr
;
IMF2DBuffer
*
buffer2d
;
BOOL
locked
=
FALSE
;
HRESULT
hr
=
E_FAIL
;
size_t
i
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
buffer
);
...
...
@@ -807,6 +808,25 @@ static HRESULT WINAPI sample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buff
total_length
=
sample_get_total_length
(
sample
);
dst_current_length
=
0
;
if
(
sample
->
buffer_count
==
1
&&
SUCCEEDED
(
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
buffer2d
)))
{
if
(
SUCCEEDED
(
IMFMediaBuffer_GetCurrentLength
(
sample
->
buffers
[
0
],
&
current_length
))
&&
SUCCEEDED
(
IMF2DBuffer_GetContiguousLength
(
buffer2d
,
&
dst_length
))
&&
current_length
==
dst_length
&&
SUCCEEDED
(
IMFMediaBuffer_Lock
(
sample
->
buffers
[
0
],
&
src_ptr
,
&
src_max_length
,
&
current_length
)))
{
hr
=
IMF2DBuffer_ContiguousCopyFrom
(
buffer2d
,
src_ptr
,
current_length
);
IMFMediaBuffer_Unlock
(
sample
->
buffers
[
0
]);
}
IMF2DBuffer_Release
(
buffer2d
);
if
(
SUCCEEDED
(
hr
))
{
dst_current_length
=
current_length
;
goto
done
;
}
}
dst_ptr
=
NULL
;
dst_length
=
current_length
=
0
;
locked
=
SUCCEEDED
(
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
dst_ptr
,
&
dst_length
,
&
current_length
));
...
...
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