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
023f79a8
Commit
023f79a8
authored
Jun 26, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit: Basic COM cleanup for SampleGrabber.
parent
06da4b22
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
27 deletions
+36
-27
samplegrabber.c
dlls/qedit/samplegrabber.c
+36
-27
No files found.
dlls/qedit/samplegrabber.c
View file @
023f79a8
...
...
@@ -360,9 +360,9 @@ typedef struct _SG_Pin {
/* Sample Grabber filter implementation */
typedef
struct
_SG_Impl
{
const
IBaseFilterVtbl
*
IBaseFilter_Vtbl
;
const
ISampleGrabberVtbl
*
ISampleGrabber_Vtbl
;
const
IMemInputPinVtbl
*
IMemInputPin_Vtbl
;
IBaseFilter
IBaseFilter_iface
;
ISampleGrabber
ISampleGrabber_iface
;
IMemInputPin
IMemInputPin_iface
;
/* TODO: IMediaPosition, IMediaSeeking, IQualityControl */
LONG
refCount
;
CRITICAL_SECTION
critSect
;
...
...
@@ -390,17 +390,17 @@ enum {
/* Get the SampleGrabber implementation This pointer from various interface pointers */
static
inline
SG_Impl
*
impl_from_IBaseFilter
(
IBaseFilter
*
iface
)
{
return
(
SG_Impl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
SG_Impl
,
IBaseFilter_Vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
SG_Impl
,
IBaseFilter_iface
);
}
static
inline
SG_Impl
*
impl_from_ISampleGrabber
(
ISampleGrabber
*
iface
)
{
return
(
SG_Impl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
SG_Impl
,
ISampleGrabber_Vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
SG_Impl
,
ISampleGrabber_iface
);
}
static
inline
SG_Impl
*
impl_from_IMemInputPin
(
IMemInputPin
*
iface
)
{
return
(
SG_Impl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
SG_Impl
,
IMemInputPin_Vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
SG_Impl
,
IMemInputPin_iface
);
}
...
...
@@ -458,17 +458,17 @@ static HRESULT SampleGrabber_query(SG_Impl *This, REFIID riid, void **ppvObject)
IsEqualIID
(
riid
,
&
IID_IMediaFilter
)
||
IsEqualIID
(
riid
,
&
IID_IBaseFilter
))
{
SampleGrabber_addref
(
This
);
*
ppvObject
=
&
(
This
->
IBaseFilter_Vtbl
)
;
*
ppvObject
=
&
This
->
IBaseFilter_iface
;
return
S_OK
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_ISampleGrabber
))
{
SampleGrabber_addref
(
This
);
*
ppvObject
=
&
(
This
->
ISampleGrabber_Vtbl
)
;
*
ppvObject
=
&
This
->
ISampleGrabber_iface
;
return
S_OK
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMemInputPin
))
{
SampleGrabber_addref
(
This
);
*
ppvObject
=
&
(
This
->
IMemInputPin_Vtbl
)
;
*
ppvObject
=
&
This
->
IMemInputPin_iface
;
return
S_OK
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMediaPosition
))
...
...
@@ -546,23 +546,26 @@ static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample)
/* IUnknown */
static
HRESULT
WINAPI
SampleGrabber_IBaseFilter_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
void
**
ppv
Object
)
SampleGrabber_IBaseFilter_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
return
SampleGrabber_query
(
impl_from_IBaseFilter
(
iface
),
riid
,
ppvObject
);
SG_Impl
*
This
=
impl_from_IBaseFilter
(
iface
);
return
SampleGrabber_query
(
This
,
riid
,
ppv
);
}
/* IUnknown */
static
ULONG
WINAPI
SampleGrabber_IBaseFilter_AddRef
(
IBaseFilter
*
iface
)
{
return
SampleGrabber_addref
(
impl_from_IBaseFilter
(
iface
));
SG_Impl
*
This
=
impl_from_IBaseFilter
(
iface
);
return
SampleGrabber_addref
(
This
);
}
/* IUnknown */
static
ULONG
WINAPI
SampleGrabber_IBaseFilter_Release
(
IBaseFilter
*
iface
)
{
return
SampleGrabber_release
(
impl_from_IBaseFilter
(
iface
));
SG_Impl
*
This
=
impl_from_IBaseFilter
(
iface
);
return
SampleGrabber_release
(
This
);
}
/* IPersist */
...
...
@@ -732,23 +735,26 @@ SampleGrabber_IBaseFilter_QueryVendorInfo(IBaseFilter *iface, LPWSTR *vendor)
/* IUnknown */
static
HRESULT
WINAPI
SampleGrabber_ISampleGrabber_QueryInterface
(
ISampleGrabber
*
iface
,
REFIID
riid
,
void
**
ppv
Object
)
SampleGrabber_ISampleGrabber_QueryInterface
(
ISampleGrabber
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
return
SampleGrabber_query
(
impl_from_ISampleGrabber
(
iface
),
riid
,
ppvObject
);
SG_Impl
*
This
=
impl_from_ISampleGrabber
(
iface
);
return
SampleGrabber_query
(
This
,
riid
,
ppv
);
}
/* IUnknown */
static
ULONG
WINAPI
SampleGrabber_ISampleGrabber_AddRef
(
ISampleGrabber
*
iface
)
{
return
SampleGrabber_addref
(
impl_from_ISampleGrabber
(
iface
));
SG_Impl
*
This
=
impl_from_ISampleGrabber
(
iface
);
return
SampleGrabber_addref
(
This
);
}
/* IUnknown */
static
ULONG
WINAPI
SampleGrabber_ISampleGrabber_Release
(
ISampleGrabber
*
iface
)
{
return
SampleGrabber_release
(
impl_from_ISampleGrabber
(
iface
));
SG_Impl
*
This
=
impl_from_ISampleGrabber
(
iface
);
return
SampleGrabber_release
(
This
);
}
/* ISampleGrabber */
...
...
@@ -879,23 +885,26 @@ SampleGrabber_ISampleGrabber_SetCallback(ISampleGrabber *iface, ISampleGrabberCB
/* IUnknown */
static
HRESULT
WINAPI
SampleGrabber_IMemInputPin_QueryInterface
(
IMemInputPin
*
iface
,
REFIID
riid
,
void
**
ppv
Object
)
SampleGrabber_IMemInputPin_QueryInterface
(
IMemInputPin
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
return
SampleGrabber_query
(
impl_from_IMemInputPin
(
iface
),
riid
,
ppvObject
);
SG_Impl
*
This
=
impl_from_IMemInputPin
(
iface
);
return
SampleGrabber_query
(
This
,
riid
,
ppv
);
}
/* IUnknown */
static
ULONG
WINAPI
SampleGrabber_IMemInputPin_AddRef
(
IMemInputPin
*
iface
)
{
return
SampleGrabber_addref
(
impl_from_IMemInputPin
(
iface
));
SG_Impl
*
This
=
impl_from_IMemInputPin
(
iface
);
return
SampleGrabber_addref
(
This
);
}
/* IUnknown */
static
ULONG
WINAPI
SampleGrabber_IMemInputPin_Release
(
IMemInputPin
*
iface
)
{
return
SampleGrabber_release
(
impl_from_IMemInputPin
(
iface
));
SG_Impl
*
This
=
impl_from_IMemInputPin
(
iface
);
return
SampleGrabber_release
(
This
);
}
/* IMemInputPin */
...
...
@@ -1019,7 +1028,7 @@ SampleGrabber_IPin_QueryInterface(IPin *iface, REFIID riid, void **ppvObject)
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMemInputPin
))
{
SampleGrabber_addref
(
This
->
sg
);
*
ppvObject
=
&
(
This
->
sg
->
IMemInputPin_Vtbl
)
;
*
ppvObject
=
&
This
->
sg
->
IMemInputPin_iface
;
return
S_OK
;
}
*
ppvObject
=
NULL
;
...
...
@@ -1214,8 +1223,8 @@ SampleGrabber_IPin_QueryPinInfo(IPin *iface, PIN_INFO *info)
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
info
);
if
(
!
info
)
return
E_POINTER
;
SampleGrabber_addref
(
This
->
sg
);
info
->
pFilter
=
(
IBaseFilter
*
)
This
->
sg
;
IBaseFilter_AddRef
(
&
This
->
sg
->
IBaseFilter_iface
);
info
->
pFilter
=
&
This
->
sg
->
IBaseFilter_iface
;
info
->
dir
=
This
->
dir
;
lstrcpynW
(
info
->
achName
,
This
->
name
,
MAX_PIN_NAME
);
return
S_OK
;
...
...
@@ -1440,9 +1449,9 @@ HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppv)
ZeroMemory
(
obj
,
sizeof
(
SG_Impl
));
obj
->
refCount
=
1
;
obj
->
IBaseFilter_Vtbl
=
&
IBaseFilter_VTable
;
obj
->
ISampleGrabber_Vtbl
=
&
ISampleGrabber_VTable
;
obj
->
IMemInputPin_Vtbl
=
&
IMemInputPin_VTable
;
obj
->
IBaseFilter_
iface
.
lp
Vtbl
=
&
IBaseFilter_VTable
;
obj
->
ISampleGrabber_
iface
.
lp
Vtbl
=
&
ISampleGrabber_VTable
;
obj
->
IMemInputPin_
iface
.
lp
Vtbl
=
&
IMemInputPin_VTable
;
obj
->
pin_in
.
lpVtbl
=
&
IPin_In_VTable
;
obj
->
pin_in
.
dir
=
PINDIR_INPUT
;
obj
->
pin_in
.
name
=
pin_in_name
;
...
...
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