Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
023f79a8
Commit
023f79a8
authored
12 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
qedit: Basic COM cleanup for SampleGrabber.
parent
06da4b22
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/qedit/samplegrabber.c
+36
-27
36 additions, 27 deletions
dlls/qedit/samplegrabber.c
with
36 additions
and
27 deletions
dlls/qedit/samplegrabber.c
+
36
−
27
View file @
023f79a8
...
...
@@ -360,9 +360,9 @@ typedef struct _SG_Pin {
/* Sample Grabber filter implementation */
typedef
struct
_SG_Impl
{
const
IBaseFilter
Vtbl
*
IBaseFilter_
Vtbl
;
const
ISampleGrabber
Vtbl
*
ISampleGrabber_
Vtbl
;
const
IMemInputPin
Vtbl
*
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
;
SampleGrabb
er_
a
dd
r
ef
(
This
->
sg
);
info
->
pFilter
=
(
IBaseFilter
*
)
This
->
sg
;
IBaseFilt
er_
A
dd
R
ef
(
&
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment