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
1e2f5524
Commit
1e2f5524
authored
Aug 25, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Partially implement MFInitMediaTypeFromVideoInfoHeader().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
43e70580
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
mediatype.c
dlls/mfplat/mediatype.c
+46
-1
mfplat.c
dlls/mfplat/tests/mfplat.c
+0
-6
No files found.
dlls/mfplat/mediatype.c
View file @
1e2f5524
...
...
@@ -24,6 +24,7 @@
#include "initguid.h"
#include "ks.h"
#include "ksmedia.h"
#include "amvideo.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
...
...
@@ -2957,6 +2958,12 @@ static void mediatype_set_uint32(IMFMediaType *mediatype, const GUID *attr, unsi
*
hr
=
IMFMediaType_SetUINT32
(
mediatype
,
attr
,
value
);
}
static
void
mediatype_set_uint64
(
IMFMediaType
*
mediatype
,
const
GUID
*
attr
,
unsigned
int
high
,
unsigned
int
low
,
HRESULT
*
hr
)
{
if
(
SUCCEEDED
(
*
hr
))
*
hr
=
IMFMediaType_SetUINT64
(
mediatype
,
attr
,
(
UINT64
)
high
<<
32
|
low
);
}
static
void
mediatype_set_guid
(
IMFMediaType
*
mediatype
,
const
GUID
*
attr
,
const
GUID
*
value
,
HRESULT
*
hr
)
{
if
(
SUCCEEDED
(
*
hr
))
...
...
@@ -3558,6 +3565,16 @@ HRESULT WINAPI MFInitVideoFormat_RGB(MFVIDEOFORMAT *format, DWORD width, DWORD h
return
S_OK
;
}
static
HRESULT
mf_get_stride_for_bitmap_info_header
(
DWORD
fourcc
,
const
BITMAPINFOHEADER
*
bih
,
LONG
*
stride
)
{
HRESULT
hr
;
if
(
FAILED
(
hr
=
MFGetStrideForBitmapInfoHeader
(
fourcc
,
bih
->
biWidth
,
stride
)))
return
hr
;
if
(
bih
->
biHeight
<
0
)
*
stride
*=
-
1
;
return
hr
;
}
/***********************************************************************
* MFCreateVideoMediaTypeFromVideoInfoHeader (mfplat.@)
*/
...
...
@@ -3577,9 +3594,37 @@ HRESULT WINAPI MFCreateVideoMediaTypeFromVideoInfoHeader(const KS_VIDEOINFOHEADE
HRESULT
WINAPI
MFInitMediaTypeFromVideoInfoHeader
(
IMFMediaType
*
media_type
,
const
VIDEOINFOHEADER
*
vih
,
UINT32
size
,
const
GUID
*
subtype
)
{
HRESULT
hr
=
S_OK
;
DWORD
height
;
LONG
stride
;
FIXME
(
"%p, %p, %u, %s.
\n
"
,
media_type
,
vih
,
size
,
debugstr_guid
(
subtype
));
return
E_NOTIMPL
;
IMFMediaType_DeleteAllItems
(
media_type
);
if
(
!
subtype
)
{
FIXME
(
"Implicit subtype is not supported.
\n
"
);
return
E_NOTIMPL
;
}
height
=
abs
(
vih
->
bmiHeader
.
biHeight
);
mediatype_set_guid
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Video
,
&
hr
);
mediatype_set_guid
(
media_type
,
&
MF_MT_SUBTYPE
,
subtype
,
&
hr
);
mediatype_set_uint64
(
media_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
1
,
1
,
&
hr
);
mediatype_set_uint32
(
media_type
,
&
MF_MT_INTERLACE_MODE
,
MFVideoInterlace_Progressive
,
&
hr
);
mediatype_set_uint64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
vih
->
bmiHeader
.
biWidth
,
height
,
&
hr
);
if
(
SUCCEEDED
(
mf_get_stride_for_bitmap_info_header
(
subtype
->
Data1
,
&
vih
->
bmiHeader
,
&
stride
)))
{
mediatype_set_uint32
(
media_type
,
&
MF_MT_DEFAULT_STRIDE
,
stride
,
&
hr
);
mediatype_set_uint32
(
media_type
,
&
MF_MT_SAMPLE_SIZE
,
abs
(
stride
)
*
height
,
&
hr
);
mediatype_set_uint32
(
media_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
1
,
&
hr
);
mediatype_set_uint32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
1
,
&
hr
);
}
return
hr
;
}
/***********************************************************************
...
...
dlls/mfplat/tests/mfplat.c
View file @
1e2f5524
...
...
@@ -8263,13 +8263,7 @@ static void test_MFInitMediaTypeFromVideoInfoHeader(void)
vih
.
bmiHeader
.
biBitCount
=
32
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IMFMediaType_Release
(
media_type
);
return
;
}
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
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