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
15346b36
Commit
15346b36
authored
Nov 18, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/evr: Derive stream attributes from mixer input attributes.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1deea8e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
evr.c
dlls/mf/evr.c
+31
-11
mf.c
dlls/mf/tests/mf.c
+1
-2
No files found.
dlls/mf/evr.c
View file @
15346b36
...
...
@@ -942,10 +942,26 @@ static const IMFAttributesVtbl video_stream_attributes_vtbl =
video_stream_attributes_CopyAllItems
,
};
static
BOOL
video_renderer_is_mixer_d3d_aware
(
const
struct
video_renderer
*
renderer
)
{
IMFAttributes
*
attributes
;
unsigned
int
value
=
0
;
BOOL
ret
;
if
(
FAILED
(
IMFTransform_QueryInterface
(
renderer
->
mixer
,
&
IID_IMFAttributes
,
(
void
**
)
&
attributes
)))
return
FALSE
;
ret
=
SUCCEEDED
(
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D_AWARE
,
&
value
))
&&
value
;
IMFAttributes_Release
(
attributes
);
return
ret
;
}
static
HRESULT
video_renderer_stream_create
(
struct
video_renderer
*
renderer
,
unsigned
int
id
,
struct
video_stream
**
ret
)
{
struct
video_stream
*
stream
;
IMFAttributes
*
attributes
;
unsigned
int
value
;
HRESULT
hr
;
if
(
!
(
stream
=
heap_alloc_zero
(
sizeof
(
*
stream
))))
...
...
@@ -968,6 +984,16 @@ static HRESULT video_renderer_stream_create(struct video_renderer *renderer, uns
IMFMediaSink_AddRef
(
&
stream
->
parent
->
IMFMediaSink_iface
);
stream
->
id
=
id
;
if
(
video_renderer_is_mixer_d3d_aware
(
renderer
))
IMFAttributes_SetUINT32
(
stream
->
attributes
,
&
MF_SA_D3D_AWARE
,
1
);
if
(
SUCCEEDED
(
IMFTransform_GetInputStreamAttributes
(
renderer
->
mixer
,
id
,
&
attributes
)))
{
if
(
SUCCEEDED
(
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_REQUIRED_SAMPLE_COUNT
,
&
value
)))
IMFAttributes_SetUINT32
(
stream
->
attributes
,
&
MF_SA_REQUIRED_SAMPLE_COUNT
,
value
);
IMFAttributes_Release
(
attributes
);
}
*
ret
=
stream
;
return
S_OK
;
...
...
@@ -1491,7 +1517,6 @@ static HRESULT video_renderer_create_presenter(struct video_renderer *renderer,
static
HRESULT
video_renderer_configure_mixer
(
struct
video_renderer
*
renderer
)
{
IMFTopologyServiceLookupClient
*
lookup_client
;
IMFAttributes
*
attributes
;
HRESULT
hr
;
if
(
SUCCEEDED
(
hr
=
IMFTransform_QueryInterface
(
renderer
->
mixer
,
&
IID_IMFTopologyServiceLookupClient
,
...
...
@@ -1537,21 +1562,16 @@ static HRESULT video_renderer_configure_mixer(struct video_renderer *renderer)
}
/* Set device manager that presenter should have created. */
if
(
SUCCEEDED
(
IMFTransform_QueryInterface
(
renderer
->
mixer
,
&
IID_IMFAttributes
,
(
void
**
)
&
attributes
)
))
if
(
video_renderer_is_mixer_d3d_aware
(
renderer
))
{
IDirect3DDeviceManager9
*
device_manager
;
unsigned
int
value
;
if
(
SUCCEEDED
(
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D_AWARE
,
&
value
))
&&
value
)
if
(
SUCCEEDED
(
MFGetService
((
IUnknown
*
)
renderer
->
presenter
,
&
MR_VIDEO_ACCELERATION_SERVICE
,
&
IID_IDirect3DDeviceManager9
,
(
void
**
)
&
device_manager
)))
{
if
(
SUCCEEDED
(
MFGetService
((
IUnknown
*
)
renderer
->
presenter
,
&
MR_VIDEO_ACCELERATION_SERVICE
,
&
IID_IDirect3DDeviceManager9
,
(
void
**
)
&
device_manager
)))
{
IMFTransform_ProcessMessage
(
renderer
->
mixer
,
MFT_MESSAGE_SET_D3D_MANAGER
,
(
ULONG_PTR
)
device_manager
);
IDirect3DDeviceManager9_Release
(
device_manager
);
}
IMFTransform_ProcessMessage
(
renderer
->
mixer
,
MFT_MESSAGE_SET_D3D_MANAGER
,
(
ULONG_PTR
)
device_manager
);
IDirect3DDeviceManager9_Release
(
device_manager
);
}
IMFAttributes_Release
(
attributes
);
}
return
hr
;
...
...
dlls/mf/tests/mf.c
View file @
15346b36
...
...
@@ -3341,7 +3341,6 @@ static void test_evr(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFAttributes_GetCount
(
attributes
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
todo_wine
{
ok
(
count
==
2
,
"Unexpected count %u.
\n
"
,
count
);
value
=
0
;
hr
=
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_REQUIRED_SAMPLE_COUNT
,
&
value
);
...
...
@@ -3351,7 +3350,7 @@ todo_wine {
hr
=
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D_AWARE
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
1
,
"Unexpected attribute value %u.
\n
"
,
value
);
}
hr
=
IMFAttributes_QueryInterface
(
attributes
,
&
IID_IMFStreamSink
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
...
...
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