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
13a65b84
Commit
13a65b84
authored
Feb 02, 2023
by
Ziqing Hui
Committed by
Alexandre Julliard
Feb 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/tests: Test output data for WMV decoder DMO.
parent
9d1b9279
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
2 deletions
+64
-2
transform.c
dlls/mf/tests/transform.c
+64
-2
No files found.
dlls/mf/tests/transform.c
View file @
13a65b84
...
@@ -1617,6 +1617,50 @@ static void check_dmo_set_output_type(IMediaObject *media_object, const GUID *su
...
@@ -1617,6 +1617,50 @@ static void check_dmo_set_output_type(IMediaObject *media_object, const GUID *su
}
}
}
}
#define check_dmo_output_data_buffer(a, b, c) check_dmo_output_data_buffer_(__LINE__, a, b, c)
static
DWORD
check_dmo_output_data_buffer_
(
int
line
,
DMO_OUTPUT_DATA_BUFFER
*
output_data_buffer
,
const
struct
sample_desc
*
sample_desc
,
const
WCHAR
*
expect_data_filename
)
{
const
struct
buffer_desc
*
buffer_desc
=
&
sample_desc
->
buffers
[
0
];
DWORD
diff
,
data_length
,
buffer_length
,
expect_length
;
BYTE
*
data
,
*
buffer
;
HRESULT
hr
;
if
(
output_data_buffer
->
dwStatus
&
DMO_OUTPUT_DATA_BUFFERF_TIME
)
ok_
(
__FILE__
,
line
)(
output_data_buffer
->
rtTimestamp
==
sample_desc
->
sample_time
,
"Unexpected time %I64d, expected %I64d.
\n
"
,
output_data_buffer
->
rtTimestamp
,
sample_desc
->
sample_time
);
if
(
output_data_buffer
->
dwStatus
&
DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH
)
ok_
(
__FILE__
,
line
)(
output_data_buffer
->
rtTimelength
==
sample_desc
->
sample_duration
,
"Unexpected duration %I64d, expected %I64d.
\n
"
,
output_data_buffer
->
rtTimelength
,
sample_desc
->
sample_duration
);
load_resource
(
expect_data_filename
,
(
const
BYTE
**
)
&
data
,
&
data_length
);
expect_length
=
buffer_desc
->
length
;
if
(
expect_length
==
-
1
)
{
expect_length
=
*
(
DWORD
*
)
data
;
data
+=
sizeof
(
DWORD
);
data_length
=
data_length
-
sizeof
(
DWORD
);
}
hr
=
IMediaBuffer_GetBufferAndLength
(
output_data_buffer
->
pBuffer
,
&
buffer
,
&
buffer_length
);
ok
(
hr
==
S_OK
,
"GetBufferAndLength returned %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
buffer_length
==
expect_length
,
"Unexpected length %#lx, expected %#lx
\n
"
,
buffer_length
,
expect_length
);
diff
=
0
;
if
(
data_length
<
buffer_length
)
ok_
(
__FILE__
,
line
)(
0
,
"Missing %#lx bytes
\n
"
,
buffer_length
-
data_length
);
else
if
(
!
buffer_desc
->
compare
)
diff
=
compare_bytes
(
buffer
,
&
buffer_length
,
NULL
,
data
);
else
diff
=
buffer_desc
->
compare
(
buffer
,
&
buffer_length
,
&
buffer_desc
->
rect
,
data
);
return
diff
;
}
static
HRESULT
WINAPI
test_unk_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
test_unk_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
{
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
...
@@ -5170,7 +5214,17 @@ static void test_wmv_decoder_media_object(void)
...
@@ -5170,7 +5214,17 @@ static void test_wmv_decoder_media_object(void)
};
};
const
DWORD
data_width
=
96
,
data_height
=
96
;
const
DWORD
data_width
=
96
,
data_height
=
96
;
const
POINT
test_size
[]
=
{{
16
,
16
},
{
96
,
96
},
{
320
,
240
}};
const
POINT
test_size
[]
=
{{
16
,
16
},
{
96
,
96
},
{
320
,
240
}};
DWORD
in_count
,
out_count
,
size
,
expected_size
,
alignment
,
wmv_data_length
,
status
;
const
struct
buffer_desc
output_buffer_desc_nv12
=
{
.
length
=
data_width
*
data_height
*
3
/
2
,
.
compare
=
compare_nv12
,
.
dump
=
dump_nv12
,
.
rect
=
{.
right
=
82
,
.
bottom
=
84
},
};
const
struct
sample_desc
output_sample_desc_nv12
=
{
.
sample_time
=
0
,
.
sample_duration
=
333333
,
.
buffer_count
=
1
,
.
buffers
=
&
output_buffer_desc_nv12
,
};
DWORD
in_count
,
out_count
,
size
,
expected_size
,
alignment
,
wmv_data_length
,
status
,
expected_status
,
diff
;
struct
media_buffer
*
input_media_buffer
=
NULL
,
*
output_media_buffer
=
NULL
;
struct
media_buffer
*
input_media_buffer
=
NULL
,
*
output_media_buffer
=
NULL
;
DMO_OUTPUT_DATA_BUFFER
output_data_buffer
;
DMO_OUTPUT_DATA_BUFFER
output_data_buffer
;
DMO_MEDIA_TYPE
media_type
,
*
type
;
DMO_MEDIA_TYPE
media_type
,
*
type
;
...
@@ -5315,7 +5369,7 @@ static void test_wmv_decoder_media_object(void)
...
@@ -5315,7 +5369,7 @@ static void test_wmv_decoder_media_object(void)
hr
=
IMediaObject_SetOutputType
(
media_object
,
0
,
type
,
0
);
hr
=
IMediaObject_SetOutputType
(
media_object
,
0
,
type
,
0
);
ok
(
hr
==
S_OK
,
"SetOutputType returned %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"SetOutputType returned %#lx.
\n
"
,
hr
);
hr
=
IMediaObject_ProcessInput
(
media_object
,
0
,
&
input_media_buffer
->
IMediaBuffer_iface
,
0
,
0
,
0
);
hr
=
IMediaObject_ProcessInput
(
media_object
,
0
,
&
input_media_buffer
->
IMediaBuffer_iface
,
0
,
0
,
333333
);
todo_wine
todo_wine
ok
(
hr
==
S_OK
,
"ProcessInput returned %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ProcessInput returned %#lx.
\n
"
,
hr
);
...
@@ -5331,6 +5385,14 @@ static void test_wmv_decoder_media_object(void)
...
@@ -5331,6 +5385,14 @@ static void test_wmv_decoder_media_object(void)
hr
=
IMediaObject_ProcessOutput
(
media_object
,
0
,
1
,
&
output_data_buffer
,
&
status
);
hr
=
IMediaObject_ProcessOutput
(
media_object
,
0
,
1
,
&
output_data_buffer
,
&
status
);
todo_wine
todo_wine
ok
(
hr
==
S_OK
,
"ProcessOutput returned %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ProcessOutput returned %#lx.
\n
"
,
hr
);
expected_status
=
DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT
|
DMO_OUTPUT_DATA_BUFFERF_TIME
|
DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH
;
todo_wine
ok
(
output_data_buffer
.
dwStatus
==
expected_status
,
"Got unexpected dwStatus %#lx.
\n
"
,
output_data_buffer
.
dwStatus
);
if
(
hr
==
S_OK
)
{
diff
=
check_dmo_output_data_buffer
(
&
output_data_buffer
,
&
output_sample_desc_nv12
,
L"nv12frame.bmp"
);
ok
(
diff
==
0
,
"Got %lu%% diff.
\n
"
,
diff
);
}
ret
=
IMediaBuffer_Release
(
&
output_media_buffer
->
IMediaBuffer_iface
);
ret
=
IMediaBuffer_Release
(
&
output_media_buffer
->
IMediaBuffer_iface
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
...
...
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