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
cfd4ed90
Commit
cfd4ed90
authored
Dec 01, 2010
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Dec 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Add quality control to sound renderer.
parent
072714f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
dsoundrender.c
dlls/quartz/dsoundrender.c
+29
-0
dsoundrender.c
dlls/quartz/tests/dsoundrender.c
+1
-1
No files found.
dlls/quartz/dsoundrender.c
View file @
cfd4ed90
...
...
@@ -53,6 +53,13 @@ static const IReferenceClockVtbl IReferenceClock_Vtbl;
static
const
IMediaSeekingVtbl
IMediaSeeking_Vtbl
;
static
const
IAMDirectSoundVtbl
IAMDirectSound_Vtbl
;
static
const
IAMFilterMiscFlagsVtbl
IAMFilterMiscFlags_Vtbl
;
static
const
IQualityControlVtbl
DSoundRender_QualityControl_Vtbl
=
{
QualityControlImpl_QueryInterface
,
QualityControlImpl_AddRef
,
QualityControlImpl_Release
,
QualityControlImpl_Notify
,
QualityControlImpl_SetSink
};
typedef
struct
DSoundRenderImpl
{
...
...
@@ -65,6 +72,7 @@ typedef struct DSoundRenderImpl
IUnknown
*
seekthru_unk
;
BaseInputPin
*
pInputPin
;
QualityControlImpl
qcimpl
;
IDirectSound8
*
dsound
;
LPDIRECTSOUNDBUFFER
dsbuffer
;
...
...
@@ -364,6 +372,21 @@ static HRESULT WINAPI DSoundRender_Receive(BaseInputPin *pin, IMediaSample * pSa
SetEvent
(
This
->
state_change
);
hr
=
DSoundRender_SendSampleData
(
This
,
tStart
,
tStop
,
pbSrcStream
,
cbSrcStream
);
if
(
This
->
filter
.
state
==
State_Running
&&
This
->
filter
.
pClock
&&
tStart
>=
0
)
{
REFERENCE_TIME
jitter
,
now
=
0
;
Quality
q
;
IReferenceClock_GetTime
(
This
->
filter
.
pClock
,
&
now
);
jitter
=
now
-
This
->
filter
.
rtStreamStart
-
tStart
;
if
(
jitter
<=
-
DSoundRenderer_Max_Fill
)
jitter
+=
DSoundRenderer_Max_Fill
;
else
if
(
jitter
<
0
)
jitter
=
0
;
q
.
Type
=
(
jitter
>
0
?
Famine
:
Flood
);
q
.
Proportion
=
1
.;
q
.
Late
=
jitter
;
q
.
TimeStamp
=
tStart
;
IQualityControl_Notify
((
IQualityControl
*
)
&
This
->
qcimpl
,
(
IBaseFilter
*
)
This
,
q
);
}
LeaveCriticalSection
(
&
This
->
filter
.
csFilter
);
return
hr
;
}
...
...
@@ -492,6 +515,8 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
IUnknown_QueryInterface
(
pDSoundRender
->
seekthru_unk
,
&
IID_ISeekingPassThru
,
(
void
**
)
&
passthru
);
ISeekingPassThru_Init
(
passthru
,
TRUE
,
(
IPin
*
)
pDSoundRender
->
pInputPin
);
ISeekingPassThru_Release
(
passthru
);
QualityControlImpl_init
(
&
pDSoundRender
->
qcimpl
,
(
IPin
*
)
pDSoundRender
->
pInputPin
,
(
IBaseFilter
*
)
pDSoundRender
);
pDSoundRender
->
qcimpl
.
lpVtbl
=
&
DSoundRender_QualityControl_Vtbl
;
*
ppv
=
pDSoundRender
;
}
else
...
...
@@ -530,6 +555,8 @@ static HRESULT WINAPI DSoundRender_QueryInterface(IBaseFilter * iface, REFIID ri
*
ppv
=
&
This
->
IAMDirectSound_vtbl
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IAMFilterMiscFlags
))
*
ppv
=
&
This
->
IAMFilterMiscFlags_vtbl
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IQualityControl
))
*
ppv
=
&
This
->
qcimpl
;
if
(
*
ppv
)
{
...
...
@@ -655,6 +682,7 @@ static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStar
if
(
This
->
pInputPin
->
pin
.
pConnectedTo
)
{
This
->
filter
.
rtStreamStart
=
tStart
;
QualityControlRender_Start
(
&
This
->
qcimpl
,
tStart
);
if
(
This
->
filter
.
state
==
State_Paused
)
{
/* Unblock our thread, state changing from paused to running doesn't need a reset for state change */
...
...
@@ -922,6 +950,7 @@ static HRESULT WINAPI DSoundRender_InputPin_EndFlush(IPin * iface)
IDirectSoundBuffer_Unlock
(
pFilter
->
dsbuffer
,
buffer
,
size
,
NULL
,
0
);
pFilter
->
writepos
=
pFilter
->
buf_size
;
}
QualityControlRender_Start
(
&
pFilter
->
qcimpl
,
pFilter
->
filter
.
rtStreamStart
);
hr
=
BaseInputPinImpl_EndFlush
(
iface
);
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
MediaSeekingPassThru_ResetMediaTime
(
pFilter
->
seekthru_unk
);
...
...
dlls/quartz/tests/dsoundrender.c
View file @
cfd4ed90
...
...
@@ -150,9 +150,9 @@ static void test_query_interface(void)
RELEASE_EXPECT
(
ppb
,
1
);
QI_SUCCEED
(
pDSRender
,
IID_IMediaPosition
,
pMediaPosition
);
RELEASE_EXPECT
(
pMediaPosition
,
1
);
}
QI_SUCCEED
(
pDSRender
,
IID_IQualityControl
,
pQualityControl
);
RELEASE_EXPECT
(
pQualityControl
,
1
);
}
}
static
void
test_pin
(
IPin
*
pin
)
...
...
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