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
7f57286d
Commit
7f57286d
authored
Dec 10, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase/renderer: Use base sink connection methods.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
67a6af77
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
54 deletions
+40
-54
vmr7.c
dlls/quartz/tests/vmr7.c
+1
-1
vmr9.c
dlls/quartz/tests/vmr9.c
+13
-8
vmr9.c
dlls/quartz/vmr9.c
+5
-3
renderer.c
dlls/strmbase/renderer.c
+21
-42
No files found.
dlls/quartz/tests/vmr7.c
View file @
7f57286d
...
...
@@ -1392,7 +1392,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
source
.
source
.
pin
.
peer
==
pin
,
"Got peer %p.
\n
"
,
peer
);
IFilterGraph2_Disconnect
(
graph
,
&
source
.
source
.
pin
.
IPin_iface
);
...
...
dlls/quartz/tests/vmr9.c
View file @
7f57286d
...
...
@@ -901,7 +901,8 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
if
(
FAILED
(
hr
=
IPin_ReceiveConnection
(
peer
,
&
iface
->
pin
.
IPin_iface
,
mt
)))
{
ok
(
hr
==
VFW_E_TYPE_NOT_ACCEPTED
||
hr
==
E_FAIL
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine_if
(((
VIDEOINFOHEADER
*
)
mt
->
pbFormat
)
->
bmiHeader
.
biBitCount
==
24
)
ok
(
hr
==
VFW_E_TYPE_NOT_ACCEPTED
||
hr
==
E_FAIL
,
"Got hr %#x.
\n
"
,
hr
);
IPin_Release
(
peer
);
iface
->
pin
.
peer
=
NULL
;
FreeMediaType
(
&
iface
->
pin
.
mt
);
...
...
@@ -1315,13 +1316,17 @@ static void test_connect_pin(void)
skip
(
"Got E_FAIL when connecting.
\n
"
);
goto
out
;
}
ok
(
hr
==
S_OK
,
"Got hr %#x for subtype %s and bpp %u.
\n
"
,
hr
,
wine_dbgstr_guid
(
subtype_tests
[
i
]),
bpp_tests
[
j
]);
todo_wine_if
(
bpp_tests
[
j
]
==
24
)
ok
(
hr
==
S_OK
,
"Got hr %#x for subtype %s and bpp %u.
\n
"
,
hr
,
wine_dbgstr_guid
(
subtype_tests
[
i
]),
bpp_tests
[
j
]);
hr
=
IFilterGraph2_Disconnect
(
graph
,
&
source
.
source
.
pin
.
IPin_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IFilterGraph2_Disconnect
(
graph
,
&
source
.
source
.
pin
.
IPin_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
}
}
}
...
...
@@ -1391,7 +1396,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
source
.
source
.
pin
.
peer
==
pin
,
"Got peer %p.
\n
"
,
source
.
source
.
pin
.
peer
);
IFilterGraph2_Disconnect
(
graph
,
&
source
.
source
.
pin
.
IPin_iface
);
...
...
dlls/quartz/vmr9.c
View file @
7f57286d
...
...
@@ -356,7 +356,7 @@ static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force)
HRESULT
hr
;
TRACE
(
"my mode: %u, my window: %p, my last window: %p
\n
"
,
This
->
mode
,
This
->
baseControlWindow
.
baseWindow
.
hWnd
,
This
->
hWndClippingWindow
);
if
(
This
->
num_surfaces
||
!
This
->
renderer
.
sink
.
pin
.
peer
)
if
(
This
->
num_surfaces
)
return
S_OK
;
if
(
This
->
mode
==
VMR9Mode_Windowless
&&
!
This
->
hWndClippingWindow
)
...
...
@@ -410,7 +410,8 @@ static void vmr_start_stream(struct strmbase_renderer *iface)
TRACE
(
"(%p)
\n
"
,
This
);
VMR9_maybe_init
(
This
,
TRUE
);
if
(
This
->
renderer
.
sink
.
pin
.
peer
)
VMR9_maybe_init
(
This
,
TRUE
);
IVMRImagePresenter9_StartPresenting
(
This
->
presenter
,
This
->
cookie
);
SetWindowPos
(
This
->
baseControlWindow
.
baseWindow
.
hWnd
,
NULL
,
This
->
source_rect
.
left
,
...
...
@@ -1760,7 +1761,8 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles
EnterCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
This
->
hWndClippingWindow
=
hwnd
;
VMR9_maybe_init
(
This
,
FALSE
);
if
(
This
->
renderer
.
sink
.
pin
.
peer
)
VMR9_maybe_init
(
This
,
FALSE
);
if
(
!
hwnd
)
IVMRSurfaceAllocatorEx9_TerminateDevice
(
This
->
allocator
,
This
->
cookie
);
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
...
...
dlls/strmbase/renderer.c
View file @
7f57286d
...
...
@@ -40,46 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return
CONTAINING_RECORD
(
iface
,
struct
strmbase_renderer
,
sink
.
pin
.
IPin_iface
);
}
static
HRESULT
WINAPI
BaseRenderer_InputPin_ReceiveConnection
(
IPin
*
iface
,
IPin
*
peer
,
const
AM_MEDIA_TYPE
*
mt
)
{
struct
strmbase_renderer
*
filter
=
impl_from_IPin
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, peer %p, mt %p.
\n
"
,
iface
,
peer
,
mt
);
strmbase_dump_media_type
(
mt
);
EnterCriticalSection
(
&
filter
->
filter
.
csFilter
);
hr
=
BaseInputPinImpl_ReceiveConnection
(
iface
,
peer
,
mt
);
if
(
SUCCEEDED
(
hr
))
{
if
(
filter
->
pFuncsTable
->
renderer_connect
)
hr
=
filter
->
pFuncsTable
->
renderer_connect
(
filter
,
mt
);
}
LeaveCriticalSection
(
&
filter
->
filter
.
csFilter
);
return
hr
;
}
static
HRESULT
WINAPI
BaseRenderer_InputPin_Disconnect
(
IPin
*
iface
)
{
struct
strmbase_renderer
*
filter
=
impl_from_IPin
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p.
\n
"
,
iface
);
EnterCriticalSection
(
&
filter
->
filter
.
csFilter
);
hr
=
BaseInputPinImpl_Disconnect
(
iface
);
if
(
SUCCEEDED
(
hr
))
{
if
(
filter
->
pFuncsTable
->
pfnBreakConnect
)
hr
=
filter
->
pFuncsTable
->
pfnBreakConnect
(
filter
);
}
BaseRendererImpl_ClearPendingSample
(
filter
);
LeaveCriticalSection
(
&
filter
->
filter
.
csFilter
);
return
hr
;
}
static
HRESULT
WINAPI
BaseRenderer_InputPin_EndOfStream
(
IPin
*
iface
)
{
struct
strmbase_renderer
*
filter
=
impl_from_IPin
(
iface
);
...
...
@@ -157,8 +117,8 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
BasePinImpl_AddRef
,
BasePinImpl_Release
,
BaseInputPinImpl_Connect
,
Base
Renderer_InputPin
_ReceiveConnection
,
Base
Renderer_InputPin
_Disconnect
,
Base
InputPinImpl
_ReceiveConnection
,
Base
InputPinImpl
_Disconnect
,
BasePinImpl_ConnectedTo
,
BasePinImpl_ConnectionMediaType
,
BasePinImpl_QueryPinInfo
,
...
...
@@ -312,12 +272,31 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
return
BaseRendererImpl_Receive
(
filter
,
sample
);
}
static
HRESULT
sink_connect
(
struct
strmbase_sink
*
iface
,
IPin
*
peer
,
const
AM_MEDIA_TYPE
*
mt
)
{
struct
strmbase_renderer
*
filter
=
impl_from_IPin
(
&
iface
->
pin
.
IPin_iface
);
if
(
filter
->
pFuncsTable
->
renderer_connect
)
return
filter
->
pFuncsTable
->
renderer_connect
(
filter
,
mt
);
return
S_OK
;
}
static
void
sink_disconnect
(
struct
strmbase_sink
*
iface
)
{
struct
strmbase_renderer
*
filter
=
impl_from_IPin
(
&
iface
->
pin
.
IPin_iface
);
if
(
filter
->
pFuncsTable
->
pfnBreakConnect
)
filter
->
pFuncsTable
->
pfnBreakConnect
(
filter
);
}
static
const
struct
strmbase_sink_ops
sink_ops
=
{
.
base
.
pin_query_accept
=
sink_query_accept
,
.
base
.
pin_query_interface
=
sink_query_interface
,
.
base
.
pin_get_media_type
=
strmbase_pin_get_media_type
,
.
pfnReceive
=
BaseRenderer_Receive
,
.
sink_connect
=
sink_connect
,
.
sink_disconnect
=
sink_disconnect
,
};
void
strmbase_renderer_cleanup
(
struct
strmbase_renderer
*
filter
)
...
...
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