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
c752b561
Commit
c752b561
authored
May 04, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
May 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/audiorecord: Implement IAMStreamConfig::GetStreamCaps().
Needed by the Microsoft Silverlight configuration tool. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=36230
parent
fa323802
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
17 deletions
+55
-17
audiorecord.c
dlls/qcap/audiorecord.c
+41
-5
audiorecord.c
dlls/qcap/tests/audiorecord.c
+14
-12
No files found.
dlls/qcap/audiorecord.c
View file @
c752b561
...
...
@@ -174,15 +174,51 @@ static HRESULT WINAPI stream_config_GetFormat(IAMStreamConfig *iface, AM_MEDIA_T
static
HRESULT
WINAPI
stream_config_GetNumberOfCapabilities
(
IAMStreamConfig
*
iface
,
int
*
count
,
int
*
size
)
{
FIXME
(
"iface %p, count %p, size %p, stub!
\n
"
,
iface
,
count
,
size
);
return
E_NOTIMPL
;
struct
audio_record
*
filter
=
impl_from_IAMStreamConfig
(
iface
);
TRACE
(
"filter %p, count %p, size %p.
\n
"
,
filter
,
count
,
size
);
*
count
=
ARRAY_SIZE
(
audio_formats
);
*
size
=
sizeof
(
AUDIO_STREAM_CONFIG_CAPS
);
return
S_OK
;
}
static
HRESULT
WINAPI
stream_config_GetStreamCaps
(
IAMStreamConfig
*
iface
,
int
index
,
AM_MEDIA_TYPE
**
mt
,
BYTE
*
caps
)
int
index
,
AM_MEDIA_TYPE
**
ret_
mt
,
BYTE
*
caps
)
{
FIXME
(
"iface %p, index %d, mt %p, caps %p, stub!
\n
"
,
iface
,
index
,
mt
,
caps
);
return
E_NOTIMPL
;
struct
audio_record
*
filter
=
impl_from_IAMStreamConfig
(
iface
);
AUDIO_STREAM_CONFIG_CAPS
*
audio_caps
=
(
void
*
)
caps
;
AM_MEDIA_TYPE
*
mt
;
HRESULT
hr
;
TRACE
(
"filter %p, index %d, ret_mt %p, caps %p.
\n
"
,
filter
,
index
,
ret_mt
,
caps
);
if
(
index
>=
ARRAY_SIZE
(
audio_formats
))
return
S_FALSE
;
if
(
!
(
mt
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
))))
return
E_OUTOFMEMORY
;
if
((
hr
=
fill_media_type
(
index
,
mt
))
!=
S_OK
)
{
CoTaskMemFree
(
mt
);
return
hr
;
}
*
ret_mt
=
mt
;
audio_caps
->
guid
=
MEDIATYPE_Audio
;
audio_caps
->
MinimumChannels
=
1
;
audio_caps
->
MaximumChannels
=
2
;
audio_caps
->
ChannelsGranularity
=
1
;
audio_caps
->
MinimumBitsPerSample
=
8
;
audio_caps
->
MaximumBitsPerSample
=
16
;
audio_caps
->
BitsPerSampleGranularity
=
8
;
audio_caps
->
MinimumSampleFrequency
=
11025
;
audio_caps
->
MaximumSampleFrequency
=
44100
;
audio_caps
->
SampleFrequencyGranularity
=
11025
;
return
S_OK
;
}
static
const
IAMStreamConfigVtbl
stream_config_vtbl
=
...
...
dlls/qcap/tests/audiorecord.c
View file @
c752b561
...
...
@@ -482,9 +482,9 @@ static void test_stream_config(IBaseFilter *filter)
count
=
size
=
0xdeadbeef
;
hr
=
IAMStreamConfig_GetNumberOfCapabilities
(
config
,
&
count
,
&
size
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
count
&&
count
!=
0xdeadbeef
,
"Got count %d.
\n
"
,
count
);
todo_wine
ok
(
size
==
sizeof
(
AUDIO_STREAM_CONFIG_CAPS
),
"Got size %d.
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
count
&&
count
!=
0xdeadbeef
,
"Got count %d.
\n
"
,
count
);
ok
(
size
==
sizeof
(
AUDIO_STREAM_CONFIG_CAPS
),
"Got size %d.
\n
"
,
size
);
hr
=
IPin_EnumMediaTypes
(
source
,
&
enummt
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
...
...
@@ -518,9 +518,9 @@ static void test_stream_config(IBaseFilter *filter)
}
hr
=
IAMStreamConfig_GetStreamCaps
(
config
,
count
,
&
mt
,
(
BYTE
*
)
&
caps
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
mt2
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enummt
);
...
...
@@ -551,19 +551,21 @@ static void test_stream_config(IBaseFilter *filter)
winetest_push_context
(
"Caps %u"
,
i
);
hr
=
IAMStreamConfig_GetStreamCaps
(
config
,
i
,
&
mt
,
(
BYTE
*
)
&
caps
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IAMStreamConfig_SetFormat
(
config
,
mt
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IAMStreamConfig_GetFormat
(
config
,
&
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IAMStreamConfig_SetFormat
(
config
,
mt
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IAMStreamConfig_GetFormat
(
config
,
&
mt2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
compare_media_types
(
mt
,
mt2
),
"Media types didn't match.
\n
"
);
DeleteMediaType
(
mt2
);
DeleteMediaType
(
mt
);
}
DeleteMediaType
(
mt
);
winetest_pop_context
();
}
...
...
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