Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
673d9849
Commit
673d9849
authored
Mar 09, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add MFGetPlaneSize().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
50af0567
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
7 deletions
+42
-7
mediatype.c
dlls/mfplat/mediatype.c
+26
-6
mfplat.spec
dlls/mfplat/mfplat.spec
+1
-1
mfplat.c
dlls/mfplat/tests/mfplat.c
+14
-0
mfapi.h
include/mfapi.h
+1
-0
No files found.
dlls/mfplat/mediatype.c
View file @
673d9849
...
...
@@ -1737,10 +1737,7 @@ static int __cdecl uncompressed_video_format_compare(const void *a, const void *
return
memcmp
(
guid
,
format
->
subtype
,
sizeof
(
*
guid
));
}
/***********************************************************************
* MFCalculateImageSize (mfplat.@)
*/
HRESULT
WINAPI
MFCalculateImageSize
(
REFGUID
subtype
,
UINT32
width
,
UINT32
height
,
UINT32
*
size
)
static
HRESULT
mf_get_image_size
(
REFGUID
subtype
,
unsigned
int
width
,
unsigned
int
height
,
unsigned
int
*
size
)
{
static
const
struct
uncompressed_video_format
video_formats
[]
=
{
...
...
@@ -1755,8 +1752,6 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height
};
struct
uncompressed_video_format
*
format
;
TRACE
(
"%s, %u, %u, %p.
\n
"
,
debugstr_mf_guid
(
subtype
),
width
,
height
,
size
);
format
=
bsearch
(
subtype
,
video_formats
,
ARRAY_SIZE
(
video_formats
),
sizeof
(
*
video_formats
),
uncompressed_video_format_compare
);
if
(
format
)
...
...
@@ -1772,6 +1767,31 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height
}
/***********************************************************************
* MFCalculateImageSize (mfplat.@)
*/
HRESULT
WINAPI
MFCalculateImageSize
(
REFGUID
subtype
,
UINT32
width
,
UINT32
height
,
UINT32
*
size
)
{
TRACE
(
"%s, %u, %u, %p.
\n
"
,
debugstr_mf_guid
(
subtype
),
width
,
height
,
size
);
return
mf_get_image_size
(
subtype
,
width
,
height
,
size
);
}
/***********************************************************************
* MFGetPlaneSize (mfplat.@)
*/
HRESULT
WINAPI
MFGetPlaneSize
(
DWORD
format
,
DWORD
width
,
DWORD
height
,
DWORD
*
size
)
{
GUID
subtype
;
TRACE
(
"%#x, %u, %u, %p.
\n
"
,
format
,
width
,
height
,
size
);
memcpy
(
&
subtype
,
&
MFVideoFormat_Base
,
sizeof
(
subtype
));
subtype
.
Data1
=
format
;
return
mf_get_image_size
(
&
subtype
,
width
,
height
,
size
);
}
/***********************************************************************
* MFCompareFullToPartialMediaType (mfplat.@)
*/
BOOL
WINAPI
MFCompareFullToPartialMediaType
(
IMFMediaType
*
full_type
,
IMFMediaType
*
partial_type
)
...
...
dlls/mfplat/mfplat.spec
View file @
673d9849
...
...
@@ -96,7 +96,7 @@
@ stub MFGetConfigurationString
@ stub MFGetMFTMerit
@ stub MFGetNumericNameFromSockaddr
@ st
ub MFGetPlaneSize
@ st
dcall MFGetPlaneSize(long long long ptr)
@ stub MFGetPlatform
@ stdcall MFGetPluginControl(ptr)
@ stub MFGetPrivateWorkqueues
...
...
dlls/mfplat/tests/mfplat.c
View file @
673d9849
...
...
@@ -91,6 +91,7 @@ static HRESULT (WINAPI *pMFTUnregisterLocalByCLSID)(CLSID clsid);
static
HRESULT
(
WINAPI
*
pMFAllocateWorkQueueEx
)(
MFASYNC_WORKQUEUE_TYPE
queue_type
,
DWORD
*
queue
);
static
HRESULT
(
WINAPI
*
pMFTEnumEx
)(
GUID
category
,
UINT32
flags
,
const
MFT_REGISTER_TYPE_INFO
*
input_type
,
const
MFT_REGISTER_TYPE_INFO
*
output_type
,
IMFActivate
***
activate
,
UINT32
*
count
);
static
HRESULT
(
WINAPI
*
pMFGetPlaneSize
)(
DWORD
format
,
DWORD
width
,
DWORD
height
,
DWORD
*
size
);
static
const
WCHAR
fileschemeW
[]
=
L"file://"
;
...
...
@@ -662,6 +663,7 @@ static void init_functions(void)
X
(
MFCreateSourceResolver
);
X
(
MFCreateMFByteStreamOnStream
);
X
(
MFCreateTransformActivate
);
X
(
MFGetPlaneSize
);
X
(
MFHeapAlloc
);
X
(
MFHeapFree
);
X
(
MFPutWaitingWorkItem
);
...
...
@@ -3184,6 +3186,9 @@ static void test_MFCalculateImageSize(void)
UINT32
size
;
HRESULT
hr
;
if
(
!
pMFGetPlaneSize
)
win_skip
(
"MFGetPlaneSize() is not available.
\n
"
);
size
=
1
;
hr
=
MFCalculateImageSize
(
&
IID_IUnknown
,
1
,
1
,
&
size
);
ok
(
hr
==
E_INVALIDARG
||
broken
(
hr
==
S_OK
)
/* Vista */
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -3200,6 +3205,15 @@ static void test_MFCalculateImageSize(void)
ok
(
hr
==
S_OK
||
(
is_broken
&&
hr
==
E_INVALIDARG
),
"%u: failed to calculate image size, hr %#x.
\n
"
,
i
,
hr
);
ok
(
size
==
image_size_tests
[
i
].
size
,
"%u: unexpected image size %u, expected %u.
\n
"
,
i
,
size
,
image_size_tests
[
i
].
size
);
if
(
pMFGetPlaneSize
)
{
hr
=
pMFGetPlaneSize
(
image_size_tests
[
i
].
subtype
->
Data1
,
image_size_tests
[
i
].
width
,
image_size_tests
[
i
].
height
,
&
size
);
ok
(
hr
==
S_OK
,
"%u: failed to get plane size, hr %#x.
\n
"
,
i
,
hr
);
ok
(
size
==
image_size_tests
[
i
].
size
,
"%u: unexpected plane size %u, expected %u.
\n
"
,
i
,
size
,
image_size_tests
[
i
].
size
);
}
}
}
...
...
include/mfapi.h
View file @
673d9849
...
...
@@ -421,6 +421,7 @@ void * WINAPI MFHeapAlloc(SIZE_T size, ULONG flags, char *file, int line, EAllo
void
WINAPI
MFHeapFree
(
void
*
ptr
);
HRESULT
WINAPI
MFGetAttributesAsBlob
(
IMFAttributes
*
attributes
,
UINT8
*
buffer
,
UINT
size
);
HRESULT
WINAPI
MFGetAttributesAsBlobSize
(
IMFAttributes
*
attributes
,
UINT32
*
size
);
HRESULT
WINAPI
MFGetPlaneSize
(
DWORD
format
,
DWORD
width
,
DWORD
height
,
DWORD
*
size
);
HRESULT
WINAPI
MFGetTimerPeriodicity
(
DWORD
*
periodicity
);
HRESULT
WINAPI
MFTEnum
(
GUID
category
,
UINT32
flags
,
MFT_REGISTER_TYPE_INFO
*
input_type
,
MFT_REGISTER_TYPE_INFO
*
output_type
,
IMFAttributes
*
attributes
,
...
...
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