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
c55dbcdb
Commit
c55dbcdb
authored
Jan 14, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Add a helper to get associated topology node object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
20beb7ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
72 deletions
+52
-72
copier.c
dlls/mf/copier.c
+2
-2
mf_private.h
dlls/mf/mf_private.h
+2
-1
session.c
dlls/mf/session.c
+18
-37
topology.c
dlls/mf/topology.c
+30
-32
No files found.
dlls/mf/copier.c
View file @
c55dbcdb
...
...
@@ -561,9 +561,9 @@ static const IMFTransformVtbl sample_copier_transform_vtbl =
sample_copier_transform_ProcessOutput
,
};
BOOL
mf_is_sample_copier_transform
(
I
Unknown
*
transform
)
BOOL
mf_is_sample_copier_transform
(
I
MFTransform
*
transform
)
{
return
transform
->
lpVtbl
==
(
IUnknownVtbl
*
)
&
sample_copier_transform_vtbl
;
return
transform
->
lpVtbl
==
&
sample_copier_transform_vtbl
;
}
/***********************************************************************
...
...
dlls/mf/mf_private.h
View file @
c55dbcdb
...
...
@@ -80,4 +80,5 @@ static inline const char *debugstr_time(LONGLONG time)
return
wine_dbg_sprintf
(
"%s"
,
rev
);
}
extern
BOOL
mf_is_sample_copier_transform
(
IUnknown
*
transform
)
DECLSPEC_HIDDEN
;
extern
BOOL
mf_is_sample_copier_transform
(
IMFTransform
*
transform
)
DECLSPEC_HIDDEN
;
extern
HRESULT
topology_node_get_object
(
IMFTopologyNode
*
node
,
REFIID
riid
,
void
**
obj
)
DECLSPEC_HIDDEN
;
dlls/mf/session.c
View file @
c55dbcdb
...
...
@@ -792,7 +792,6 @@ static void session_shutdown_current_topology(struct media_session *session)
IMFTopologyNode
*
node
;
IMFActivate
*
activate
;
IMFMediaSink
*
sink
;
IUnknown
*
object
;
WORD
idx
=
0
;
HRESULT
hr
;
...
...
@@ -818,20 +817,15 @@ static void session_shutdown_current_topology(struct media_session *session)
WARN
(
"Failed to shut down activation object for the sink, hr %#x.
\n
"
,
hr
);
IMFActivate_Release
(
activate
);
}
else
if
(
SUCCEEDED
(
IMFTopologyNode_GetObject
(
node
,
&
object
)))
else
if
(
SUCCEEDED
(
topology_node_get_object
(
node
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
)))
{
if
(
SUCCEEDED
(
I
Unknown_QueryInterface
(
object
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_
sink
)))
if
(
SUCCEEDED
(
I
MFStreamSink_GetMediaSink
(
stream_sink
,
&
sink
)))
{
if
(
SUCCEEDED
(
IMFStreamSink_GetMediaSink
(
stream_sink
,
&
sink
)))
{
IMFMediaSink_Shutdown
(
sink
);
IMFMediaSink_Release
(
sink
);
}
IMFStreamSink_Release
(
stream_sink
);
IMFMediaSink_Shutdown
(
sink
);
IMFMediaSink_Release
(
sink
);
}
I
Unknown_Release
(
object
);
I
MFStreamSink_Release
(
stream_sink
);
}
}
}
...
...
@@ -1358,7 +1352,6 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
IMFMediaType
*
media_type
;
IMFStreamDescriptor
*
sd
;
HRESULT
hr
=
S_OK
;
IUnknown
*
object
;
if
(
!
(
topo_node
=
heap_alloc_zero
(
sizeof
(
*
topo_node
))))
return
E_OUTOFMEMORY
;
...
...
@@ -1374,15 +1367,11 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
case
MF_TOPOLOGY_OUTPUT_NODE
:
topo_node
->
u
.
sink
.
notify_cb
.
lpVtbl
=
&
node_sample_allocator_cb_vtbl
;
if
(
FAILED
(
hr
=
IMFTopologyNode_GetObject
(
node
,
&
object
)))
if
(
FAILED
(
hr
=
topology_node_get_object
(
node
,
&
IID_IMFStreamSink
,
(
void
**
)
&
topo_node
->
object
.
object
)))
{
WARN
(
"
Node %s does not have associated object.
\n
"
,
wine_dbgstr_longlong
(
topo_node
->
node_id
)
);
WARN
(
"
Failed to get stream sink interface, hr %#x.
\n
"
,
hr
);
break
;
}
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IMFStreamSink
,
(
void
**
)
&
topo_node
->
object
.
object
);
IUnknown_Release
(
object
);
if
(
FAILED
(
hr
))
break
;
if
(
FAILED
(
hr
=
IMFStreamSink_GetMediaSink
(
topo_node
->
object
.
sink_stream
,
&
media_sink
)))
break
;
...
...
@@ -1433,14 +1422,11 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
break
;
case
MF_TOPOLOGY_TRANSFORM_NODE
:
if
(
SUCCEEDED
(
hr
=
IMFTopologyNode_GetObject
(
node
,
&
object
)))
{
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IMFTransform
,
(
void
**
)
&
topo_node
->
object
.
transform
);
IUnknown_Release
(
object
);
}
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
=
topology_node_get_object
(
node
,
&
IID_IMFTransform
,
(
void
**
)
&
topo_node
->
object
.
transform
)))
{
hr
=
session_set_transform_stream_info
(
topo_node
);
}
else
WARN
(
"Failed to get IMFTransform for MFT node, hr %#x.
\n
"
,
hr
);
...
...
@@ -2017,10 +2003,10 @@ static HRESULT WINAPI session_get_service_GetService(IMFGetService *iface, REFGU
{
IMFStreamSink
*
stream_sink
;
IMFTopologyNode
*
node
;
IUnknown
*
vr
,
*
object
;
IMFCollection
*
nodes
;
IMFMediaSink
*
sink
;
unsigned
int
i
=
0
;
IUnknown
*
vr
;
HRESULT
hr
;
EnterCriticalSection
(
&
session
->
cs
);
...
...
@@ -2033,23 +2019,18 @@ static HRESULT WINAPI session_get_service_GetService(IMFGetService *iface, REFGU
{
while
(
IMFCollection_GetElement
(
nodes
,
i
++
,
(
IUnknown
**
)
&
node
)
==
S_OK
)
{
if
(
SUCCEEDED
(
IMFTopologyNode_GetObject
(
node
,
&
object
)))
if
(
SUCCEEDED
(
topology_node_get_object
(
node
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
)))
{
if
(
SUCCEEDED
(
I
Unknown_QueryInterface
(
object
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_
sink
)))
if
(
SUCCEEDED
(
I
MFStreamSink_GetMediaSink
(
stream_sink
,
&
sink
)))
{
if
(
SUCCEEDED
(
IMF
StreamSink_GetMediaSink
(
stream_sink
,
&
sink
)))
if
(
SUCCEEDED
(
IMF
MediaSink_QueryInterface
(
sink
,
&
IID_IMFVideoRenderer
,
(
void
**
)
&
vr
)))
{
if
(
SUCCEEDED
(
IMFMediaSink_QueryInterface
(
sink
,
&
IID_IMFVideoRenderer
,
(
void
**
)
&
vr
)))
{
if
(
FAILED
(
hr
=
MFGetService
(
vr
,
service
,
riid
,
obj
)))
WARN
(
"Failed to get service from video renderer %#x.
\n
"
,
hr
);
IUnknown_Release
(
vr
);
}
if
(
FAILED
(
hr
=
MFGetService
(
vr
,
service
,
riid
,
obj
)))
WARN
(
"Failed to get service from video renderer %#x.
\n
"
,
hr
);
IUnknown_Release
(
vr
);
}
IMFStreamSink_Release
(
stream_sink
);
}
IUnknown_Release
(
object
);
IMFStreamSink_Release
(
stream_sink
);
}
IMFTopologyNode_Release
(
node
);
...
...
dlls/mf/topology.c
View file @
c55dbcdb
...
...
@@ -1786,6 +1786,22 @@ static HRESULT create_topology_node(MF_TOPOLOGY_TYPE node_type, struct topology_
return
S_OK
;
}
HRESULT
topology_node_get_object
(
IMFTopologyNode
*
node
,
REFIID
riid
,
void
**
obj
)
{
IUnknown
*
unk
;
HRESULT
hr
;
*
obj
=
NULL
;
if
(
SUCCEEDED
(
hr
=
IMFTopologyNode_GetObject
(
node
,
&
unk
)))
{
hr
=
IUnknown_QueryInterface
(
unk
,
riid
,
obj
);
IUnknown_Release
(
unk
);
}
return
hr
;
}
/***********************************************************************
* MFCreateTopologyNode (mf.@)
*/
...
...
@@ -1817,7 +1833,6 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO
IMFStreamDescriptor
*
sd
;
IMFTransform
*
transform
;
UINT32
primary_output
;
IUnknown
*
object
;
HRESULT
hr
;
TRACE
(
"%p, %u, %d, %p.
\n
"
,
node
,
stream
,
output
,
type
);
...
...
@@ -1828,12 +1843,7 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO
switch
(
node_type
)
{
case
MF_TOPOLOGY_OUTPUT_NODE
:
if
(
FAILED
(
hr
=
IMFTopologyNode_GetObject
(
node
,
&
object
)))
return
hr
;
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
);
IUnknown_Release
(
object
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
topology_node_get_object
(
node
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
)))
{
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream_sink
,
&
type_handler
);
IMFStreamSink_Release
(
stream_sink
);
...
...
@@ -1861,12 +1871,7 @@ HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOO
}
break
;
case
MF_TOPOLOGY_TRANSFORM_NODE
:
if
(
FAILED
(
hr
=
IMFTopologyNode_GetObject
(
node
,
&
object
)))
return
hr
;
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IMFTransform
,
(
void
**
)
&
transform
);
IUnknown_Release
(
object
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
=
topology_node_get_object
(
node
,
&
IID_IMFTransform
,
(
void
**
)
&
transform
)))
{
if
(
output
)
hr
=
IMFTransform_GetOutputCurrentType
(
transform
,
stream
,
type
);
...
...
@@ -2163,7 +2168,6 @@ static HRESULT topology_loader_get_node_type_handler(IMFTopologyNode *node, IMFM
MF_TOPOLOGY_TYPE
node_type
;
IMFStreamSink
*
stream_sink
;
IMFStreamDescriptor
*
sd
;
IUnknown
*
object
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IMFTopologyNode_GetNodeType
(
node
,
&
node_type
)))
...
...
@@ -2172,14 +2176,10 @@ static HRESULT topology_loader_get_node_type_handler(IMFTopologyNode *node, IMFM
switch
(
node_type
)
{
case
MF_TOPOLOGY_OUTPUT_NODE
:
if
(
SUCCEEDED
(
hr
=
IMFTopologyNode_GetObject
(
node
,
(
IUnknown
**
)
&
object
)))
if
(
SUCCEEDED
(
hr
=
topology_node_get_object
(
node
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
)))
{
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
)))
{
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream_sink
,
handler
);
IMFStreamSink_Release
(
stream_sink
);
}
IUnknown_Release
(
object
);
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream_sink
,
handler
);
IMFStreamSink_Release
(
stream_sink
);
}
break
;
case
MF_TOPOLOGY_SOURCESTREAM_NODE
:
...
...
@@ -2368,22 +2368,20 @@ static BOOL topology_loader_is_node_d3d_aware(IMFTopologyNode *node)
{
IMFAttributes
*
attributes
;
unsigned
int
d3d_aware
=
0
;
I
Unknown
*
object
=
NULL
;
I
MFTransform
*
transform
;
if
(
FAILED
(
IMFTopologyNode_GetObject
(
node
,
&
object
)))
if
(
FAILED
(
topology_node_get_object
(
node
,
&
IID_IMFAttributes
,
(
void
**
)
&
attributes
)))
return
FALSE
;
if
(
SUCCEEDED
(
IUnknown_QueryInterface
(
object
,
&
IID_IMFAttributes
,
(
void
**
)
&
attributes
)))
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D_AWARE
,
&
d3d_aware
);
IMFAttributes_Release
(
attributes
);
if
(
!
d3d_aware
&&
SUCCEEDED
(
topology_node_get_object
(
node
,
&
IID_IMFTransform
,
(
void
**
)
&
transform
)))
{
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D_AWARE
,
&
d3d_aware
);
IMF
Attributes_Release
(
attributes
);
d3d_aware
=
mf_is_sample_copier_transform
(
transform
);
IMF
Transform_Release
(
transform
);
}
if
(
!
d3d_aware
)
d3d_aware
=
mf_is_sample_copier_transform
(
object
);
IUnknown_Release
(
object
);
return
!!
d3d_aware
;
}
...
...
@@ -2454,7 +2452,7 @@ static HRESULT topology_loader_connect_d3d_aware_input(struct topoloader_context
IMFTransform
*
copier
=
NULL
;
HRESULT
hr
=
S_OK
;
IMFTopologyNode_GetObject
(
node
,
(
IUnknown
**
)
&
stream_sink
);
topology_node_get_object
(
node
,
&
IID_IMFStreamSink
,
(
void
**
)
&
stream_sink
);
if
(
topology_loader_is_node_d3d_aware
(
node
))
{
...
...
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