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
a9fbbda4
Commit
a9fbbda4
authored
Jul 17, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Store the quality control object directly in strmbase_renderer.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
461a928f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
47 deletions
+29
-47
qualitycontrol.c
dlls/strmbase/qualitycontrol.c
+5
-17
renderer.c
dlls/strmbase/renderer.c
+7
-9
strmbase_private.h
dlls/strmbase/strmbase_private.h
+0
-18
strmbase.h
include/wine/strmbase.h
+17
-3
No files found.
dlls/strmbase/qualitycontrol.c
View file @
a9fbbda4
...
...
@@ -27,11 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
strmbase_qc
);
void
QualityControlImpl_Destroy
(
struct
strmbase_qc
*
This
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
inline
struct
strmbase_qc
*
impl_from_IQualityControl
(
IQualityControl
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
strmbase_qc
,
IQualityControl_iface
);
...
...
@@ -313,17 +308,10 @@ void QualityControlRender_EndRender(struct strmbase_qc *This)
This
->
avg_render
=
UPDATE_RUNNING_AVG
(
This
->
avg_render
,
elapsed
);
}
HRESULT
QualityControlImpl_Create
(
struct
strmbase_pin
*
pin
,
struct
strmbase_qc
**
ppv
)
void
strmbase_qc_init
(
struct
strmbase_qc
*
qc
,
struct
strmbase_pin
*
pin
)
{
struct
strmbase_qc
*
This
;
*
ppv
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
strmbase_qc
));
if
(
!*
ppv
)
return
E_OUTOFMEMORY
;
This
=
*
ppv
;
This
->
pin
=
pin
;
This
->
tonotify
=
NULL
;
This
->
current_rstart
=
This
->
current_rstop
=
-
1
;
This
->
IQualityControl_iface
.
lpVtbl
=
&
quality_control_vtbl
;
TRACE
(
"-> %p
\n
"
,
This
);
return
S_OK
;
memset
(
qc
,
0
,
sizeof
(
*
qc
));
qc
->
pin
=
pin
;
qc
->
current_rstart
=
qc
->
current_rstop
=
-
1
;
qc
->
IQualityControl_iface
.
lpVtbl
=
&
quality_control_vtbl
;
}
dlls/strmbase/renderer.c
View file @
a9fbbda4
...
...
@@ -63,7 +63,7 @@ static HRESULT renderer_query_interface(struct strmbase_filter *iface, REFIID ii
else
if
(
IsEqualGUID
(
iid
,
&
IID_IMediaSeeking
))
*
out
=
&
filter
->
passthrough
.
IMediaSeeking_iface
;
else
if
(
IsEqualGUID
(
iid
,
&
IID_IQualityControl
))
*
out
=
&
filter
->
qc
impl
->
IQualityControl_iface
;
*
out
=
&
filter
->
qc
.
IQualityControl_iface
;
else
return
E_NOINTERFACE
;
...
...
@@ -93,7 +93,7 @@ static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TI
SetEvent
(
filter
->
state_event
);
if
(
filter
->
sink
.
pin
.
peer
)
filter
->
eos
=
FALSE
;
QualityControlRender_Start
(
filter
->
qcimpl
,
filter
->
stream_start
);
QualityControlRender_Start
(
&
filter
->
qc
,
filter
->
stream_start
);
if
(
filter
->
sink
.
pin
.
peer
&&
filter
->
pFuncsTable
->
renderer_start_stream
)
filter
->
pFuncsTable
->
renderer_start_stream
(
filter
);
...
...
@@ -234,7 +234,7 @@ static HRESULT sink_end_flush(struct strmbase_sink *iface)
EnterCriticalSection
(
&
filter
->
csRenderLock
);
filter
->
eos
=
FALSE
;
QualityControlRender_Start
(
filter
->
qcimpl
,
filter
->
stream_start
);
QualityControlRender_Start
(
&
filter
->
qc
,
filter
->
stream_start
);
strmbase_passthrough_invalidate_time
(
&
filter
->
passthrough
);
ResetEvent
(
filter
->
flush_event
);
...
...
@@ -272,7 +272,6 @@ void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
CloseHandle
(
filter
->
state_event
);
CloseHandle
(
filter
->
advise_event
);
CloseHandle
(
filter
->
flush_event
);
QualityControlImpl_Destroy
(
filter
->
qcimpl
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
}
...
...
@@ -367,12 +366,12 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
if
(
SUCCEEDED
(
hr
))
{
QualityControlRender_BeginRender
(
This
->
qcimpl
,
start
,
stop
);
QualityControlRender_BeginRender
(
&
This
->
qc
,
start
,
stop
);
hr
=
This
->
pFuncsTable
->
pfnDoRenderSample
(
This
,
pSample
);
QualityControlRender_EndRender
(
This
->
qcimpl
);
QualityControlRender_EndRender
(
&
This
->
qc
);
}
QualityControlRender_DoQOS
(
This
->
qcimpl
);
QualityControlRender_DoQOS
(
&
This
->
qc
);
LeaveCriticalSection
(
&
This
->
csRenderLock
);
...
...
@@ -386,6 +385,7 @@ void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
strmbase_filter_init
(
&
filter
->
filter
,
outer
,
clsid
,
&
filter_ops
);
strmbase_passthrough_init
(
&
filter
->
passthrough
,
(
IUnknown
*
)
&
filter
->
filter
.
IBaseFilter_iface
);
ISeekingPassThru_Init
(
&
filter
->
passthrough
.
ISeekingPassThru_iface
,
TRUE
,
&
filter
->
sink
.
pin
.
IPin_iface
);
strmbase_qc_init
(
&
filter
->
qc
,
&
filter
->
sink
.
pin
);
filter
->
pFuncsTable
=
ops
;
...
...
@@ -396,6 +396,4 @@ void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
filter
->
state_event
=
CreateEventW
(
NULL
,
TRUE
,
TRUE
,
NULL
);
filter
->
advise_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
filter
->
flush_event
=
CreateEventW
(
NULL
,
TRUE
,
TRUE
,
NULL
);
QualityControlImpl_Create
(
&
filter
->
sink
.
pin
,
&
filter
->
qcimpl
);
}
dlls/strmbase/strmbase_private.h
View file @
a9fbbda4
...
...
@@ -53,24 +53,6 @@ static inline const char *debugstr_time(REFERENCE_TIME time)
return
wine_dbg_sprintf
(
"%s"
,
rev
);
}
/* Quality Control */
struct
strmbase_qc
{
IQualityControl
IQualityControl_iface
;
struct
strmbase_pin
*
pin
;
IQualityControl
*
tonotify
;
/* Render stuff */
REFERENCE_TIME
last_in_time
,
last_left
,
avg_duration
,
avg_pt
,
avg_render
,
start
,
stop
;
REFERENCE_TIME
current_jitter
,
current_rstart
,
current_rstop
,
clockstart
;
double
avg_rate
;
LONG64
rendered
,
dropped
;
BOOL
qos_handled
,
is_dropped
;
};
HRESULT
QualityControlImpl_Create
(
struct
strmbase_pin
*
pin
,
struct
strmbase_qc
**
out
);
void
QualityControlImpl_Destroy
(
struct
strmbase_qc
*
qc
);
void
QualityControlRender_Start
(
struct
strmbase_qc
*
This
,
REFERENCE_TIME
tStart
);
void
QualityControlRender_DoQOS
(
struct
strmbase_qc
*
priv
);
void
QualityControlRender_BeginRender
(
struct
strmbase_qc
*
This
,
REFERENCE_TIME
start
,
REFERENCE_TIME
stop
);
...
...
include/wine/strmbase.h
View file @
a9fbbda4
...
...
@@ -271,10 +271,27 @@ struct strmbase_passthrough
void
strmbase_passthrough_init
(
struct
strmbase_passthrough
*
passthrough
,
IUnknown
*
outer
);
void
strmbase_passthrough_cleanup
(
struct
strmbase_passthrough
*
passthrough
);
struct
strmbase_qc
{
IQualityControl
IQualityControl_iface
;
struct
strmbase_pin
*
pin
;
IQualityControl
*
tonotify
;
/* Render stuff */
REFERENCE_TIME
last_in_time
,
last_left
,
avg_duration
,
avg_pt
,
avg_render
,
start
,
stop
;
REFERENCE_TIME
current_jitter
,
current_rstart
,
current_rstop
,
clockstart
;
double
avg_rate
;
LONG64
rendered
,
dropped
;
BOOL
qos_handled
,
is_dropped
;
};
void
strmbase_qc_init
(
struct
strmbase_qc
*
qc
,
struct
strmbase_pin
*
pin
);
struct
strmbase_renderer
{
struct
strmbase_filter
filter
;
struct
strmbase_passthrough
passthrough
;
struct
strmbase_qc
qc
;
struct
strmbase_sink
sink
;
...
...
@@ -290,9 +307,6 @@ struct strmbase_renderer
HANDLE
flush_event
;
REFERENCE_TIME
stream_start
;
IQualityControl
*
pQSink
;
struct
strmbase_qc
*
qcimpl
;
const
struct
strmbase_renderer_ops
*
pFuncsTable
;
BOOL
eos
;
...
...
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