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
4205a441
Commit
4205a441
authored
Aug 15, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Aug 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: Implement IDsCaptureDriverImpl_Open.
parent
50b46daf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
dscapture.c
dlls/winealsa.drv/dscapture.c
+37
-2
No files found.
dlls/winealsa.drv/dscapture.c
View file @
4205a441
...
...
@@ -123,8 +123,43 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetDriverDesc(PIDSCDRIVER iface, PDSD
static
HRESULT
WINAPI
IDsCaptureDriverImpl_Open
(
PIDSCDRIVER
iface
)
{
FIXME
(
"stub
\n
"
);
return
DS_OK
;
HRESULT
hr
=
S_OK
;
IDsCaptureDriverImpl
*
This
=
(
IDsCaptureDriverImpl
*
)
iface
;
int
err
=
0
;
snd_pcm_t
*
pcm
=
NULL
;
snd_pcm_hw_params_t
*
hw_params
;
/* While this is not really needed, it is a good idea to do this,
* to see if sound can be initialized */
hw_params
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
snd_pcm_hw_params_sizeof
());
if
(
!
hw_params
)
{
hr
=
DSERR_OUTOFMEMORY
;
WARN
(
"--> %08x
\n
"
,
hr
);
return
hr
;
}
err
=
snd_pcm_open
(
&
pcm
,
WOutDev
[
This
->
wDevID
].
pcmname
,
SND_PCM_STREAM_CAPTURE
,
SND_PCM_NONBLOCK
);
if
(
err
<
0
)
goto
err
;
err
=
snd_pcm_hw_params_any
(
pcm
,
hw_params
);
if
(
err
<
0
)
goto
err
;
err
=
snd_pcm_hw_params_set_access
(
pcm
,
hw_params
,
SND_PCM_ACCESS_MMAP_INTERLEAVED
);
if
(
err
<
0
)
goto
err
;
TRACE
(
"Success
\n
"
);
snd_pcm_close
(
pcm
);
HeapFree
(
GetProcessHeap
(),
0
,
hw_params
);
return
hr
;
err:
hr
=
DSERR_GENERIC
;
WARN
(
"Failed to open device: %s
\n
"
,
snd_strerror
(
err
));
if
(
pcm
)
snd_pcm_close
(
pcm
);
HeapFree
(
GetProcessHeap
(),
0
,
hw_params
);
WARN
(
"--> %08x
\n
"
,
hr
);
return
hr
;
}
static
HRESULT
WINAPI
IDsCaptureDriverImpl_Close
(
PIDSCDRIVER
iface
)
...
...
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