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
d283051b
Commit
d283051b
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::SetFormat.
Signed-off-by:
Anton Baskanov
<
baskanov@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa542355
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
2 deletions
+85
-2
audiodata.c
dlls/amstream/audiodata.c
+16
-2
amstream.c
dlls/amstream/tests/amstream.c
+69
-0
No files found.
dlls/amstream/audiodata.c
View file @
d283051b
...
@@ -185,9 +185,23 @@ static HRESULT WINAPI IAudioDataImpl_GetFormat(IAudioData* iface, WAVEFORMATEX *
...
@@ -185,9 +185,23 @@ static HRESULT WINAPI IAudioDataImpl_GetFormat(IAudioData* iface, WAVEFORMATEX *
static
HRESULT
WINAPI
IAudioDataImpl_SetFormat
(
IAudioData
*
iface
,
const
WAVEFORMATEX
*
wave_format
)
static
HRESULT
WINAPI
IAudioDataImpl_SetFormat
(
IAudioData
*
iface
,
const
WAVEFORMATEX
*
wave_format
)
{
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
wave_format
);
AMAudioDataImpl
*
This
=
impl_from_IAudioData
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
wave_format
);
if
(
!
wave_format
)
{
return
E_POINTER
;
}
return
E_NOTIMPL
;
if
(
WAVE_FORMAT_PCM
!=
wave_format
->
wFormatTag
)
{
return
E_INVALIDARG
;
}
This
->
wave_format
=
*
wave_format
;
return
S_OK
;
}
}
static
const
struct
IAudioDataVtbl
AudioData_Vtbl
=
static
const
struct
IAudioDataVtbl
AudioData_Vtbl
=
...
...
dlls/amstream/tests/amstream.c
View file @
d283051b
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
#include "uuids.h"
#include "uuids.h"
#include "amstream.h"
#include "amstream.h"
#include "vfwmsgs.h"
#include "vfwmsgs.h"
#include "mmreg.h"
#include "ks.h"
#include "ksmedia.h"
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
static
void
_expect_ref
(
IUnknown
*
obj
,
ULONG
ref
,
int
line
)
static
void
_expect_ref
(
IUnknown
*
obj
,
ULONG
ref
,
int
line
)
...
@@ -787,6 +790,71 @@ out_unknown:
...
@@ -787,6 +790,71 @@ out_unknown:
IUnknown_Release
(
unknown
);
IUnknown_Release
(
unknown
);
}
}
static
void
test_audiodata_set_format
(
void
)
{
IUnknown
*
unknown
=
create_audio_data
();
IAudioData
*
audio_data
=
NULL
;
WAVEFORMATPCMEX
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_SetFormat
(
audio_data
,
NULL
);
ok
(
E_POINTER
==
result
,
"got 0x%08x
\n
"
,
result
);
wave_format
.
Format
.
wFormatTag
=
WAVE_FORMAT_EXTENSIBLE
;
wave_format
.
Format
.
nChannels
=
2
;
wave_format
.
Format
.
nSamplesPerSec
=
44100
;
wave_format
.
Format
.
nAvgBytesPerSec
=
176400
;
wave_format
.
Format
.
nBlockAlign
=
4
;
wave_format
.
Format
.
wBitsPerSample
=
16
;
wave_format
.
Format
.
cbSize
=
22
;
wave_format
.
Samples
.
wValidBitsPerSample
=
16
;
wave_format
.
dwChannelMask
=
KSAUDIO_SPEAKER_STEREO
;
wave_format
.
SubFormat
=
KSDATAFORMAT_SUBTYPE_PCM
;
result
=
IAudioData_SetFormat
(
audio_data
,
&
wave_format
.
Format
);
ok
(
E_INVALIDARG
==
result
,
"got 0x%08x
\n
"
,
result
);
wave_format
.
Format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
wave_format
.
Format
.
nChannels
=
2
;
wave_format
.
Format
.
nSamplesPerSec
=
44100
;
wave_format
.
Format
.
nAvgBytesPerSec
=
176400
;
wave_format
.
Format
.
nBlockAlign
=
4
;
wave_format
.
Format
.
wBitsPerSample
=
16
;
wave_format
.
Format
.
cbSize
=
0
;
result
=
IAudioData_SetFormat
(
audio_data
,
&
wave_format
.
Format
);
ok
(
S_OK
==
result
,
"got 0x%08x
\n
"
,
result
);
wave_format
.
Format
.
wFormatTag
=
0xdead
;
wave_format
.
Format
.
nChannels
=
0xdead
;
wave_format
.
Format
.
nSamplesPerSec
=
0xdeadbeef
;
wave_format
.
Format
.
nAvgBytesPerSec
=
0xdeadbeef
;
wave_format
.
Format
.
nBlockAlign
=
0xdead
;
wave_format
.
Format
.
wBitsPerSample
=
0xdead
;
wave_format
.
Format
.
cbSize
=
0xdead
;
result
=
IAudioData_GetFormat
(
audio_data
,
&
wave_format
.
Format
);
ok
(
S_OK
==
result
,
"got 0x%08x
\n
"
,
result
);
ok
(
WAVE_FORMAT_PCM
==
wave_format
.
Format
.
wFormatTag
,
"got %u
\n
"
,
wave_format
.
Format
.
wFormatTag
);
ok
(
2
==
wave_format
.
Format
.
nChannels
,
"got %u
\n
"
,
wave_format
.
Format
.
nChannels
);
ok
(
44100
==
wave_format
.
Format
.
nSamplesPerSec
,
"got %u
\n
"
,
wave_format
.
Format
.
nSamplesPerSec
);
ok
(
176400
==
wave_format
.
Format
.
nAvgBytesPerSec
,
"got %u
\n
"
,
wave_format
.
Format
.
nAvgBytesPerSec
);
ok
(
4
==
wave_format
.
Format
.
nBlockAlign
,
"got %u
\n
"
,
wave_format
.
Format
.
nBlockAlign
);
ok
(
16
==
wave_format
.
Format
.
wBitsPerSample
,
"got %u
\n
"
,
wave_format
.
Format
.
wBitsPerSample
);
ok
(
0
==
wave_format
.
Format
.
cbSize
,
"got %u
\n
"
,
wave_format
.
Format
.
cbSize
);
IAudioData_Release
(
audio_data
);
out_unknown:
IUnknown_Release
(
unknown
);
}
START_TEST
(
amstream
)
START_TEST
(
amstream
)
{
{
HANDLE
file
;
HANDLE
file
;
...
@@ -810,6 +878,7 @@ START_TEST(amstream)
...
@@ -810,6 +878,7 @@ START_TEST(amstream)
test_audiodata_set_buffer
();
test_audiodata_set_buffer
();
test_audiodata_set_actual
();
test_audiodata_set_actual
();
test_audiodata_get_format
();
test_audiodata_get_format
();
test_audiodata_set_format
();
CoUninitialize
();
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