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
b8ffb493
Commit
b8ffb493
authored
Aug 16, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Merge the DirectSoundCapture create functions.
parent
4cebe9e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
70 deletions
+29
-70
capture.c
dlls/dsound/capture.c
+24
-65
dsound_main.c
dlls/dsound/dsound_main.c
+2
-2
dsound_private.h
dlls/dsound/dsound_private.h
+2
-2
duplex.c
dlls/dsound/duplex.c
+1
-1
No files found.
dlls/dsound/capture.c
View file @
b8ffb493
...
...
@@ -1000,6 +1000,7 @@ struct IDirectSoundCaptureImpl
IDirectSoundCapture
IDirectSoundCapture_iface
;
LONG
ref
;
DirectSoundCaptureDevice
*
device
;
BOOL
has_dsc8
;
};
static
inline
struct
IDirectSoundCaptureImpl
*
impl_from_IDirectSoundCapture
(
IDirectSoundCapture
*
iface
)
...
...
@@ -1161,83 +1162,41 @@ static const IDirectSoundCaptureVtbl dscvt =
IDirectSoundCaptureImpl_Initialize
};
static
HRESULT
IDirectSoundCaptureImpl_Create
(
LPDIRECTSOUNDCAPTURE8
*
ppDSC
)
static
HRESULT
IDirectSoundCaptureImpl_Create
(
REFIID
riid
,
void
**
ppv
,
BOOL
has_dsc8
)
{
IDirectSoundCaptureImpl
*
pDSC
;
TRACE
(
"(%p)
\n
"
,
ppDSC
)
;
IDirectSoundCaptureImpl
*
obj
;
HRESULT
hr
;
/* Allocate memory */
pDSC
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectSoundCaptureImpl
));
if
(
pDSC
==
NULL
)
{
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
obj
));
if
(
obj
==
NULL
)
{
WARN
(
"out of memory
\n
"
);
*
ppDSC
=
NULL
;
return
DSERR_OUTOFMEMORY
;
}
pDSC
->
IDirectSoundCapture_iface
.
lpVtbl
=
&
dscvt
;
pDSC
->
ref
=
0
;
pDSC
->
device
=
NULL
;
*
ppDSC
=
(
LPDIRECTSOUNDCAPTURE8
)
pDSC
;
return
DS_OK
;
}
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
IDirectSoundCapture
**
ppDSC
)
{
IDirectSoundCapture
*
pDSC
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDSC
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSoundCapture
))
{
*
ppDSC
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
hr
=
IDirectSoundCaptureImpl_Create
(
&
pDSC
);
if
(
hr
==
DS_OK
)
{
IDirectSoundCapture_AddRef
(
pDSC
);
*
ppDSC
=
pDSC
;
}
else
{
WARN
(
"IDirectSoundCaptureImpl_Create failed
\n
"
);
*
ppDSC
=
0
;
}
obj
->
IDirectSoundCapture_iface
.
lpVtbl
=
&
dscvt
;
obj
->
ref
=
1
;
obj
->
device
=
NULL
;
obj
->
has_dsc8
=
has_dsc8
;
hr
=
IDirectSoundCapture_QueryInterface
(
&
obj
->
IDirectSoundCapture_iface
,
riid
,
ppv
);
IDirectSoundCapture_Release
(
&
obj
->
IDirectSoundCapture_iface
);
return
hr
;
}
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE8
*
ppDSC8
)
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
void
**
ppv
)
{
LPDIRECTSOUNDCAPTURE8
pDSC8
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
ppDSC8
);
if
(
!
IsEqualIID
(
riid
,
&
IID_IUnknown
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDirectSoundCapture8
))
{
*
ppDSC8
=
0
;
return
E_NOINTERFACE
;
}
/* Get dsound configuration */
setup_dsound_options
();
hr
=
IDirectSoundCaptureImpl_Create
(
&
pDSC8
);
if
(
hr
==
DS_OK
)
{
IDirectSoundCapture_AddRef
(
pDSC8
);
*
ppDSC8
=
pDSC8
;
}
else
{
WARN
(
"IDirectSoundCaptureImpl_Create failed
\n
"
);
*
ppDSC8
=
0
;
}
return
IDirectSoundCaptureImpl_Create
(
riid
,
ppv
,
FALSE
);
}
return
hr
;
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
void
**
ppv
)
{
return
IDirectSoundCaptureImpl_Create
(
riid
,
ppv
,
TRUE
);
}
/***************************************************************************
...
...
@@ -1280,7 +1239,7 @@ HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpcGUID, IDirectSoundCapture **p
return
DSERR_NOAGGREGATION
;
}
hr
=
DSOUND_CaptureCreate
(
&
IID_IDirectSoundCapture
,
&
pDSC
);
hr
=
DSOUND_CaptureCreate
(
&
IID_IDirectSoundCapture
,
(
void
**
)
&
pDSC
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSoundCapture_Initialize
(
pDSC
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
...
...
@@ -1336,7 +1295,7 @@ HRESULT WINAPI DirectSoundCaptureCreate8(
return
DSERR_NOAGGREGATION
;
}
hr
=
DSOUND_CaptureCreate8
(
&
IID_IDirectSoundCapture8
,
&
pDSC8
);
hr
=
DSOUND_CaptureCreate8
(
&
IID_IDirectSoundCapture8
,
(
void
**
)
&
pDSC8
);
if
(
hr
==
DS_OK
)
{
hr
=
IDirectSoundCapture_Initialize
(
pDSC8
,
lpcGUID
);
if
(
hr
!=
DS_OK
)
{
...
...
dlls/dsound/dsound_main.c
View file @
b8ffb493
...
...
@@ -721,8 +721,8 @@ static const IClassFactoryVtbl DSCF_Vtbl = {
static
IClassFactoryImpl
DSOUND_CF
[]
=
{
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound
,
DSOUND_Create
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSound8
,
DSOUND_Create8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture
,
(
FnCreateInstance
)
DSOUND_CaptureCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture8
,
(
FnCreateInstance
)
DSOUND_CaptureCreate8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture
,
DSOUND_CaptureCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundCapture8
,
DSOUND_CaptureCreate8
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundFullDuplex
,
(
FnCreateInstance
)
DSOUND_FullDuplexCreate
},
{
{
&
DSCF_Vtbl
},
&
CLSID_DirectSoundPrivate
,
(
FnCreateInstance
)
IKsPrivatePropertySetImpl_Create
},
{
{
NULL
},
NULL
,
NULL
}
...
...
dlls/dsound/dsound_private.h
View file @
b8ffb493
...
...
@@ -299,8 +299,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN;
/* capture.c */
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE
*
ppDSC
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
LPDIRECTSOUNDCAPTURE8
*
ppDSC8
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_CaptureCreate
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_CaptureCreate8
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
#define STATE_STOPPED 0
#define STATE_STARTING 1
...
...
dlls/dsound/duplex.c
View file @
b8ffb493
...
...
@@ -578,7 +578,7 @@ IDirectSoundFullDuplexImpl_Initialize(
return
hr
;
}
hr
=
DSOUND_CaptureCreate8
(
&
IID_IDirectSoundCapture8
,
&
This
->
capture_device
);
hr
=
DSOUND_CaptureCreate8
(
&
IID_IDirectSoundCapture8
,
(
void
**
)
&
This
->
capture_device
);
if
(
SUCCEEDED
(
hr
))
hr
=
IDirectSoundCapture_Initialize
(
This
->
capture_device
,
pCaptureGuid
);
if
(
hr
!=
DS_OK
)
{
...
...
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