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
e8e4fcc5
Commit
e8e4fcc5
authored
Feb 07, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit/samplegrabber: Reconnect the sink pin if necessary.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
10c6b08b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
7 deletions
+33
-7
samplegrabber.c
dlls/qedit/samplegrabber.c
+26
-0
samplegrabber.c
dlls/qedit/tests/samplegrabber.c
+7
-7
No files found.
dlls/qedit/samplegrabber.c
View file @
e8e4fcc5
...
...
@@ -595,9 +595,35 @@ static HRESULT sample_grabber_source_get_media_type(struct strmbase_pin *iface,
return
VFW_S_NO_MORE_ITEMS
;
}
static
inline
BOOL
compare_media_types
(
const
AM_MEDIA_TYPE
*
a
,
const
AM_MEDIA_TYPE
*
b
)
{
return
!
memcmp
(
a
,
b
,
offsetof
(
AM_MEDIA_TYPE
,
pbFormat
))
&&
!
memcmp
(
a
->
pbFormat
,
b
->
pbFormat
,
a
->
cbFormat
);
}
static
HRESULT
WINAPI
sample_grabber_source_DecideAllocator
(
struct
strmbase_source
*
iface
,
IMemInputPin
*
peer
,
IMemAllocator
**
allocator
)
{
SG_Impl
*
filter
=
impl_from_source_pin
(
&
iface
->
pin
);
const
AM_MEDIA_TYPE
*
mt
=
&
iface
->
pin
.
mt
;
if
(
!
compare_media_types
(
mt
,
&
filter
->
sink
.
pin
.
mt
))
{
IFilterGraph2
*
graph
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IFilterGraph_QueryInterface
(
filter
->
filter
.
graph
,
&
IID_IFilterGraph2
,
(
void
**
)
&
graph
)))
{
ERR
(
"Failed to get IFilterGraph2 interface, hr %#x.
\n
"
,
hr
);
return
hr
;
}
hr
=
IFilterGraph2_ReconnectEx
(
graph
,
&
filter
->
sink
.
pin
.
IPin_iface
,
mt
);
IFilterGraph2_Release
(
graph
);
return
hr
;
}
return
S_OK
;
}
...
...
dlls/qedit/tests/samplegrabber.c
View file @
e8e4fcc5
...
...
@@ -894,7 +894,7 @@ static void test_connect_pin(void)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
mt
,
&
req_mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
req_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
source
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -912,7 +912,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
testsource
.
source_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
.
sink
.
pin
.
IPin_iface
);
...
...
@@ -921,7 +921,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
&
req_mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
testsource
.
source_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
.
sink
.
pin
.
IPin_iface
);
...
...
@@ -933,7 +933,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
&
req_mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
testsource
.
source_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
.
sink
.
pin
.
IPin_iface
);
...
...
@@ -967,7 +967,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
&
req_mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
testsource
.
source_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
.
sink
.
pin
.
IPin_iface
);
...
...
@@ -980,7 +980,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
&
req_mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
testsource
.
source_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
.
sink
.
pin
.
IPin_iface
);
...
...
@@ -1022,7 +1022,7 @@ static void test_connect_pin(void)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
compare_media_types
(
&
testsink
.
sink
.
pin
.
mt
,
&
req_mt
),
"Media types didn't match.
\n
"
);
todo_wine
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
&
testsource
.
source
.
pin
.
mt
,
&
testsink
.
sink
.
pin
.
mt
),
"Media types didn't match.
\n
"
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
.
sink
.
pin
.
IPin_iface
);
...
...
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