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
7c8c0a1d
Commit
7c8c0a1d
authored
Oct 23, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Introduce filter state callbacks.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f7232d4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
18 deletions
+52
-18
filter.c
dlls/strmbase/filter.c
+46
-18
strmbase.h
include/wine/strmbase.h
+6
-0
No files found.
dlls/strmbase/filter.c
View file @
7c8c0a1d
...
...
@@ -126,54 +126,82 @@ HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid)
HRESULT
WINAPI
BaseFilterImpl_Stop
(
IBaseFilter
*
iface
)
{
struct
strmbase_filter
*
filter
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"
iface %p.
\n
"
,
iface
);
TRACE
(
"
filter %p.
\n
"
,
filter
);
EnterCriticalSection
(
&
filter
->
csFilter
);
filter
->
state
=
State_Stopped
;
if
(
filter
->
state
==
State_Running
&&
filter
->
ops
->
filter_stop_stream
)
hr
=
filter
->
ops
->
filter_stop_stream
(
filter
);
if
(
SUCCEEDED
(
hr
)
&&
filter
->
ops
->
filter_cleanup_stream
)
hr
=
filter
->
ops
->
filter_cleanup_stream
(
filter
);
if
(
SUCCEEDED
(
hr
))
filter
->
state
=
State_Stopped
;
LeaveCriticalSection
(
&
filter
->
csFilter
);
return
S_OK
;
return
hr
;
}
HRESULT
WINAPI
BaseFilterImpl_Pause
(
IBaseFilter
*
iface
)
{
struct
strmbase_filter
*
filter
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"
iface %p.
\n
"
,
iface
);
TRACE
(
"
filter %p.
\n
"
,
filter
);
EnterCriticalSection
(
&
filter
->
csFilter
);
filter
->
state
=
State_Paused
;
if
(
filter
->
state
==
State_Stopped
&&
filter
->
ops
->
filter_init_stream
)
hr
=
filter
->
ops
->
filter_init_stream
(
filter
);
else
if
(
filter
->
state
==
State_Running
&&
filter
->
ops
->
filter_stop_stream
)
hr
=
filter
->
ops
->
filter_stop_stream
(
filter
);
if
(
SUCCEEDED
(
hr
))
filter
->
state
=
State_Paused
;
LeaveCriticalSection
(
&
filter
->
csFilter
);
return
S_OK
;
return
hr
;
}
HRESULT
WINAPI
BaseFilterImpl_Run
(
IBaseFilter
*
iface
,
REFERENCE_TIME
start
)
{
struct
strmbase_filter
*
filter
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"
iface %p, start %s.
\n
"
,
iface
,
debugstr_time
(
start
));
TRACE
(
"
filter %p, start %s.
\n
"
,
filter
,
debugstr_time
(
start
));
EnterCriticalSection
(
&
filter
->
csFilter
);
filter
->
state
=
State_Running
;
if
(
filter
->
state
==
State_Stopped
&&
filter
->
ops
->
filter_init_stream
)
hr
=
filter
->
ops
->
filter_init_stream
(
filter
);
if
(
SUCCEEDED
(
hr
)
&&
filter
->
ops
->
filter_start_stream
)
hr
=
filter
->
ops
->
filter_start_stream
(
filter
,
start
);
if
(
SUCCEEDED
(
hr
))
filter
->
state
=
State_Running
;
LeaveCriticalSection
(
&
filter
->
csFilter
);
return
S_OK
;
return
hr
;
}
HRESULT
WINAPI
BaseFilterImpl_GetState
(
IBaseFilter
*
iface
,
DWORD
dwMilliSecsTimeout
,
FILTER_STATE
*
pState
)
HRESULT
WINAPI
BaseFilterImpl_GetState
(
IBaseFilter
*
iface
,
DWORD
timeout
,
FILTER_STATE
*
state
)
{
struct
strmbase_filter
*
This
=
impl_from_IBaseFilter
(
iface
);
TRACE
(
"(%p)->(%d, %p)
\n
"
,
This
,
dwMilliSecsTimeout
,
pState
)
;
struct
strmbase_filter
*
filter
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hr
=
S_OK
;
EnterCriticalSection
(
&
This
->
csFilter
);
{
*
pState
=
This
->
state
;
}
LeaveCriticalSection
(
&
This
->
csFilter
);
TRACE
(
"filter %p, timeout %u, state %p.
\n
"
,
filter
,
timeout
,
state
);
return
S_OK
;
EnterCriticalSection
(
&
filter
->
csFilter
);
if
(
filter
->
ops
->
filter_wait_state
)
hr
=
filter
->
ops
->
filter_wait_state
(
filter
,
timeout
);
*
state
=
filter
->
state
;
LeaveCriticalSection
(
&
filter
->
csFilter
);
return
hr
;
}
HRESULT
WINAPI
BaseFilterImpl_SetSyncSource
(
IBaseFilter
*
iface
,
IReferenceClock
*
pClock
)
...
...
include/wine/strmbase.h
View file @
7c8c0a1d
...
...
@@ -170,6 +170,12 @@ struct strmbase_filter_ops
IPin
*
(
*
filter_get_pin
)(
struct
strmbase_filter
*
iface
,
unsigned
int
index
);
void
(
*
filter_destroy
)(
struct
strmbase_filter
*
iface
);
HRESULT
(
*
filter_query_interface
)(
struct
strmbase_filter
*
iface
,
REFIID
iid
,
void
**
out
);
HRESULT
(
*
filter_init_stream
)(
struct
strmbase_filter
*
iface
);
HRESULT
(
*
filter_start_stream
)(
struct
strmbase_filter
*
iface
,
REFERENCE_TIME
time
);
HRESULT
(
*
filter_stop_stream
)(
struct
strmbase_filter
*
iface
);
HRESULT
(
*
filter_cleanup_stream
)(
struct
strmbase_filter
*
iface
);
HRESULT
(
*
filter_wait_state
)(
struct
strmbase_filter
*
iface
,
DWORD
timeout
);
};
HRESULT
WINAPI
BaseFilterImpl_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
);
...
...
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