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
fa542355
Commit
fa542355
authored
Jul 28, 2016
by
Anton Baskanov
Committed by
Alexandre Julliard
Aug 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Implement AMAudioData::GetFormat.
Signed-off-by:
Anton Baskanov
<
baskanov@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
634deaf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
audiodata.c
dlls/amstream/audiodata.c
+19
-2
amstream.c
dlls/amstream/tests/amstream.c
+43
-0
No files found.
dlls/amstream/audiodata.c
View file @
fa542355
...
...
@@ -34,6 +34,7 @@ typedef struct {
BYTE
*
data
;
BOOL
data_owned
;
DWORD
actual_data
;
WAVEFORMATEX
wave_format
;
}
AMAudioDataImpl
;
static
inline
AMAudioDataImpl
*
impl_from_IAudioData
(
IAudioData
*
iface
)
...
...
@@ -168,9 +169,18 @@ static HRESULT WINAPI IAudioDataImpl_SetActual(IAudioData* iface, DWORD data_val
/*** IAudioData methods ***/
static
HRESULT
WINAPI
IAudioDataImpl_GetFormat
(
IAudioData
*
iface
,
WAVEFORMATEX
*
wave_format_current
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
wave_format_current
);
AMAudioDataImpl
*
This
=
impl_from_IAudioData
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
wave_format_current
);
if
(
!
wave_format_current
)
{
return
E_POINTER
;
}
*
wave_format_current
=
This
->
wave_format
;
return
S_OK
;
}
static
HRESULT
WINAPI
IAudioDataImpl_SetFormat
(
IAudioData
*
iface
,
const
WAVEFORMATEX
*
wave_format
)
...
...
@@ -211,6 +221,13 @@ HRESULT AMAudioData_create(IUnknown *pUnkOuter, LPVOID *ppObj)
object
->
IAudioData_iface
.
lpVtbl
=
&
AudioData_Vtbl
;
object
->
ref
=
1
;
object
->
wave_format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
object
->
wave_format
.
nChannels
=
1
;
object
->
wave_format
.
nSamplesPerSec
=
11025
;
object
->
wave_format
.
wBitsPerSample
=
16
;
object
->
wave_format
.
nBlockAlign
=
object
->
wave_format
.
wBitsPerSample
*
object
->
wave_format
.
nChannels
/
8
;
object
->
wave_format
.
nAvgBytesPerSec
=
object
->
wave_format
.
nBlockAlign
*
object
->
wave_format
.
nSamplesPerSec
;
*
ppObj
=
&
object
->
IAudioData_iface
;
return
S_OK
;
...
...
dlls/amstream/tests/amstream.c
View file @
fa542355
...
...
@@ -745,6 +745,48 @@ out_unknown:
IUnknown_Release
(
unknown
);
}
static
void
test_audiodata_get_format
(
void
)
{
IUnknown
*
unknown
=
create_audio_data
();
IAudioData
*
audio_data
=
NULL
;
WAVEFORMATEX
wave_format
=
{
0
};
HRESULT
result
;
result
=
IUnknown_QueryInterface
(
unknown
,
&
IID_IAudioData
,
(
void
**
)
&
audio_data
);
if
(
FAILED
(
result
))
{
/* test_audiodata_query_interface handles this case */
skip
(
"No IAudioData
\n
"
);
goto
out_unknown
;
}
result
=
IAudioData_GetFormat
(
audio_data
,
NULL
);
ok
(
E_POINTER
==
result
,
"got 0x%08x
\n
"
,
result
);
wave_format
.
wFormatTag
=
0xdead
;
wave_format
.
nChannels
=
0xdead
;
wave_format
.
nSamplesPerSec
=
0xdeadbeef
;
wave_format
.
nAvgBytesPerSec
=
0xdeadbeef
;
wave_format
.
nBlockAlign
=
0xdead
;
wave_format
.
wBitsPerSample
=
0xdead
;
wave_format
.
cbSize
=
0xdead
;
result
=
IAudioData_GetFormat
(
audio_data
,
&
wave_format
);
ok
(
S_OK
==
result
,
"got 0x%08x
\n
"
,
result
);
ok
(
WAVE_FORMAT_PCM
==
wave_format
.
wFormatTag
,
"got %u
\n
"
,
wave_format
.
wFormatTag
);
ok
(
1
==
wave_format
.
nChannels
,
"got %u
\n
"
,
wave_format
.
nChannels
);
ok
(
11025
==
wave_format
.
nSamplesPerSec
,
"got %u
\n
"
,
wave_format
.
nSamplesPerSec
);
ok
(
22050
==
wave_format
.
nAvgBytesPerSec
,
"got %u
\n
"
,
wave_format
.
nAvgBytesPerSec
);
ok
(
2
==
wave_format
.
nBlockAlign
,
"got %u
\n
"
,
wave_format
.
nBlockAlign
);
ok
(
16
==
wave_format
.
wBitsPerSample
,
"got %u
\n
"
,
wave_format
.
wBitsPerSample
);
ok
(
0
==
wave_format
.
cbSize
,
"got %u
\n
"
,
wave_format
.
cbSize
);
IAudioData_Release
(
audio_data
);
out_unknown:
IUnknown_Release
(
unknown
);
}
START_TEST
(
amstream
)
{
HANDLE
file
;
...
...
@@ -767,6 +809,7 @@ START_TEST(amstream)
test_audiodata_get_info
();
test_audiodata_set_buffer
();
test_audiodata_set_actual
();
test_audiodata_get_format
();
CoUninitialize
();
}
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