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
09b0d9d4
Commit
09b0d9d4
authored
Feb 05, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Simplify CompareMediaTypes().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e14c5430
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
pin.c
dlls/strmbase/pin.c
+20
-8
No files found.
dlls/strmbase/pin.c
View file @
09b0d9d4
...
...
@@ -247,12 +247,6 @@ static HRESULT SendFurther(struct strmbase_sink *sink, SendPinFunc func, void *a
return
hr
;
}
static
BOOL
CompareMediaTypes
(
const
AM_MEDIA_TYPE
*
pmt1
,
const
AM_MEDIA_TYPE
*
pmt2
,
BOOL
bWildcards
)
{
return
(((
bWildcards
&&
(
IsEqualGUID
(
&
pmt1
->
majortype
,
&
GUID_NULL
)
||
IsEqualGUID
(
&
pmt2
->
majortype
,
&
GUID_NULL
)))
||
IsEqualGUID
(
&
pmt1
->
majortype
,
&
pmt2
->
majortype
))
&&
((
bWildcards
&&
(
IsEqualGUID
(
&
pmt1
->
subtype
,
&
GUID_NULL
)
||
IsEqualGUID
(
&
pmt2
->
subtype
,
&
GUID_NULL
)))
||
IsEqualGUID
(
&
pmt1
->
subtype
,
&
pmt2
->
subtype
)));
}
HRESULT
strmbase_pin_get_media_type
(
struct
strmbase_pin
*
iface
,
unsigned
int
index
,
AM_MEDIA_TYPE
*
mt
)
{
return
VFW_S_NO_MORE_ITEMS
;
...
...
@@ -428,6 +422,24 @@ static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
return
CONTAINING_RECORD
(
iface
,
struct
strmbase_source
,
pin
.
IPin_iface
);
}
static
BOOL
compare_media_types
(
const
AM_MEDIA_TYPE
*
a
,
const
AM_MEDIA_TYPE
*
b
)
{
if
(
!
a
)
return
TRUE
;
if
(
!
IsEqualGUID
(
&
a
->
majortype
,
&
b
->
majortype
)
&&
!
IsEqualGUID
(
&
a
->
majortype
,
&
GUID_NULL
)
&&
!
IsEqualGUID
(
&
b
->
majortype
,
&
GUID_NULL
))
return
FALSE
;
if
(
!
IsEqualGUID
(
&
a
->
subtype
,
&
b
->
subtype
)
&&
!
IsEqualGUID
(
&
a
->
subtype
,
&
GUID_NULL
)
&&
!
IsEqualGUID
(
&
b
->
subtype
,
&
GUID_NULL
))
return
FALSE
;
return
TRUE
;
}
static
HRESULT
WINAPI
source_Connect
(
IPin
*
iface
,
IPin
*
peer
,
const
AM_MEDIA_TYPE
*
mt
)
{
struct
strmbase_source
*
pin
=
impl_source_from_IPin
(
iface
);
...
...
@@ -468,7 +480,7 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
for
(
i
=
0
;
pin
->
pFuncsTable
->
base
.
pin_get_media_type
(
&
pin
->
pin
,
i
,
&
candidate
)
==
S_OK
;
++
i
)
{
strmbase_dump_media_type
(
&
candidate
);
if
(
(
!
mt
||
CompareMediaTypes
(
mt
,
&
candidate
,
TRUE
)
)
if
(
compare_media_types
(
mt
,
&
candidate
)
&&
pin
->
pFuncsTable
->
pfnAttemptConnection
(
pin
,
peer
,
&
candidate
)
==
S_OK
)
{
LeaveCriticalSection
(
&
pin
->
pin
.
filter
->
csFilter
);
...
...
@@ -482,7 +494,7 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
{
while
(
IEnumMediaTypes_Next
(
enummt
,
1
,
&
candidate_ptr
,
&
count
)
==
S_OK
)
{
if
(
(
!
mt
||
CompareMediaTypes
(
mt
,
candidate_ptr
,
TRUE
)
)
if
(
compare_media_types
(
mt
,
candidate_ptr
)
&&
pin
->
pFuncsTable
->
pfnAttemptConnection
(
pin
,
peer
,
candidate_ptr
)
==
S_OK
)
{
LeaveCriticalSection
(
&
pin
->
pin
.
filter
->
csFilter
);
...
...
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