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
782abff9
Commit
782abff9
authored
Aug 04, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement IWMOutputMediaProps_SetMediaType.
parent
b3d6e0cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
24 deletions
+39
-24
wm_reader.c
dlls/winegstreamer/wm_reader.c
+39
-2
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+0
-22
No files found.
dlls/winegstreamer/wm_reader.c
View file @
782abff9
...
...
@@ -116,8 +116,18 @@ static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_M
static
HRESULT
WINAPI
output_props_SetMediaType
(
IWMOutputMediaProps
*
iface
,
WM_MEDIA_TYPE
*
mt
)
{
FIXME
(
"iface %p, mt %p, stub!
\n
"
,
iface
,
mt
);
return
E_NOTIMPL
;
const
struct
output_props
*
props
=
impl_from_IWMOutputMediaProps
(
iface
);
TRACE
(
"iface %p, mt %p.
\n
"
,
iface
,
mt
);
if
(
!
mt
)
return
E_POINTER
;
if
(
!
IsEqualGUID
(
&
props
->
mt
.
majortype
,
&
mt
->
majortype
))
return
E_FAIL
;
FreeMediaType
((
AM_MEDIA_TYPE
*
)
&
props
->
mt
);
return
CopyMediaType
((
AM_MEDIA_TYPE
*
)
&
props
->
mt
,
(
AM_MEDIA_TYPE
*
)
mt
);
}
static
HRESULT
WINAPI
output_props_GetStreamGroupName
(
IWMOutputMediaProps
*
iface
,
WCHAR
*
name
,
WORD
*
len
)
...
...
@@ -1754,6 +1764,7 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
struct
output_props
*
props
=
unsafe_impl_from_IWMOutputMediaProps
(
props_iface
);
struct
wg_format
format
,
pref_format
;
struct
wm_stream
*
stream
;
int
i
;
strmbase_dump_media_type
(
&
props
->
mt
);
...
...
@@ -1780,6 +1791,32 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
return
NS_E_INCOMPATIBLE_FORMAT
;
}
switch
(
pref_format
.
major_type
)
{
case
WG_MAJOR_TYPE_AUDIO
:
if
(
format
.
u
.
audio
.
format
==
WG_AUDIO_FORMAT_UNKNOWN
)
return
NS_E_AUDIO_CODEC_NOT_INSTALLED
;
if
(
format
.
u
.
audio
.
channels
>
pref_format
.
u
.
audio
.
channels
)
return
NS_E_AUDIO_CODEC_NOT_INSTALLED
;
break
;
case
WG_MAJOR_TYPE_VIDEO
:
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
video_formats
);
++
i
)
if
(
format
.
u
.
video
.
format
==
video_formats
[
i
])
break
;
if
(
i
==
ARRAY_SIZE
(
video_formats
))
return
NS_E_INVALID_OUTPUT_FORMAT
;
if
(
pref_format
.
u
.
video
.
width
!=
format
.
u
.
video
.
width
)
return
NS_E_INVALID_OUTPUT_FORMAT
;
if
(
pref_format
.
u
.
video
.
height
!=
format
.
u
.
video
.
height
)
return
NS_E_INVALID_OUTPUT_FORMAT
;
break
;
default:
return
NS_E_INCOMPATIBLE_FORMAT
;
}
stream
->
format
=
format
;
wg_parser_stream_enable
(
stream
->
wg_stream
,
&
format
);
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
782abff9
...
...
@@ -1295,12 +1295,10 @@ static void test_sync_reader_types(void)
debugstr_guid
(
&
majortype
),
debugstr_guid
(
&
majortype2
));
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"Got hr %#lx.
\n
"
,
hr
);
memset
(
mt2_buffer
,
0
,
sizeof
(
mt2_buffer
));
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
E_FAIL
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
IsEqualGUID
(
&
majortype
,
&
MEDIATYPE_Audio
))
...
...
@@ -1309,22 +1307,18 @@ static void test_sync_reader_types(void)
init_audio_type
(
mt2
,
&
MEDIASUBTYPE_IEEE_FLOAT
,
32
,
format
->
nChannels
*
2
,
format
->
nSamplesPerSec
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
todo_wine
ok
(
hr
==
NS_E_AUDIO_CODEC_NOT_INSTALLED
,
"Got hr %#lx.
\n
"
,
hr
);
init_audio_type
(
mt2
,
&
MEDIASUBTYPE_PCM
,
8
,
1
,
11025
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
init_audio_type
(
mt2
,
&
MEDIASUBTYPE_IEEE_FLOAT
,
32
,
format
->
nChannels
,
format
->
nSamplesPerSec
/
4
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
...
...
@@ -1336,14 +1330,12 @@ static void test_sync_reader_types(void)
init_video_type
(
mt2
,
&
MEDIASUBTYPE_RGB32
,
32
,
BI_RGB
,
&
rect
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
init_video_type
(
mt2
,
&
MEDIASUBTYPE_NV12
,
12
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
&
rect
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
todo_wine
...
...
@@ -1353,15 +1345,12 @@ static void test_sync_reader_types(void)
init_video_type
(
mt2
,
&
MEDIASUBTYPE_RGB32
,
32
,
BI_RGB
,
&
rect
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
todo_wine
ok
(
hr
==
NS_E_INVALID_OUTPUT_FORMAT
,
"Got hr %#lx.
\n
"
,
hr
);
}
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
...
...
@@ -2578,12 +2567,10 @@ static void test_async_reader_types(void)
debugstr_guid
(
&
majortype
),
debugstr_guid
(
&
majortype2
));
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"Got hr %#lx.
\n
"
,
hr
);
memset
(
mt2_buffer
,
0
,
sizeof
(
mt2_buffer
));
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
E_FAIL
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
IsEqualGUID
(
&
majortype
,
&
MEDIATYPE_Audio
))
...
...
@@ -2592,22 +2579,18 @@ static void test_async_reader_types(void)
init_audio_type
(
mt2
,
&
MEDIASUBTYPE_IEEE_FLOAT
,
32
,
format
->
nChannels
*
2
,
format
->
nSamplesPerSec
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
todo_wine
ok
(
hr
==
NS_E_AUDIO_CODEC_NOT_INSTALLED
,
"Got hr %#lx.
\n
"
,
hr
);
init_audio_type
(
mt2
,
&
MEDIASUBTYPE_PCM
,
8
,
1
,
11025
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
init_audio_type
(
mt2
,
&
MEDIASUBTYPE_IEEE_FLOAT
,
32
,
format
->
nChannels
,
format
->
nSamplesPerSec
/
4
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
...
...
@@ -2619,14 +2602,12 @@ static void test_async_reader_types(void)
init_video_type
(
mt2
,
&
MEDIASUBTYPE_RGB32
,
32
,
BI_RGB
,
&
rect
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
init_video_type
(
mt2
,
&
MEDIASUBTYPE_NV12
,
12
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
&
rect
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
todo_wine
...
...
@@ -2636,15 +2617,12 @@ static void test_async_reader_types(void)
init_video_type
(
mt2
,
&
MEDIASUBTYPE_RGB32
,
32
,
BI_RGB
,
&
rect
);
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
todo_wine
ok
(
hr
==
NS_E_INVALID_OUTPUT_FORMAT
,
"Got hr %#lx.
\n
"
,
hr
);
}
hr
=
IWMOutputMediaProps_SetMediaType
(
output_props
,
mt
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMReader_SetOutputProps
(
reader
,
output_number
,
output_props
);
ok
(
hr
==
S_OK
,
"Got 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