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
e4ebf09f
Commit
e4ebf09f
authored
Jul 20, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Get rid of BaseRendererImpl_Receive().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db11d6dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
78 deletions
+66
-78
renderer.c
dlls/strmbase/renderer.c
+66
-76
strmbase.h
include/wine/strmbase.h
+0
-2
No files found.
dlls/strmbase/renderer.c
View file @
e4ebf09f
...
...
@@ -169,7 +169,72 @@ static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void
static
HRESULT
WINAPI
BaseRenderer_Receive
(
struct
strmbase_sink
*
pin
,
IMediaSample
*
sample
)
{
struct
strmbase_renderer
*
filter
=
impl_from_IPin
(
&
pin
->
pin
.
IPin_iface
);
return
BaseRendererImpl_Receive
(
filter
,
sample
);
REFERENCE_TIME
start
,
stop
;
AM_MEDIA_TYPE
*
mt
;
HRESULT
hr
;
if
(
filter
->
eos
||
filter
->
sink
.
flushing
)
return
S_FALSE
;
if
(
filter
->
filter
.
state
==
State_Stopped
)
return
VFW_E_WRONG_STATE
;
if
(
IMediaSample_GetMediaType
(
sample
,
&
mt
)
==
S_OK
)
{
TRACE
(
"Format change.
\n
"
);
strmbase_dump_media_type
(
mt
);
if
(
FAILED
(
filter
->
pFuncsTable
->
pfnCheckMediaType
(
filter
,
mt
)))
return
VFW_E_TYPE_NOT_ACCEPTED
;
DeleteMediaType
(
mt
);
}
EnterCriticalSection
(
&
filter
->
csRenderLock
);
if
(
filter
->
filter
.
state
==
State_Paused
)
SetEvent
(
filter
->
state_event
);
if
(
filter
->
filter
.
clock
&&
SUCCEEDED
(
IMediaSample_GetTime
(
sample
,
&
start
,
&
stop
)))
{
REFERENCE_TIME
now
;
DWORD_PTR
cookie
;
strmbase_passthrough_update_time
(
&
filter
->
passthrough
,
start
);
IReferenceClock_GetTime
(
filter
->
filter
.
clock
,
&
now
);
if
(
now
-
filter
->
stream_start
-
start
<=
-
10000
)
{
HANDLE
handles
[
2
]
=
{
filter
->
advise_event
,
filter
->
flush_event
};
DWORD
ret
;
IReferenceClock_AdviseTime
(
filter
->
filter
.
clock
,
filter
->
stream_start
,
start
,
(
HEVENT
)
filter
->
advise_event
,
&
cookie
);
LeaveCriticalSection
(
&
filter
->
csRenderLock
);
ret
=
WaitForMultipleObjects
(
2
,
handles
,
FALSE
,
INFINITE
);
IReferenceClock_Unadvise
(
filter
->
filter
.
clock
,
cookie
);
if
(
ret
==
1
)
{
TRACE
(
"Flush signaled; discarding current sample.
\n
"
);
return
S_OK
;
}
EnterCriticalSection
(
&
filter
->
csRenderLock
);
}
}
else
start
=
stop
=
-
1
;
QualityControlRender_BeginRender
(
&
filter
->
qc
,
start
,
stop
);
hr
=
filter
->
pFuncsTable
->
pfnDoRenderSample
(
filter
,
sample
);
QualityControlRender_EndRender
(
&
filter
->
qc
);
QualityControlRender_DoQOS
(
&
filter
->
qc
);
LeaveCriticalSection
(
&
filter
->
csRenderLock
);
return
hr
;
}
static
HRESULT
sink_connect
(
struct
strmbase_sink
*
iface
,
IPin
*
peer
,
const
AM_MEDIA_TYPE
*
mt
)
...
...
@@ -267,81 +332,6 @@ void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
strmbase_filter_cleanup
(
&
filter
->
filter
);
}
HRESULT
WINAPI
BaseRendererImpl_Receive
(
struct
strmbase_renderer
*
This
,
IMediaSample
*
pSample
)
{
REFERENCE_TIME
start
,
stop
;
AM_MEDIA_TYPE
*
pmt
;
HRESULT
hr
;
TRACE
(
"(%p)->%p
\n
"
,
This
,
pSample
);
if
(
This
->
eos
||
This
->
sink
.
flushing
)
return
S_FALSE
;
if
(
This
->
filter
.
state
==
State_Stopped
)
return
VFW_E_WRONG_STATE
;
if
(
IMediaSample_GetMediaType
(
pSample
,
&
pmt
)
==
S_OK
)
{
TRACE
(
"Format change.
\n
"
);
strmbase_dump_media_type
(
pmt
);
if
(
FAILED
(
This
->
pFuncsTable
->
pfnCheckMediaType
(
This
,
pmt
)))
{
return
VFW_E_TYPE_NOT_ACCEPTED
;
}
DeleteMediaType
(
pmt
);
}
EnterCriticalSection
(
&
This
->
csRenderLock
);
if
(
This
->
filter
.
state
==
State_Paused
)
SetEvent
(
This
->
state_event
);
/* Wait for render Time */
if
(
This
->
filter
.
clock
&&
SUCCEEDED
(
IMediaSample_GetTime
(
pSample
,
&
start
,
&
stop
)))
{
REFERENCE_TIME
now
;
DWORD_PTR
cookie
;
strmbase_passthrough_update_time
(
&
This
->
passthrough
,
start
);
IReferenceClock_GetTime
(
This
->
filter
.
clock
,
&
now
);
if
(
now
-
This
->
stream_start
-
start
<=
-
10000
)
{
HANDLE
handles
[
2
]
=
{
This
->
advise_event
,
This
->
flush_event
};
DWORD
ret
;
IReferenceClock_AdviseTime
(
This
->
filter
.
clock
,
This
->
stream_start
,
start
,
(
HEVENT
)
This
->
advise_event
,
&
cookie
);
LeaveCriticalSection
(
&
This
->
csRenderLock
);
ret
=
WaitForMultipleObjects
(
2
,
handles
,
FALSE
,
INFINITE
);
IReferenceClock_Unadvise
(
This
->
filter
.
clock
,
cookie
);
if
(
ret
==
1
)
{
TRACE
(
"Flush signaled, discarding current sample.
\n
"
);
return
S_OK
;
}
EnterCriticalSection
(
&
This
->
csRenderLock
);
}
}
else
start
=
stop
=
-
1
;
QualityControlRender_BeginRender
(
&
This
->
qc
,
start
,
stop
);
hr
=
This
->
pFuncsTable
->
pfnDoRenderSample
(
This
,
pSample
);
QualityControlRender_EndRender
(
&
This
->
qc
);
QualityControlRender_DoQOS
(
&
This
->
qc
);
LeaveCriticalSection
(
&
This
->
csRenderLock
);
return
hr
;
}
void
strmbase_renderer_init
(
struct
strmbase_renderer
*
filter
,
IUnknown
*
outer
,
const
CLSID
*
clsid
,
const
WCHAR
*
sink_name
,
const
struct
strmbase_renderer_ops
*
ops
)
{
...
...
include/wine/strmbase.h
View file @
e4ebf09f
...
...
@@ -334,8 +334,6 @@ struct strmbase_renderer_ops
HRESULT
(
*
renderer_pin_query_interface
)(
struct
strmbase_renderer
*
iface
,
REFIID
iid
,
void
**
out
);
};
HRESULT
WINAPI
BaseRendererImpl_Receive
(
struct
strmbase_renderer
*
filter
,
IMediaSample
*
sample
);
void
strmbase_renderer_init
(
struct
strmbase_renderer
*
filter
,
IUnknown
*
outer
,
const
CLSID
*
clsid
,
const
WCHAR
*
sink_name
,
const
struct
strmbase_renderer_ops
*
ops
);
void
strmbase_renderer_cleanup
(
struct
strmbase_renderer
*
filter
);
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