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
d98eae89
Commit
d98eae89
authored
Sep 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Keep input / output stream info in struct color_convert.
And calculate the sizes when media type is successfully changed.
parent
076f348c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
36 deletions
+26
-36
color_convert.c
dlls/winegstreamer/color_convert.c
+26
-36
No files found.
dlls/winegstreamer/color_convert.c
View file @
d98eae89
...
...
@@ -80,8 +80,11 @@ struct color_convert
IPropertyStore
IPropertyStore_iface
;
IUnknown
*
outer
;
LONG
refcount
;
IMFMediaType
*
input_type
;
MFT_INPUT_STREAM_INFO
input_info
;
IMFMediaType
*
output_type
;
MFT_OUTPUT_STREAM_INFO
output_info
;
struct
wg_transform
*
wg_transform
;
struct
wg_sample_queue
*
wg_sample_queue
;
...
...
@@ -228,54 +231,32 @@ static HRESULT WINAPI transform_GetStreamIDs(IMFTransform *iface, DWORD input_si
static
HRESULT
WINAPI
transform_GetInputStreamInfo
(
IMFTransform
*
iface
,
DWORD
id
,
MFT_INPUT_STREAM_INFO
*
info
)
{
struct
color_convert
*
impl
=
impl_from_IMFTransform
(
iface
);
UINT32
sample_size
;
UINT64
framesize
;
GUID
subtype
;
HRESULT
hr
;
TRACE
(
"iface %p, id %#lx, info %p.
\n
"
,
iface
,
id
,
info
);
if
(
!
impl
->
input_type
||
!
impl
->
output_type
)
{
memset
(
info
,
0
,
sizeof
(
*
info
));
return
MF_E_TRANSFORM_TYPE_NOT_SET
;
}
if
(
SUCCEEDED
(
hr
=
IMFMediaType_GetGUID
(
impl
->
input_type
,
&
MF_MT_SUBTYPE
,
&
subtype
))
&&
SUCCEEDED
(
hr
=
IMFMediaType_GetUINT64
(
impl
->
input_type
,
&
MF_MT_FRAME_SIZE
,
&
framesize
)))
MFCalculateImageSize
(
&
subtype
,
framesize
>>
32
,
(
UINT32
)
framesize
,
&
sample_size
);
else
sample_size
=
0
;
info
->
dwFlags
=
0
;
info
->
cbSize
=
sample_size
;
info
->
cbAlignment
=
1
;
info
->
hnsMaxLatency
=
0
;
info
->
cbMaxLookahead
=
0
;
*
info
=
impl
->
input_info
;
return
S_OK
;
}
static
HRESULT
WINAPI
transform_GetOutputStreamInfo
(
IMFTransform
*
iface
,
DWORD
id
,
MFT_OUTPUT_STREAM_INFO
*
info
)
{
struct
color_convert
*
impl
=
impl_from_IMFTransform
(
iface
);
UINT32
sample_size
;
UINT64
framesize
;
GUID
subtype
;
HRESULT
hr
;
TRACE
(
"iface %p, id %#lx, info %p.
\n
"
,
iface
,
id
,
info
);
if
(
!
impl
->
input_type
||
!
impl
->
output_type
)
{
memset
(
info
,
0
,
sizeof
(
*
info
));
return
MF_E_TRANSFORM_TYPE_NOT_SET
;
}
if
(
SUCCEEDED
(
hr
=
IMFMediaType_GetGUID
(
impl
->
output_type
,
&
MF_MT_SUBTYPE
,
&
subtype
))
&&
SUCCEEDED
(
hr
=
IMFMediaType_GetUINT64
(
impl
->
output_type
,
&
MF_MT_FRAME_SIZE
,
&
framesize
)))
MFCalculateImageSize
(
&
subtype
,
framesize
>>
32
,
(
UINT32
)
framesize
,
&
sample_size
);
else
sample_size
=
0
;
info
->
dwFlags
=
0
;
info
->
cbSize
=
sample_size
;
info
->
cbAlignment
=
1
;
*
info
=
impl
->
output_info
;
return
S_OK
;
}
...
...
@@ -380,8 +361,8 @@ done:
static
HRESULT
WINAPI
transform_SetInputType
(
IMFTransform
*
iface
,
DWORD
id
,
IMFMediaType
*
type
,
DWORD
flags
)
{
struct
color_convert
*
impl
=
impl_from_IMFTransform
(
iface
);
MF_ATTRIBUTE_TYPE
item_type
;
GUID
major
,
subtype
;
UINT64
frame_size
;
HRESULT
hr
;
ULONG
i
;
...
...
@@ -392,8 +373,7 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
return
MF_E_ATTRIBUTENOTFOUND
;
if
(
!
IsEqualGUID
(
&
major
,
&
MFMediaType_Video
)
||
FAILED
(
IMFMediaType_GetItemType
(
type
,
&
MF_MT_FRAME_SIZE
,
&
item_type
))
||
item_type
!=
MF_ATTRIBUTE_UINT64
)
||
IMFMediaType_GetUINT64
(
type
,
&
MF_MT_FRAME_SIZE
,
&
frame_size
))
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
input_types
);
++
i
)
...
...
@@ -419,14 +399,18 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
impl
->
input_type
=
NULL
;
}
if
(
FAILED
(
hr
)
||
FAILED
(
MFCalculateImageSize
(
&
subtype
,
frame_size
>>
32
,
(
UINT32
)
frame_size
,
(
UINT32
*
)
&
impl
->
input_info
.
cbSize
)))
impl
->
input_info
.
cbSize
=
0
;
return
hr
;
}
static
HRESULT
WINAPI
transform_SetOutputType
(
IMFTransform
*
iface
,
DWORD
id
,
IMFMediaType
*
type
,
DWORD
flags
)
{
struct
color_convert
*
impl
=
impl_from_IMFTransform
(
iface
);
MF_ATTRIBUTE_TYPE
item_type
;
GUID
major
,
subtype
;
UINT64
frame_size
;
HRESULT
hr
;
ULONG
i
;
...
...
@@ -437,8 +421,7 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
return
MF_E_ATTRIBUTENOTFOUND
;
if
(
!
IsEqualGUID
(
&
major
,
&
MFMediaType_Video
)
||
FAILED
(
IMFMediaType_GetItemType
(
type
,
&
MF_MT_FRAME_SIZE
,
&
item_type
))
||
item_type
!=
MF_ATTRIBUTE_UINT64
)
||
IMFMediaType_GetUINT64
(
type
,
&
MF_MT_FRAME_SIZE
,
&
frame_size
))
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
output_types
);
++
i
)
...
...
@@ -464,6 +447,10 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
impl
->
output_type
=
NULL
;
}
if
(
FAILED
(
hr
)
||
FAILED
(
MFCalculateImageSize
(
&
subtype
,
frame_size
>>
32
,
(
UINT32
)
frame_size
,
(
UINT32
*
)
&
impl
->
output_info
.
cbSize
)))
impl
->
output_info
.
cbSize
=
0
;
return
hr
;
}
...
...
@@ -963,6 +950,9 @@ HRESULT color_convert_create(IUnknown *outer, IUnknown **out)
impl
->
refcount
=
1
;
impl
->
outer
=
outer
?
outer
:
&
impl
->
IUnknown_inner
;
impl
->
input_info
.
cbAlignment
=
1
;
impl
->
output_info
.
cbAlignment
=
1
;
*
out
=
&
impl
->
IUnknown_inner
;
TRACE
(
"Created %p
\n
"
,
*
out
);
return
S_OK
;
...
...
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