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
5dfe4776
Commit
5dfe4776
authored
Apr 19, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Add a helper to get associated event object value.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5b3fdc26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
19 deletions
+32
-19
main.c
dlls/mfreadwrite/main.c
+32
-19
No files found.
dlls/mfreadwrite/main.c
View file @
5dfe4776
...
...
@@ -122,6 +122,36 @@ static inline struct sink_writer *impl_from_IMFSinkWriter(IMFSinkWriter *iface)
return
CONTAINING_RECORD
(
iface
,
struct
sink_writer
,
IMFSinkWriter_iface
);
}
static
HRESULT
media_event_get_object
(
IMFMediaEvent
*
event
,
REFIID
riid
,
void
**
obj
)
{
PROPVARIANT
value
;
HRESULT
hr
;
PropVariantInit
(
&
value
);
if
(
FAILED
(
hr
=
IMFMediaEvent_GetValue
(
event
,
&
value
)))
{
WARN
(
"Failed to get event value, hr %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
value
.
vt
!=
VT_UNKNOWN
||
!
value
.
u
.
punkVal
)
{
WARN
(
"Unexpected value type %d.
\n
"
,
value
.
vt
);
PropVariantClear
(
&
value
);
return
E_UNEXPECTED
;
}
hr
=
IUnknown_QueryInterface
(
value
.
u
.
punkVal
,
riid
,
obj
);
PropVariantClear
(
&
value
);
if
(
FAILED
(
hr
))
{
WARN
(
"Unexpected object type.
\n
"
);
return
hr
;
}
return
hr
;
}
static
HRESULT
WINAPI
source_reader_source_events_callback_QueryInterface
(
IMFAsyncCallback
*
iface
,
REFIID
riid
,
void
**
obj
)
{
...
...
@@ -162,30 +192,13 @@ static HRESULT source_reader_new_stream_handler(struct source_reader *reader, IM
{
IMFStreamDescriptor
*
sd
;
IMFMediaStream
*
stream
;
PROPVARIANT
value
;
unsigned
int
i
;
DWORD
id
=
0
;
HRESULT
hr
;
PropVariantInit
(
&
value
);
if
(
FAILED
(
hr
=
IMFMediaEvent_GetValue
(
event
,
&
value
)))
if
(
FAILED
(
hr
=
media_event_get_object
(
event
,
&
IID_IMFMediaStream
,
(
void
**
)
&
stream
)))
{
WARN
(
"Failed to get event value, hr %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
value
.
vt
!=
VT_UNKNOWN
||
!
value
.
u
.
punkVal
)
{
WARN
(
"Unexpected value type %d.
\n
"
,
value
.
vt
);
PropVariantClear
(
&
value
);
return
E_UNEXPECTED
;
}
hr
=
IUnknown_QueryInterface
(
value
.
u
.
punkVal
,
&
IID_IMFMediaStream
,
(
void
**
)
&
stream
);
PropVariantClear
(
&
value
);
if
(
FAILED
(
hr
))
{
WARN
(
"Unexpected object type.
\n
"
);
WARN
(
"Failed to get stream object, hr %#x.
\n
"
,
hr
);
return
hr
;
}
...
...
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