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
802a3b6f
Commit
802a3b6f
authored
Sep 22, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/tests: Add some AAC decoder MFT decoding tests.
parent
cc8569dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
1 deletion
+86
-1
aacdecdata.bin
dlls/mf/tests/aacdecdata.bin
+0
-0
resource.rc
dlls/mf/tests/resource.rc
+3
-0
transform.c
dlls/mf/tests/transform.c
+83
-1
No files found.
dlls/mf/tests/aacdecdata.bin
0 → 100644
View file @
802a3b6f
File added
dlls/mf/tests/resource.rc
View file @
802a3b6f
...
...
@@ -29,6 +29,9 @@ audioconvdata.bin RCDATA audioconvdata.bin
/* @makedep: aacencdata.bin */
aacencdata.bin RCDATA aacencdata.bin
/* @makedep: aacdecdata.bin */
aacdecdata.bin RCDATA aacdecdata.bin
/* @makedep: wmaencdata.bin */
wmaencdata.bin RCDATA wmaencdata.bin
...
...
dlls/mf/tests/transform.c
View file @
802a3b6f
...
...
@@ -1889,11 +1889,33 @@ static void test_aac_decoder(void)
MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE
|
MFT_INPUT_STREAM_HOLDS_BUFFERS
,
};
const
struct
buffer_desc
output_buffer_desc
[]
=
{
{.
length
=
0x800
},
};
const
struct
attribute_desc
output_sample_attributes
[]
=
{
ATTR_UINT32
(
MFSampleExtension_CleanPoint
,
1
),
{
0
},
};
const
struct
sample_desc
output_sample_desc
[]
=
{
{
.
attributes
=
output_sample_attributes
+
(
has_video_processor
?
0
:
1
)
/* MFSampleExtension_CleanPoint missing on Win7 */
,
.
sample_time
=
0
,
.
sample_duration
=
232200
,
.
buffer_count
=
1
,
.
buffers
=
output_buffer_desc
,
},
};
MFT_REGISTER_TYPE_INFO
output_type
=
{
MFMediaType_Audio
,
MFAudioFormat_Float
};
MFT_REGISTER_TYPE_INFO
input_type
=
{
MFMediaType_Audio
,
MFAudioFormat_AAC
};
IMFSample
*
input_sample
,
*
output_sample
;
ULONG
i
,
ret
,
ref
,
aacenc_data_len
;
IMFCollection
*
output_samples
;
DWORD
length
,
output_status
;
IMFMediaType
*
media_type
;
IMFTransform
*
transform
;
ULONG
i
,
ret
;
const
BYTE
*
aacenc_data
;
HRESULT
hr
;
hr
=
CoInitialize
(
NULL
);
...
...
@@ -1974,6 +1996,66 @@ static void test_aac_decoder(void)
check_mft_get_input_stream_info
(
transform
,
&
input_info
);
check_mft_get_output_stream_info
(
transform
,
&
output_info
);
load_resource
(
L"aacencdata.bin"
,
&
aacenc_data
,
&
aacenc_data_len
);
ok
(
aacenc_data_len
==
24861
,
"got length %lu
\n
"
,
aacenc_data_len
);
input_sample
=
create_sample
(
aacenc_data
+
sizeof
(
DWORD
),
*
(
DWORD
*
)
aacenc_data
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
S_OK
,
"ProcessInput returned %#lx
\n
"
,
hr
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
/* As output_info.dwFlags doesn't have MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES
* IMFTransform_ProcessOutput needs a sample or returns MF_E_TRANSFORM_NEED_MORE_INPUT */
hr
=
check_mft_process_output
(
transform
,
NULL
,
&
output_status
);
ok
(
hr
==
E_INVALIDARG
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
ok
(
output_status
==
0
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
hr
=
IMFTransform_ProcessMessage
(
transform
,
MFT_MESSAGE_COMMAND_DRAIN
,
0
);
ok
(
hr
==
S_OK
,
"ProcessMessage returned %#lx
\n
"
,
hr
);
hr
=
IMFTransform_ProcessInput
(
transform
,
0
,
input_sample
,
0
);
ok
(
hr
==
MF_E_NOTACCEPTING
,
"ProcessInput returned %#lx
\n
"
,
hr
);
hr
=
MFCreateCollection
(
&
output_samples
);
ok
(
hr
==
S_OK
,
"MFCreateCollection returned %#lx
\n
"
,
hr
);
output_sample
=
create_sample
(
NULL
,
output_info
.
cbSize
);
for
(
i
=
0
;
SUCCEEDED
(
hr
=
check_mft_process_output
(
transform
,
output_sample
,
&
output_status
));
i
++
)
{
winetest_push_context
(
"%lu"
,
i
);
ok
(
hr
==
S_OK
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
hr
=
IMFCollection_AddElement
(
output_samples
,
(
IUnknown
*
)
output_sample
);
ok
(
hr
==
S_OK
,
"AddElement returned %#lx
\n
"
,
hr
);
ref
=
IMFSample_Release
(
output_sample
);
ok
(
ref
==
1
,
"Release returned %ld
\n
"
,
ref
);
output_sample
=
create_sample
(
NULL
,
output_info
.
cbSize
);
winetest_pop_context
();
}
ok
(
hr
==
MF_E_TRANSFORM_NEED_MORE_INPUT
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
ok
(
output_status
==
MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
ret
=
IMFSample_Release
(
output_sample
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
ok
(
i
==
1
,
"got %lu output samples
\n
"
,
i
);
ret
=
check_mf_sample_collection
(
output_samples
,
output_sample_desc
,
L"aacdecdata.bin"
);
ok
(
ret
==
0
,
"got %lu%% diff
\n
"
,
ret
);
IMFCollection_Release
(
output_samples
);
output_sample
=
create_sample
(
NULL
,
output_info
.
cbSize
);
hr
=
check_mft_process_output
(
transform
,
output_sample
,
&
output_status
);
ok
(
hr
==
MF_E_TRANSFORM_NEED_MORE_INPUT
,
"ProcessOutput returned %#lx
\n
"
,
hr
);
ok
(
output_status
==
MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE
,
"got output[0].dwStatus %#lx
\n
"
,
output_status
);
hr
=
IMFSample_GetTotalLength
(
output_sample
,
&
length
);
ok
(
hr
==
S_OK
,
"GetTotalLength returned %#lx
\n
"
,
hr
);
ok
(
length
==
0
,
"got length %lu
\n
"
,
length
);
ret
=
IMFSample_Release
(
output_sample
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
ret
=
IMFSample_Release
(
input_sample
);
ok
(
ret
==
0
,
"Release returned %lu
\n
"
,
ret
);
ret
=
IMFTransform_Release
(
transform
);
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