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
c52bc25d
Commit
c52bc25d
authored
Jun 04, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/smartteefilter: Use strmbase filter aggregation support.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d78e2d0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
96 deletions
+20
-96
smartteefilter.c
dlls/qcap/smartteefilter.c
+20
-96
No files found.
dlls/qcap/smartteefilter.c
View file @
c52bc25d
...
...
@@ -36,19 +36,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
qcap
);
typedef
struct
{
IUnknown
IUnknown_iface
;
IUnknown
*
outerUnknown
;
BaseFilter
filter
;
BaseInputPin
*
input
;
BaseOutputPin
*
capture
;
BaseOutputPin
*
preview
;
}
SmartTeeFilter
;
static
inline
SmartTeeFilter
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
SmartTeeFilter
,
IUnknown_iface
);
}
static
inline
SmartTeeFilter
*
impl_from_BaseFilter
(
BaseFilter
*
filter
)
{
return
CONTAINING_RECORD
(
filter
,
SmartTeeFilter
,
filter
);
...
...
@@ -71,80 +64,6 @@ static inline SmartTeeFilter *impl_from_IPin(IPin *iface)
return
impl_from_IBaseFilter
(
bp
->
pinInfo
.
pFilter
);
}
static
HRESULT
WINAPI
Unknown_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
SmartTeeFilter
*
This
=
impl_from_IUnknown
(
iface
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
TRACE
(
"(%p)->(IID_IUnknown, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IUnknown_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IPersist
))
{
TRACE
(
"(%p)->(IID_IPersist, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
filter
.
IBaseFilter_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMediaFilter
))
{
TRACE
(
"(%p)->(IID_IMediaFilter, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
filter
.
IBaseFilter_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IBaseFilter
))
{
TRACE
(
"(%p)->(IID_IBaseFilter, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
filter
.
IBaseFilter_iface
;
}
else
{
FIXME
(
"(%p): no interface for %s
\n
"
,
This
,
debugstr_guid
(
riid
));
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
Unknown_AddRef
(
IUnknown
*
iface
)
{
SmartTeeFilter
*
This
=
impl_from_IUnknown
(
iface
);
return
BaseFilterImpl_AddRef
(
&
This
->
filter
.
IBaseFilter_iface
);
}
static
ULONG
WINAPI
Unknown_Release
(
IUnknown
*
iface
)
{
SmartTeeFilter
*
This
=
impl_from_IUnknown
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
filter
.
refcount
);
TRACE
(
"(%p)->() ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
input
)
BaseInputPinImpl_Release
(
&
This
->
input
->
pin
.
IPin_iface
);
if
(
This
->
capture
)
BaseOutputPinImpl_Release
(
&
This
->
capture
->
pin
.
IPin_iface
);
if
(
This
->
preview
)
BaseOutputPinImpl_Release
(
&
This
->
preview
->
pin
.
IPin_iface
);
strmbase_filter_cleanup
(
&
This
->
filter
);
CoTaskMemFree
(
This
);
}
return
ref
;
}
static
const
IUnknownVtbl
UnknownVtbl
=
{
Unknown_QueryInterface
,
Unknown_AddRef
,
Unknown_Release
};
static
HRESULT
WINAPI
SmartTeeFilter_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
SmartTeeFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
return
IUnknown_QueryInterface
(
This
->
outerUnknown
,
riid
,
ppv
);
}
static
ULONG
WINAPI
SmartTeeFilter_AddRef
(
IBaseFilter
*
iface
)
{
SmartTeeFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
return
IUnknown_AddRef
(
This
->
outerUnknown
);
}
static
ULONG
WINAPI
SmartTeeFilter_Release
(
IBaseFilter
*
iface
)
{
SmartTeeFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
return
IUnknown_Release
(
This
->
outerUnknown
);
}
static
HRESULT
WINAPI
SmartTeeFilter_Stop
(
IBaseFilter
*
iface
)
{
SmartTeeFilter
*
This
=
impl_from_IBaseFilter
(
iface
);
...
...
@@ -182,9 +101,9 @@ static HRESULT WINAPI SmartTeeFilter_Run(IBaseFilter *iface, REFERENCE_TIME tSta
}
static
const
IBaseFilterVtbl
SmartTeeFilterVtbl
=
{
SmartTeeFilter
_QueryInterface
,
SmartTeeFilter
_AddRef
,
SmartTeeFilter
_Release
,
BaseFilterImpl
_QueryInterface
,
BaseFilterImpl
_AddRef
,
BaseFilterImpl
_Release
,
BaseFilterImpl_GetClassID
,
SmartTeeFilter_Stop
,
SmartTeeFilter_Pause
,
...
...
@@ -217,8 +136,23 @@ static IPin *smart_tee_get_pin(BaseFilter *iface, unsigned int index)
return
ret
;
}
static
void
smart_tee_destroy
(
BaseFilter
*
iface
)
{
SmartTeeFilter
*
filter
=
impl_from_BaseFilter
(
iface
);
if
(
filter
->
input
)
BaseInputPinImpl_Release
(
&
filter
->
input
->
pin
.
IPin_iface
);
if
(
filter
->
capture
)
BaseOutputPinImpl_Release
(
&
filter
->
capture
->
pin
.
IPin_iface
);
if
(
filter
->
preview
)
BaseOutputPinImpl_Release
(
&
filter
->
preview
->
pin
.
IPin_iface
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
CoTaskMemFree
(
filter
);
}
static
const
BaseFilterFuncTable
SmartTeeFilterFuncs
=
{
.
filter_get_pin
=
smart_tee_get_pin
,
.
filter_destroy
=
smart_tee_destroy
,
};
static
ULONG
WINAPI
SmartTeeFilterInput_AddRef
(
IPin
*
iface
)
...
...
@@ -586,21 +520,14 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
HRESULT
hr
;
SmartTeeFilter
*
This
=
NULL
;
TRACE
(
"(%p, %p)
\n
"
,
outer
,
phr
);
This
=
CoTaskMemAlloc
(
sizeof
(
*
This
));
if
(
This
==
NULL
)
{
*
phr
=
E_OUTOFMEMORY
;
return
NULL
;
}
memset
(
This
,
0
,
sizeof
(
*
This
));
This
->
IUnknown_iface
.
lpVtbl
=
&
UnknownVtbl
;
if
(
outer
)
This
->
outerUnknown
=
outer
;
else
This
->
outerUnknown
=
&
This
->
IUnknown_iface
;
strmbase_filter_init
(
&
This
->
filter
,
&
SmartTeeFilterVtbl
,
NULL
,
&
CLSID_SmartTee
,
strmbase_filter_init
(
&
This
->
filter
,
&
SmartTeeFilterVtbl
,
outer
,
&
CLSID_SmartTee
,
(
DWORD_PTR
)(
__FILE__
": SmartTeeFilter.csFilter"
),
&
SmartTeeFilterFuncs
);
inputPinInfo
.
pFilter
=
&
This
->
filter
.
IBaseFilter_iface
;
...
...
@@ -626,10 +553,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
end:
*
phr
=
hr
;
if
(
SUCCEEDED
(
hr
))
{
if
(
outer
)
return
&
This
->
IUnknown_iface
;
else
return
(
IUnknown
*
)
&
This
->
filter
.
IBaseFilter_iface
;
return
&
This
->
filter
.
IUnknown_inner
;
}
else
{
strmbase_filter_cleanup
(
&
This
->
filter
);
return
NULL
;
...
...
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