Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d30fd371
Commit
d30fd371
authored
Mar 12, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Standardize aggregation of the seeking passthrough object.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
00d55842
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
93 deletions
+25
-93
passthrough.c
dlls/quartz/tests/passthrough.c
+3
-3
pospass.c
dlls/strmbase/pospass.c
+22
-90
No files found.
dlls/quartz/tests/passthrough.c
View file @
d30fd371
...
...
@@ -103,7 +103,7 @@ static void test_aggregation(void)
hr
=
ISeekingPassThru_QueryInterface
(
passthrough
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
ok
(
unk2
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected IUnknown %p.
\n
"
,
unk2
);
hr
=
ISeekingPassThru_QueryInterface
(
passthrough
,
&
IID_ISeekingPassThru
,
(
void
**
)
&
passthrough2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -119,8 +119,8 @@ static void test_aggregation(void)
ISeekingPassThru_Release
(
passthrough
);
ref
=
IUnknown_Release
(
unk
);
todo_wine
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
todo_wine
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ok
(
outer_ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
outer_ref
);
}
START_TEST
(
passthrough
)
...
...
dlls/strmbase/pospass.c
View file @
d30fd371
...
...
@@ -36,8 +36,6 @@ typedef struct PassThruImpl {
LONG
ref
;
IUnknown
*
outer_unk
;
IPin
*
pin
;
BOOL
bUnkOuterValid
;
BOOL
bAggregatable
;
BOOL
renderer
;
CRITICAL_SECTION
time_cs
;
BOOL
timevalid
;
...
...
@@ -70,9 +68,6 @@ static HRESULT WINAPI SeekInner_QueryInterface(IUnknown * iface,
PassThruImpl
*
This
=
impl_from_IUnknown_inner
(
iface
);
TRACE
(
"(%p)->(%s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObj
);
if
(
This
->
bAggregatable
)
This
->
bUnkOuterValid
=
TRUE
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppvObj
=
&
(
This
->
IUnknown_inner
);
...
...
@@ -127,74 +122,25 @@ static const IUnknownVtbl IInner_VTable =
SeekInner_Release
};
/* Generic functions for aggregation */
static
HRESULT
SeekOuter_QueryInterface
(
PassThruImpl
*
This
,
REFIID
riid
,
LPVOID
*
ppv
)
{
if
(
This
->
bAggregatable
)
This
->
bUnkOuterValid
=
TRUE
;
if
(
This
->
outer_unk
)
{
if
(
This
->
bAggregatable
)
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
HRESULT
hr
;
IUnknown_AddRef
(
&
This
->
IUnknown_inner
);
hr
=
IUnknown_QueryInterface
(
&
This
->
IUnknown_inner
,
riid
,
ppv
);
IUnknown_Release
(
&
This
->
IUnknown_inner
);
This
->
bAggregatable
=
TRUE
;
return
hr
;
}
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
return
IUnknown_QueryInterface
(
&
This
->
IUnknown_inner
,
riid
,
ppv
);
}
static
ULONG
SeekOuter_AddRef
(
PassThruImpl
*
This
)
{
if
(
This
->
outer_unk
&&
This
->
bUnkOuterValid
)
return
IUnknown_AddRef
(
This
->
outer_unk
);
return
IUnknown_AddRef
(
&
This
->
IUnknown_inner
);
}
static
ULONG
SeekOuter_Release
(
PassThruImpl
*
This
)
{
if
(
This
->
outer_unk
&&
This
->
bUnkOuterValid
)
return
IUnknown_Release
(
This
->
outer_unk
);
return
IUnknown_Release
(
&
This
->
IUnknown_inner
);
}
static
HRESULT
WINAPI
SeekingPassThru_QueryInterface
(
ISeekingPassThru
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
static
HRESULT
WINAPI
SeekingPassThru_QueryInterface
(
ISeekingPassThru
*
iface
,
REFIID
iid
,
void
**
out
)
{
PassThruImpl
*
This
=
impl_from_ISeekingPassThru
(
iface
);
TRACE
(
"(%p/%p)->(%s, %p)
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
ppvObj
);
PassThruImpl
*
passthrough
=
impl_from_ISeekingPassThru
(
iface
);
return
SeekOuter_QueryInterface
(
This
,
riid
,
ppvObj
);
return
IUnknown_QueryInterface
(
passthrough
->
outer_unk
,
iid
,
out
);
}
static
ULONG
WINAPI
SeekingPassThru_AddRef
(
ISeekingPassThru
*
iface
)
{
PassThruImpl
*
This
=
impl_from_ISeekingPassThru
(
iface
);
PassThruImpl
*
passthrough
=
impl_from_ISeekingPassThru
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
return
SeekOuter_AddRef
(
This
);
return
IUnknown_AddRef
(
passthrough
->
outer_unk
);
}
static
ULONG
WINAPI
SeekingPassThru_Release
(
ISeekingPassThru
*
iface
)
{
PassThruImpl
*
This
=
impl_from_ISeekingPassThru
(
iface
);
PassThruImpl
*
passthrough
=
impl_from_ISeekingPassThru
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
return
SeekOuter_Release
(
This
);
return
IUnknown_Release
(
passthrough
->
outer_unk
);
}
static
HRESULT
WINAPI
SeekingPassThru_Init
(
ISeekingPassThru
*
iface
,
BOOL
renderer
,
IPin
*
pin
)
...
...
@@ -246,9 +192,7 @@ HRESULT WINAPI PosPassThru_Construct(IUnknown *pUnkOuter, LPVOID *ppPassThru)
if
(
!
fimpl
)
return
E_OUTOFMEMORY
;
fimpl
->
outer_unk
=
pUnkOuter
;
fimpl
->
bUnkOuterValid
=
FALSE
;
fimpl
->
bAggregatable
=
FALSE
;
fimpl
->
outer_unk
=
pUnkOuter
?
pUnkOuter
:
&
fimpl
->
IUnknown_inner
;
fimpl
->
IUnknown_inner
.
lpVtbl
=
&
IInner_VTable
;
fimpl
->
ISeekingPassThru_iface
.
lpVtbl
=
&
ISeekingPassThru_Vtbl
;
fimpl
->
IMediaSeeking_iface
.
lpVtbl
=
&
IMediaSeekingPassThru_Vtbl
;
...
...
@@ -261,31 +205,25 @@ HRESULT WINAPI PosPassThru_Construct(IUnknown *pUnkOuter, LPVOID *ppPassThru)
return
S_OK
;
}
static
HRESULT
WINAPI
MediaSeekingPassThru_QueryInterface
(
IMediaSeeking
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
static
HRESULT
WINAPI
MediaSeekingPassThru_QueryInterface
(
IMediaSeeking
*
iface
,
REFIID
iid
,
void
**
out
)
{
PassThruImpl
*
This
=
impl_from_IMediaSeeking
(
iface
);
PassThruImpl
*
passthrough
=
impl_from_IMediaSeeking
(
iface
);
TRACE
(
"(%p/%p)->(%s, %p)
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
ppvObj
);
return
SeekOuter_QueryInterface
(
This
,
riid
,
ppvObj
);
return
IUnknown_QueryInterface
(
passthrough
->
outer_unk
,
iid
,
out
);
}
static
ULONG
WINAPI
MediaSeekingPassThru_AddRef
(
IMediaSeeking
*
iface
)
{
PassThruImpl
*
This
=
impl_from_IMediaSeeking
(
iface
);
PassThruImpl
*
passthrough
=
impl_from_IMediaSeeking
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
iface
,
This
);
return
SeekOuter_AddRef
(
This
);
return
IUnknown_AddRef
(
passthrough
->
outer_unk
);
}
static
ULONG
WINAPI
MediaSeekingPassThru_Release
(
IMediaSeeking
*
iface
)
{
PassThruImpl
*
This
=
impl_from_IMediaSeeking
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
iface
,
This
);
PassThruImpl
*
passthrough
=
impl_from_IMediaSeeking
(
iface
);
return
SeekOuter_Release
(
This
);
return
IUnknown_Release
(
passthrough
->
outer_unk
);
}
static
HRESULT
get_connected
(
PassThruImpl
*
This
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
...
...
@@ -644,31 +582,25 @@ static const IMediaSeekingVtbl IMediaSeekingPassThru_Vtbl =
MediaSeekingPassThru_GetPreroll
};
static
HRESULT
WINAPI
MediaPositionPassThru_QueryInterface
(
IMediaPosition
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
static
HRESULT
WINAPI
MediaPositionPassThru_QueryInterface
(
IMediaPosition
*
iface
,
REFIID
iid
,
void
**
out
)
{
PassThruImpl
*
This
=
impl_from_IMediaPosition
(
iface
);
TRACE
(
"(%p/%p)->(%s, %p)
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
ppvObj
);
PassThruImpl
*
passthrough
=
impl_from_IMediaPosition
(
iface
);
return
SeekOuter_QueryInterface
(
This
,
riid
,
ppvObj
);
return
IUnknown_QueryInterface
(
passthrough
->
outer_unk
,
iid
,
out
);
}
static
ULONG
WINAPI
MediaPositionPassThru_AddRef
(
IMediaPosition
*
iface
)
{
PassThruImpl
*
This
=
impl_from_IMediaPosition
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
iface
,
This
);
PassThruImpl
*
passthrough
=
impl_from_IMediaPosition
(
iface
);
return
SeekOuter_AddRef
(
This
);
return
IUnknown_AddRef
(
passthrough
->
outer_unk
);
}
static
ULONG
WINAPI
MediaPositionPassThru_Release
(
IMediaPosition
*
iface
)
{
PassThruImpl
*
This
=
impl_from_IMediaPosition
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
iface
,
This
);
PassThruImpl
*
passthrough
=
impl_from_IMediaPosition
(
iface
);
return
SeekOuter_Release
(
This
);
return
IUnknown_Release
(
passthrough
->
outer_unk
);
}
static
HRESULT
WINAPI
MediaPositionPassThru_GetTypeInfoCount
(
IMediaPosition
*
iface
,
UINT
*
count
)
...
...
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