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
ab2a0d7f
Commit
ab2a0d7f
authored
Oct 19, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/mixer: Map render target type to video processor guid that supports it.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
60bf1b25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
19 deletions
+32
-19
mixer.c
dlls/evr/mixer.c
+32
-19
No files found.
dlls/evr/mixer.c
View file @
ab2a0d7f
...
...
@@ -46,11 +46,18 @@ struct input_stream
IMFSample
*
sample
;
};
struct
rt_format
{
GUID
device
;
D3DFORMAT
format
;
IMFMediaType
*
media_type
;
};
struct
output_stream
{
IMFMediaType
*
media_type
;
IMFMediaType
**
media_type
s
;
unsigned
int
type
_count
;
struct
rt_format
*
rt_format
s
;
unsigned
int
rt_formats
_count
;
};
struct
video_mixer
...
...
@@ -177,11 +184,11 @@ static void video_mixer_clear_types(struct video_mixer *mixer)
IMFSample_Release
(
mixer
->
inputs
[
i
].
sample
);
mixer
->
inputs
[
i
].
sample
=
NULL
;
}
for
(
i
=
0
;
i
<
mixer
->
output
.
type
_count
;
++
i
)
for
(
i
=
0
;
i
<
mixer
->
output
.
rt_formats
_count
;
++
i
)
{
IMFMediaType_Release
(
mixer
->
output
.
media_types
[
i
]
);
IMFMediaType_Release
(
mixer
->
output
.
rt_formats
[
i
].
media_type
);
}
heap_free
(
mixer
->
output
.
media_type
s
);
heap_free
(
mixer
->
output
.
rt_format
s
);
if
(
mixer
->
output
.
media_type
)
IMFMediaType_Release
(
mixer
->
output
.
media_type
);
mixer
->
output
.
media_type
=
NULL
;
...
...
@@ -564,11 +571,11 @@ static HRESULT WINAPI video_mixer_transform_GetOutputAvailableType(IMFTransform
if
(
!
mixer
->
inputs
[
0
].
media_type
)
hr
=
MF_E_TRANSFORM_TYPE_NOT_SET
;
else
if
(
index
>=
mixer
->
output
.
type
_count
)
else
if
(
index
>=
mixer
->
output
.
rt_formats
_count
)
hr
=
MF_E_NO_MORE_TYPES
;
else
{
*
type
=
(
IMFMediaType
*
)
mixer
->
output
.
media_types
[
index
]
;
*
type
=
mixer
->
output
.
rt_formats
[
index
].
media_type
;
IMFMediaType_AddRef
(
*
type
);
}
...
...
@@ -609,10 +616,10 @@ done:
static
int
rt_formats_sort_compare
(
const
void
*
left
,
const
void
*
right
)
{
D3DFORMAT
format1
=
*
(
D3DFORMAT
*
)
left
,
format2
=
*
(
D3DFORMAT
*
)
right
;
const
struct
rt_format
*
format1
=
left
,
*
format2
=
right
;
if
(
format1
<
format2
)
return
-
1
;
if
(
format1
>
format2
)
return
1
;
if
(
format1
->
format
<
format2
->
format
)
return
-
1
;
if
(
format1
->
format
>
format2
->
format
)
return
1
;
return
0
;
}
...
...
@@ -620,8 +627,9 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
IDirectXVideoProcessorService
*
service
,
unsigned
int
device_count
,
const
GUID
*
devices
,
unsigned
int
flags
)
{
unsigned
int
i
,
j
,
format_count
,
count
;
D3DFORMAT
*
rt_formats
=
NULL
,
*
formats
,
*
ptr
;
struct
rt_format
*
rt_formats
=
NULL
,
*
ptr
;
HRESULT
hr
=
MF_E_INVALIDMEDIATYPE
;
D3DFORMAT
*
formats
;
GUID
subtype
;
count
=
0
;
...
...
@@ -639,7 +647,11 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
}
rt_formats
=
ptr
;
memcpy
(
&
rt_formats
[
count
],
formats
,
format_count
*
sizeof
(
*
formats
));
for
(
j
=
0
;
j
<
format_count
;
++
j
)
{
rt_formats
[
count
+
j
].
format
=
formats
[
j
];
rt_formats
[
count
+
j
].
device
=
devices
[
i
];
}
count
+=
format_count
;
CoTaskMemFree
(
formats
);
...
...
@@ -653,7 +665,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
j
=
0
;
for
(
i
=
j
+
1
;
i
<
count
;
++
i
)
{
if
(
rt_formats
[
i
]
!=
rt_formats
[
j
]
)
if
(
rt_formats
[
i
]
.
format
!=
rt_formats
[
j
].
format
)
{
rt_formats
[
++
j
]
=
rt_formats
[
i
];
}
...
...
@@ -661,14 +673,15 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
count
=
j
+
1
;
memcpy
(
&
subtype
,
&
MFVideoFormat_Base
,
sizeof
(
subtype
));
if
((
mixer
->
output
.
media_types
=
heap_calloc
(
count
,
sizeof
(
*
mixer
->
output
.
media_type
s
))))
if
((
mixer
->
output
.
rt_formats
=
heap_calloc
(
count
,
sizeof
(
*
mixer
->
output
.
rt_format
s
))))
{
for
(
i
=
0
;
i
<
count
;
++
i
)
{
subtype
.
Data1
=
rt_formats
[
i
];
MFCreateVideoMediaTypeFromSubtype
(
&
subtype
,
(
IMFVideoMediaType
**
)
&
mixer
->
output
.
media_types
[
i
]);
subtype
.
Data1
=
rt_formats
[
i
].
format
;
mixer
->
output
.
rt_formats
[
i
]
=
rt_formats
[
i
];
MFCreateVideoMediaTypeFromSubtype
(
&
subtype
,
(
IMFVideoMediaType
**
)
&
mixer
->
output
.
rt_formats
[
i
].
media_type
);
}
mixer
->
output
.
type
_count
=
count
;
mixer
->
output
.
rt_formats
_count
=
count
;
}
else
{
...
...
@@ -757,10 +770,10 @@ static HRESULT WINAPI video_mixer_transform_SetOutputType(IMFTransform *iface, D
EnterCriticalSection
(
&
mixer
->
cs
);
for
(
i
=
0
;
i
<
mixer
->
output
.
type
_count
;
++
i
)
for
(
i
=
0
;
i
<
mixer
->
output
.
rt_formats
_count
;
++
i
)
{
compare_flags
=
0
;
if
(
FAILED
(
IMFMediaType_IsEqual
(
type
,
mixer
->
output
.
media_types
[
i
]
,
&
compare_flags
)))
if
(
FAILED
(
IMFMediaType_IsEqual
(
type
,
mixer
->
output
.
rt_formats
[
i
].
media_type
,
&
compare_flags
)))
continue
;
if
((
compare_flags
&
equality_flags
)
==
equality_flags
)
...
...
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