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
2fcc7e72
Commit
2fcc7e72
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/transform: Use base filter state change methods.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7c8c0a1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
70 deletions
+41
-70
transform.c
dlls/strmbase/transform.c
+41
-70
No files found.
dlls/strmbase/transform.c
View file @
2fcc7e72
...
...
@@ -155,10 +155,48 @@ static void transform_destroy(struct strmbase_filter *iface)
CoTaskMemFree
(
filter
);
}
static
HRESULT
transform_init_stream
(
struct
strmbase_filter
*
iface
)
{
TransformFilter
*
filter
=
impl_from_strmbase_filter
(
iface
);
HRESULT
hr
=
S_OK
;
EnterCriticalSection
(
&
filter
->
csReceive
);
filter
->
sink
.
end_of_stream
=
FALSE
;
if
(
filter
->
pFuncsTable
->
pfnStartStreaming
)
hr
=
filter
->
pFuncsTable
->
pfnStartStreaming
(
filter
);
if
(
SUCCEEDED
(
hr
))
hr
=
BaseOutputPinImpl_Active
(
&
filter
->
source
);
LeaveCriticalSection
(
&
filter
->
csReceive
);
return
hr
;
}
static
HRESULT
transform_cleanup_stream
(
struct
strmbase_filter
*
iface
)
{
TransformFilter
*
filter
=
impl_from_strmbase_filter
(
iface
);
HRESULT
hr
=
S_OK
;
EnterCriticalSection
(
&
filter
->
csReceive
);
filter
->
sink
.
end_of_stream
=
FALSE
;
if
(
filter
->
pFuncsTable
->
pfnStopStreaming
)
hr
=
filter
->
pFuncsTable
->
pfnStopStreaming
(
filter
);
if
(
SUCCEEDED
(
hr
))
hr
=
BaseOutputPinImpl_Inactive
(
&
filter
->
source
);
LeaveCriticalSection
(
&
filter
->
csReceive
);
return
hr
;
}
static
const
struct
strmbase_filter_ops
filter_ops
=
{
.
filter_get_pin
=
transform_get_pin
,
.
filter_destroy
=
transform_destroy
,
.
filter_init_stream
=
transform_init_stream
,
.
filter_cleanup_stream
=
transform_cleanup_stream
,
};
static
HRESULT
sink_query_interface
(
struct
strmbase_pin
*
iface
,
REFIID
iid
,
void
**
out
)
...
...
@@ -207,73 +245,6 @@ static const struct strmbase_source_ops source_ops =
.
pfnDecideAllocator
=
BaseOutputPinImpl_DecideAllocator
,
};
static
HRESULT
WINAPI
TransformFilterImpl_Stop
(
IBaseFilter
*
iface
)
{
TransformFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p/%p)
\n
"
,
This
,
iface
);
EnterCriticalSection
(
&
This
->
csReceive
);
{
This
->
filter
.
state
=
State_Stopped
;
if
(
This
->
pFuncsTable
->
pfnStopStreaming
)
hr
=
This
->
pFuncsTable
->
pfnStopStreaming
(
This
);
if
(
SUCCEEDED
(
hr
))
hr
=
BaseOutputPinImpl_Inactive
(
&
This
->
source
);
}
LeaveCriticalSection
(
&
This
->
csReceive
);
return
hr
;
}
static
HRESULT
WINAPI
TransformFilterImpl_Pause
(
IBaseFilter
*
iface
)
{
TransformFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
EnterCriticalSection
(
&
This
->
csReceive
);
{
if
(
This
->
filter
.
state
==
State_Stopped
)
hr
=
IBaseFilter_Run
(
iface
,
-
1
);
else
hr
=
S_OK
;
if
(
SUCCEEDED
(
hr
))
This
->
filter
.
state
=
State_Paused
;
}
LeaveCriticalSection
(
&
This
->
csReceive
);
return
hr
;
}
static
HRESULT
WINAPI
TransformFilterImpl_Run
(
IBaseFilter
*
iface
,
REFERENCE_TIME
tStart
)
{
HRESULT
hr
=
S_OK
;
TransformFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
TRACE
(
"iface %p, start %s.
\n
"
,
iface
,
debugstr_time
(
tStart
));
EnterCriticalSection
(
&
This
->
csReceive
);
{
if
(
This
->
filter
.
state
==
State_Stopped
)
{
This
->
sink
.
end_of_stream
=
FALSE
;
if
(
This
->
pFuncsTable
->
pfnStartStreaming
)
hr
=
This
->
pFuncsTable
->
pfnStartStreaming
(
This
);
if
(
SUCCEEDED
(
hr
))
hr
=
BaseOutputPinImpl_Active
(
&
This
->
source
);
}
if
(
SUCCEEDED
(
hr
))
This
->
filter
.
state
=
State_Running
;
}
LeaveCriticalSection
(
&
This
->
csReceive
);
return
hr
;
}
static
const
IBaseFilterVtbl
transform_vtbl
=
{
...
...
@@ -281,9 +252,9 @@ static const IBaseFilterVtbl transform_vtbl =
BaseFilterImpl_AddRef
,
BaseFilterImpl_Release
,
BaseFilterImpl_GetClassID
,
Transform
FilterImpl_Stop
,
Transform
FilterImpl_Pause
,
Transform
FilterImpl_Run
,
Base
FilterImpl_Stop
,
Base
FilterImpl_Pause
,
Base
FilterImpl_Run
,
BaseFilterImpl_GetState
,
BaseFilterImpl_SetSyncSource
,
BaseFilterImpl_GetSyncSource
,
...
...
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