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
6599f2ff
Commit
6599f2ff
authored
Feb 17, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Complete H264 current output type reported attributes.
parent
a6d77cfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
h264_decoder.c
dlls/winegstreamer/h264_decoder.c
+16
-17
No files found.
dlls/winegstreamer/h264_decoder.c
View file @
6599f2ff
...
...
@@ -115,9 +115,9 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder)
}
static
HRESULT
create_output_media_type
(
struct
h264_decoder
*
decoder
,
const
GUID
*
subtype
,
IMFMediaType
**
media_type
)
IMFMediaType
*
output_type
,
IMFMediaType
*
*
media_type
)
{
IMFMediaType
*
default_type
=
decoder
->
output_type
;
IMFMediaType
*
default_type
=
decoder
->
output_type
,
*
stream_type
=
output_type
?
output_type
:
decoder
->
stream_type
;
IMFVideoMediaType
*
video_type
;
UINT32
value
,
width
,
height
;
MFVideoArea
aperture
;
...
...
@@ -127,31 +127,31 @@ static HRESULT create_output_media_type(struct h264_decoder *decoder, const GUID
if
(
FAILED
(
hr
=
MFCreateVideoMediaTypeFromSubtype
(
subtype
,
&
video_type
)))
return
hr
;
if
(
FAILED
(
IMFMediaType_GetUINT64
(
decoder
->
stream_type
,
&
MF_MT_FRAME_SIZE
,
&
ratio
)))
if
(
FAILED
(
IMFMediaType_GetUINT64
(
stream_type
,
&
MF_MT_FRAME_SIZE
,
&
ratio
)))
ratio
=
(
UINT64
)
1920
<<
32
|
1080
;
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetUINT64
(
video_type
,
&
MF_MT_FRAME_SIZE
,
ratio
)))
goto
done
;
width
=
ratio
>>
32
;
height
=
ratio
;
if
(
FAILED
(
IMFMediaType_GetUINT64
(
decoder
->
stream_type
,
&
MF_MT_FRAME_RATE
,
&
ratio
)))
if
(
FAILED
(
IMFMediaType_GetUINT64
(
stream_type
,
&
MF_MT_FRAME_RATE
,
&
ratio
)))
ratio
=
(
UINT64
)
30000
<<
32
|
1001
;
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetUINT64
(
video_type
,
&
MF_MT_FRAME_RATE
,
ratio
)))
goto
done
;
if
(
FAILED
(
IMFMediaType_GetUINT64
(
decoder
->
stream_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
&
ratio
)))
if
(
FAILED
(
IMFMediaType_GetUINT64
(
stream_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
&
ratio
)))
ratio
=
(
UINT64
)
1
<<
32
|
1
;
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetUINT64
(
video_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
ratio
)))
goto
done
;
if
(
FAILED
(
hr
=
MFCalculateImageSize
(
subtype
,
width
,
height
,
&
value
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetUINT32
(
video_type
,
&
MF_MT_SAMPLE_SIZE
,
value
)))
if
(
!
output_type
||
FAILED
(
IMFMediaType_GetUINT32
(
output_type
,
&
MF_MT_SAMPLE_SIZE
,
&
value
)))
hr
=
MFCalculateImageSize
(
subtype
,
width
,
height
,
&
value
)
;
if
(
FAILED
(
hr
)
||
FAILED
(
hr
=
IMFVideoMediaType_SetUINT32
(
video_type
,
&
MF_MT_SAMPLE_SIZE
,
value
)))
goto
done
;
if
(
FAILED
(
hr
=
MFGetStrideForBitmapInfoHeader
(
subtype
->
Data1
,
width
,
(
LONG
*
)
&
value
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetUINT32
(
video_type
,
&
MF_MT_DEFAULT_STRIDE
,
value
)))
if
(
!
output_type
||
FAILED
(
IMFMediaType_GetUINT32
(
output_type
,
&
MF_MT_DEFAULT_STRIDE
,
&
value
)))
hr
=
MFGetStrideForBitmapInfoHeader
(
subtype
->
Data1
,
width
,
(
LONG
*
)
&
value
)
;
if
(
FAILED
(
hr
)
||
FAILED
(
hr
=
IMFVideoMediaType_SetUINT32
(
video_type
,
&
MF_MT_DEFAULT_STRIDE
,
value
)))
goto
done
;
if
(
!
default_type
||
FAILED
(
IMFMediaType_GetUINT32
(
default_type
,
&
MF_MT_INTERLACE_MODE
,
&
value
)))
...
...
@@ -174,7 +174,7 @@ static HRESULT create_output_media_type(struct h264_decoder *decoder, const GUID
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetUINT32
(
video_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
value
)))
goto
done
;
if
(
SUCCEEDED
(
IMFMediaType_GetBlob
(
decoder
->
stream_type
,
&
MF_MT_MINIMUM_DISPLAY_APERTURE
,
if
(
SUCCEEDED
(
IMFMediaType_GetBlob
(
stream_type
,
&
MF_MT_MINIMUM_DISPLAY_APERTURE
,
(
BYTE
*
)
&
aperture
,
sizeof
(
aperture
),
&
value
)))
{
if
(
FAILED
(
hr
=
IMFVideoMediaType_SetBlob
(
video_type
,
&
MF_MT_MINIMUM_DISPLAY_APERTURE
,
...
...
@@ -394,7 +394,7 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR
return
MF_E_TRANSFORM_TYPE_NOT_SET
;
if
(
index
>=
decoder
->
output_type_count
)
return
MF_E_NO_MORE_TYPES
;
return
create_output_media_type
(
decoder
,
decoder
->
output_types
[
index
],
type
);
return
create_output_media_type
(
decoder
,
decoder
->
output_types
[
index
],
NULL
,
type
);
}
static
HRESULT
WINAPI
transform_SetInputType
(
IMFTransform
*
iface
,
DWORD
id
,
IMFMediaType
*
type
,
DWORD
flags
)
...
...
@@ -521,17 +521,16 @@ static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD i
static
HRESULT
WINAPI
transform_GetOutputCurrentType
(
IMFTransform
*
iface
,
DWORD
id
,
IMFMediaType
**
type
)
{
struct
h264_decoder
*
decoder
=
impl_from_IMFTransform
(
iface
);
GUID
subtype
;
HRESULT
hr
;
TRACE
(
"iface %p, id %#lx, type %p
\n
"
,
iface
,
id
,
type
);
if
(
!
decoder
->
output_type
)
return
MF_E_TRANSFORM_TYPE_NOT_SET
;
if
(
FAILED
(
hr
=
MFCreateMediaType
(
type
)))
if
(
FAILED
(
hr
=
IMFMediaType_GetGUID
(
decoder
->
output_type
,
&
MF_MT_SUBTYPE
,
&
subtype
)))
return
hr
;
return
IMFMediaType_CopyAllItems
(
decoder
->
output_type
,
(
IMFAttributes
*
)
*
type
);
return
create_output_media_type
(
decoder
,
&
subtype
,
decoder
->
output_type
,
type
);
}
static
HRESULT
WINAPI
transform_GetInputStatus
(
IMFTransform
*
iface
,
DWORD
id
,
DWORD
*
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