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
a93bea3b
Commit
a93bea3b
authored
Apr 12, 2024
by
Ziqing Hui
Committed by
Alexandre Julliard
Apr 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement mf_media_type_to_wg_format_video_wmv.
parent
0b34df89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
mfplat.c
dlls/winegstreamer/mfplat.c
+65
-0
wmv_decoder.c
dlls/winegstreamer/wmv_decoder.c
+1
-2
No files found.
dlls/winegstreamer/mfplat.c
View file @
a93bea3b
...
...
@@ -40,6 +40,7 @@ DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf
DEFINE_MEDIATYPE_GUID
(
MFAudioFormat_RAW_AAC
,
WAVE_FORMAT_RAW_AAC1
);
DEFINE_MEDIATYPE_GUID
(
MFVideoFormat_VC1S
,
MAKEFOURCC
(
'V'
,
'C'
,
'1'
,
'S'
));
DEFINE_MEDIATYPE_GUID
(
MFVideoFormat_IV50
,
MAKEFOURCC
(
'I'
,
'V'
,
'5'
,
'0'
));
DEFINE_GUID
(
MEDIASUBTYPE_WMV_Unknown
,
0x7ce12ca9
,
0xbfbf
,
0x43d9
,
0x9d
,
0x00
,
0x82
,
0xb8
,
0xed
,
0x54
,
0x31
,
0x6b
);
struct
class_factory
{
...
...
@@ -867,6 +868,60 @@ static void mf_media_type_to_wg_format_video_indeo(IMFMediaType *type, uint32_t
format
->
u
.
video
.
version
=
version
;
}
static
void
mf_media_type_to_wg_format_video_wmv
(
IMFMediaType
*
type
,
const
GUID
*
subtype
,
struct
wg_format
*
format
)
{
UINT64
frame_rate
,
frame_size
;
UINT32
codec_data_len
;
BYTE
*
codec_data
;
memset
(
format
,
0
,
sizeof
(
*
format
));
format
->
major_type
=
WG_MAJOR_TYPE_VIDEO_WMV
;
if
(
SUCCEEDED
(
IMFMediaType_GetUINT64
(
type
,
&
MF_MT_FRAME_SIZE
,
&
frame_size
)))
{
format
->
u
.
video
.
width
=
frame_size
>>
32
;
format
->
u
.
video
.
height
=
(
UINT32
)
frame_size
;
}
if
(
SUCCEEDED
(
IMFMediaType_GetUINT64
(
type
,
&
MF_MT_FRAME_RATE
,
&
frame_rate
))
&&
(
UINT32
)
frame_rate
)
{
format
->
u
.
video
.
fps_n
=
frame_rate
>>
32
;
format
->
u
.
video
.
fps_d
=
(
UINT32
)
frame_rate
;
}
else
{
format
->
u
.
video
.
fps_n
=
1
;
format
->
u
.
video
.
fps_d
=
1
;
}
if
(
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_WMV1
))
format
->
u
.
video
.
format
=
WG_VIDEO_FORMAT_WMV1
;
else
if
(
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_WMV2
))
format
->
u
.
video
.
format
=
WG_VIDEO_FORMAT_WMV2
;
else
if
(
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_WMV3
))
format
->
u
.
video
.
format
=
WG_VIDEO_FORMAT_WMV3
;
else
if
(
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_WMVA
))
format
->
u
.
video
.
format
=
WG_VIDEO_FORMAT_WMVA
;
else
if
(
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_WVC1
))
format
->
u
.
video
.
format
=
WG_VIDEO_FORMAT_WVC1
;
else
format
->
u
.
video
.
format
=
WG_VIDEO_FORMAT_UNKNOWN
;
if
(
SUCCEEDED
(
IMFMediaType_GetAllocatedBlob
(
type
,
&
MF_MT_USER_DATA
,
&
codec_data
,
&
codec_data_len
)))
{
if
(
codec_data_len
<=
sizeof
(
format
->
u
.
video
.
codec_data
))
{
format
->
u
.
video
.
codec_data_len
=
codec_data_len
;
memcpy
(
format
->
u
.
video
.
codec_data
,
codec_data
,
codec_data_len
);
}
else
{
WARN
(
"Codec data buffer too small, codec data size %u.
\n
"
,
codec_data_len
);
}
CoTaskMemFree
(
codec_data
);
}
}
void
mf_media_type_to_wg_format
(
IMFMediaType
*
type
,
struct
wg_format
*
format
)
{
GUID
major_type
,
subtype
;
...
...
@@ -902,6 +957,16 @@ void mf_media_type_to_wg_format(IMFMediaType *type, struct wg_format *format)
mf_media_type_to_wg_format_video_h264
(
type
,
format
);
else
if
(
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_IV50
))
mf_media_type_to_wg_format_video_indeo
(
type
,
5
,
format
);
else
if
(
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WMV1
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WMV2
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WMVA
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WMVP
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WVP2
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WMV_Unknown
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WVC1
)
||
IsEqualGUID
(
&
subtype
,
&
MEDIASUBTYPE_WMV3
)
||
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_VC1S
))
mf_media_type_to_wg_format_video_wmv
(
type
,
&
subtype
,
format
);
else
mf_media_type_to_wg_format_video
(
type
,
&
subtype
,
format
);
}
...
...
dlls/winegstreamer/wmv_decoder.c
View file @
a93bea3b
...
...
@@ -31,8 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
WINE_DECLARE_DEBUG_CHANNEL
(
winediag
);
extern
const
GUID
MEDIASUBTYPE_VC1S
;
DEFINE_GUID
(
MEDIASUBTYPE_WMV_Unknown
,
0x7ce12ca9
,
0xbfbf
,
0x43d9
,
0x9d
,
0x00
,
0x82
,
0xb8
,
0xed
,
0x54
,
0x31
,
0x6b
);
extern
const
GUID
MEDIASUBTYPE_WMV_Unknown
;
struct
decoder_type
{
...
...
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