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
9fdb1fd9
Commit
9fdb1fd9
authored
Feb 19, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add trivial implementation of MFCopyImage().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1fb58ab2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
main.c
dlls/mfplat/main.c
+13
-2
mfplat.c
dlls/mfplat/tests/mfplat.c
+37
-0
No files found.
dlls/mfplat/main.c
View file @
9fdb1fd9
...
...
@@ -476,10 +476,21 @@ HRESULT WINAPI MFUnlockPlatform(void)
return
S_OK
;
}
/***********************************************************************
* MFCopyImage (mfplat.@)
*/
HRESULT
WINAPI
MFCopyImage
(
BYTE
*
dest
,
LONG
deststride
,
const
BYTE
*
src
,
LONG
srcstride
,
DWORD
width
,
DWORD
lines
)
{
FIXME
(
"(%p, %d, %p, %d, %d, %d) stub
\n
"
,
dest
,
deststride
,
src
,
srcstride
,
width
,
lines
);
return
E_NOTIMPL
;
TRACE
(
"(%p, %d, %p, %d, %u, %u)
\n
"
,
dest
,
deststride
,
src
,
srcstride
,
width
,
lines
);
while
(
lines
--
)
{
memcpy
(
dest
,
src
,
width
);
dest
+=
deststride
;
src
+=
srcstride
;
}
return
S_OK
;
}
typedef
struct
_mfattributes
...
...
dlls/mfplat/tests/mfplat.c
View file @
9fdb1fd9
...
...
@@ -36,6 +36,8 @@
#include "wine/test.h"
static
HRESULT
(
WINAPI
*
pMFCopyImage
)(
BYTE
*
dest
,
LONG
deststride
,
const
BYTE
*
src
,
LONG
srcstride
,
DWORD
width
,
DWORD
lines
);
static
HRESULT
(
WINAPI
*
pMFCreateSourceResolver
)(
IMFSourceResolver
**
resolver
);
static
HRESULT
(
WINAPI
*
pMFCreateMFByteStreamOnStream
)(
IStream
*
stream
,
IMFByteStream
**
bytestream
);
static
HRESULT
(
WINAPI
*
pMFCreateMemoryBuffer
)(
DWORD
max_length
,
IMFMediaBuffer
**
buffer
);
...
...
@@ -308,6 +310,7 @@ static void init_functions(void)
HMODULE
mod
=
GetModuleHandleA
(
"mfplat.dll"
);
#define X(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return;
X
(
MFCopyImage
);
X
(
MFCreateSourceResolver
);
X
(
MFCreateMFByteStreamOnStream
);
X
(
MFCreateMemoryBuffer
);
...
...
@@ -877,6 +880,39 @@ static void test_allocate_queue(void)
ok
(
hr
==
S_OK
,
"Failed to shutdown, hr %#x.
\n
"
,
hr
);
}
static
void
test_MFCopyImage
(
void
)
{
BYTE
dest
[
16
],
src
[
16
];
HRESULT
hr
;
if
(
!
pMFCopyImage
)
{
win_skip
(
"MFCopyImage() is not available.
\n
"
);
return
;
}
memset
(
dest
,
0xaa
,
sizeof
(
dest
));
memset
(
src
,
0x11
,
sizeof
(
src
));
hr
=
pMFCopyImage
(
dest
,
8
,
src
,
8
,
4
,
1
);
ok
(
hr
==
S_OK
,
"Failed to copy image %#x.
\n
"
,
hr
);
ok
(
!
memcmp
(
dest
,
src
,
4
)
&&
dest
[
4
]
==
0xaa
,
"Unexpected buffer contents.
\n
"
);
memset
(
dest
,
0xaa
,
sizeof
(
dest
));
memset
(
src
,
0x11
,
sizeof
(
src
));
hr
=
pMFCopyImage
(
dest
,
8
,
src
,
8
,
16
,
1
);
ok
(
hr
==
S_OK
,
"Failed to copy image %#x.
\n
"
,
hr
);
ok
(
!
memcmp
(
dest
,
src
,
16
),
"Unexpected buffer contents.
\n
"
);
memset
(
dest
,
0xaa
,
sizeof
(
dest
));
memset
(
src
,
0x11
,
sizeof
(
src
));
hr
=
pMFCopyImage
(
dest
,
8
,
src
,
8
,
8
,
2
);
ok
(
hr
==
S_OK
,
"Failed to copy image %#x.
\n
"
,
hr
);
ok
(
!
memcmp
(
dest
,
src
,
16
),
"Unexpected buffer contents.
\n
"
);
}
START_TEST
(
mfplat
)
{
CoInitialize
(
NULL
);
...
...
@@ -895,6 +931,7 @@ START_TEST(mfplat)
test_source_resolver
();
test_MFCreateAsyncResult
();
test_allocate_queue
();
test_MFCopyImage
();
CoUninitialize
();
}
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