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
38f5f364
Commit
38f5f364
authored
Apr 16, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Make the pin_get_media_type() callback optional.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f65cfbfe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
+26
-11
pin.c
dlls/strmbase/pin.c
+26
-10
renderer.c
dlls/strmbase/renderer.c
+0
-1
No files found.
dlls/strmbase/pin.c
View file @
38f5f364
...
...
@@ -57,10 +57,13 @@ static HRESULT enum_media_types_create(struct strmbase_pin *pin, IEnumMediaTypes
object
->
pin
=
pin
;
IPin_AddRef
(
&
pin
->
IPin_iface
);
while
(
pin
->
ops
->
pin_get_media_type
(
pin
,
object
->
count
,
&
mt
)
==
S_OK
)
if
(
pin
->
ops
->
pin_get_media_type
)
{
FreeMediaType
(
&
mt
);
++
object
->
count
;
while
(
pin
->
ops
->
pin_get_media_type
(
pin
,
object
->
count
,
&
mt
)
==
S_OK
)
{
FreeMediaType
(
&
mt
);
++
object
->
count
;
}
}
TRACE
(
"Created enumerator %p.
\n
"
,
object
);
...
...
@@ -121,6 +124,13 @@ static HRESULT WINAPI enum_media_types_Next(IEnumMediaTypes *iface, ULONG count,
TRACE
(
"enummt %p, count %u, mts %p, ret_count %p.
\n
"
,
enummt
,
count
,
mts
,
ret_count
);
if
(
!
enummt
->
pin
->
ops
->
pin_get_media_type
)
{
if
(
ret_count
)
*
ret_count
=
0
;
return
count
?
S_FALSE
:
S_OK
;
}
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
((
mts
[
i
]
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
))))
...
...
@@ -169,10 +179,13 @@ static HRESULT WINAPI enum_media_types_Reset(IEnumMediaTypes *iface)
TRACE
(
"enummt %p.
\n
"
,
enummt
);
enummt
->
count
=
0
;
while
(
enummt
->
pin
->
ops
->
pin_get_media_type
(
enummt
->
pin
,
enummt
->
count
,
&
mt
)
==
S_OK
)
if
(
enummt
->
pin
->
ops
->
pin_get_media_type
)
{
FreeMediaType
(
&
mt
);
++
enummt
->
count
;
while
(
enummt
->
pin
->
ops
->
pin_get_media_type
(
enummt
->
pin
,
enummt
->
count
,
&
mt
)
==
S_OK
)
{
FreeMediaType
(
&
mt
);
++
enummt
->
count
;
}
}
enummt
->
index
=
0
;
...
...
@@ -397,10 +410,13 @@ static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_med
TRACE
(
"pin %p %s:%s, enum_media_types %p.
\n
"
,
pin
,
debugstr_w
(
pin
->
filter
->
name
),
debugstr_w
(
pin
->
name
),
enum_media_types
);
if
(
FAILED
(
hr
=
pin
->
ops
->
pin_get_media_type
(
pin
,
0
,
&
mt
)))
return
hr
;
if
(
hr
==
S_OK
)
FreeMediaType
(
&
mt
);
if
(
pin
->
ops
->
pin_get_media_type
)
{
if
(
FAILED
(
hr
=
pin
->
ops
->
pin_get_media_type
(
pin
,
0
,
&
mt
)))
return
hr
;
if
(
hr
==
S_OK
)
FreeMediaType
(
&
mt
);
}
return
enum_media_types_create
(
pin
,
enum_media_types
);
}
...
...
dlls/strmbase/renderer.c
View file @
38f5f364
...
...
@@ -257,7 +257,6 @@ 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
,
...
...
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