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
c5700a63
Commit
c5700a63
authored
Nov 23, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
Dec 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement media_object_SetInputType for WMV decoder.
parent
3e5d683c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
17 deletions
+37
-17
transform.c
dlls/mf/tests/transform.c
+0
-15
wmv_decoder.c
dlls/winegstreamer/wmv_decoder.c
+37
-2
No files found.
dlls/mf/tests/transform.c
View file @
c5700a63
...
...
@@ -4669,10 +4669,8 @@ static void test_wmv_decoder_media_object(void)
/* Test setting the type. */
init_dmo_media_type_video
(
input_type
,
subtype
,
96
,
96
);
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
dwBitRate
=
0xdeadbeef
;
header
->
dwBitErrorRate
=
0xdeadbeef
;
...
...
@@ -4683,41 +4681,35 @@ static void test_wmv_decoder_media_object(void)
header
->
bmiHeader
.
biXPelsPerMeter
=
0xdead
;
header
->
bmiHeader
.
biYPelsPerMeter
=
0xdead
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test invalid major type. */
init_dmo_media_type_video
(
input_type
,
subtype
,
96
,
96
);
input_type
->
majortype
=
MFMediaType_Default
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test invalid subtype. */
init_dmo_media_type_video
(
input_type
,
&
MEDIASUBTYPE_None
,
96
,
96
);
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test invalid format type. */
init_dmo_media_type_video
(
input_type
,
subtype
,
96
,
96
);
input_type
->
formattype
=
FORMAT_None
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test invalid format size. */
init_dmo_media_type_video
(
input_type
,
subtype
,
96
,
96
);
input_type
->
cbFormat
=
1
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test NULL format pointer. */
init_dmo_media_type_video
(
input_type
,
subtype
,
96
,
96
);
input_type
->
pbFormat
=
NULL
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test video header struct size. */
...
...
@@ -4751,7 +4743,6 @@ static void test_wmv_decoder_media_object(void)
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
bmiHeader
.
biWidth
=
4096
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test height. */
...
...
@@ -4766,11 +4757,9 @@ static void test_wmv_decoder_media_object(void)
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
bmiHeader
.
biHeight
=
4096
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
bmiHeader
.
biHeight
=
-
4096
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
/* Test compression. */
...
...
@@ -4781,15 +4770,12 @@ static void test_wmv_decoder_media_object(void)
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
bmiHeader
.
biCompression
=
1
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
bmiHeader
.
biCompression
=
2
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
header
->
bmiHeader
.
biCompression
=
0xdeadbeef
;
hr
=
IMediaObject_SetInputType
(
media_object
,
0
,
input_type
,
DMO_SET_TYPEF_TEST_ONLY
);
todo_wine
ok
(
hr
==
S_OK
,
"SetInputType returned unexpected hr %#lx.
\n
"
,
hr
);
winetest_pop_context
();
...
...
@@ -4813,7 +4799,6 @@ static void test_wmv_decoder_media_object(void)
type
=
NULL
;
hr
=
IMediaObject_SetInputType
(
media_object
,
test
->
stream_index
,
type
,
test
->
flags
);
todo_wine
ok
(
hr
==
test
->
hr
,
"SetInputType returned unexpected hr %#lx, expected %#lx.
\n
"
,
hr
,
test
->
hr
);
winetest_pop_context
();
...
...
dlls/winegstreamer/wmv_decoder.c
View file @
c5700a63
...
...
@@ -55,6 +55,8 @@ struct wmv_decoder
IPropertyStore
IPropertyStore_iface
;
IUnknown
*
outer
;
LONG
refcount
;
struct
wg_format
input_format
;
};
static
inline
struct
wmv_decoder
*
impl_from_IUnknown
(
IUnknown
*
iface
)
...
...
@@ -392,8 +394,41 @@ static HRESULT WINAPI media_object_GetOutputType(IMediaObject *iface, DWORD inde
static
HRESULT
WINAPI
media_object_SetInputType
(
IMediaObject
*
iface
,
DWORD
index
,
const
DMO_MEDIA_TYPE
*
type
,
DWORD
flags
)
{
FIXME
(
"iface %p, index %lu, type %p, flags %#lx stub!
\n
"
,
iface
,
index
,
type
,
flags
);
return
E_NOTIMPL
;
struct
wmv_decoder
*
decoder
=
impl_from_IMediaObject
(
iface
);
struct
wg_format
wg_format
;
unsigned
int
i
;
TRACE
(
"iface %p, index %lu, type %p, flags %#lx.
\n
"
,
iface
,
index
,
type
,
flags
);
if
(
index
>
0
)
return
DMO_E_INVALIDSTREAMINDEX
;
if
(
!
type
)
{
if
(
flags
&
DMO_SET_TYPEF_CLEAR
)
{
memset
(
&
decoder
->
input_format
,
0
,
sizeof
(
decoder
->
input_format
));
return
S_OK
;
}
return
DMO_E_TYPE_NOT_ACCEPTED
;
}
if
(
!
IsEqualGUID
(
&
type
->
majortype
,
&
MEDIATYPE_Video
))
return
DMO_E_TYPE_NOT_ACCEPTED
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
wmv_decoder_input_types
);
++
i
)
if
(
IsEqualGUID
(
&
type
->
subtype
,
wmv_decoder_input_types
[
i
]))
break
;
if
(
i
==
ARRAY_SIZE
(
wmv_decoder_input_types
))
return
DMO_E_TYPE_NOT_ACCEPTED
;
if
(
!
amt_to_wg_format
((
const
AM_MEDIA_TYPE
*
)
type
,
&
wg_format
))
return
DMO_E_TYPE_NOT_ACCEPTED
;
if
(
!
(
flags
&
DMO_SET_TYPEF_TEST_ONLY
))
decoder
->
input_format
=
wg_format
;
return
S_OK
;
}
static
HRESULT
WINAPI
media_object_SetOutputType
(
IMediaObject
*
iface
,
DWORD
index
,
...
...
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