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
ef354da5
Commit
ef354da5
authored
Jan 24, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Set the MF_MT_DEFAULT_STRIDE attribute in mf_media_type_from_wg_format().
parent
98d20975
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
3 deletions
+78
-3
mfplat.c
dlls/mfreadwrite/tests/mfplat.c
+3
-3
gst_private.h
dlls/winegstreamer/gst_private.h
+4
-0
main.c
dlls/winegstreamer/main.c
+64
-0
mfplat.c
dlls/winegstreamer/mfplat.c
+7
-0
No files found.
dlls/mfreadwrite/tests/mfplat.c
View file @
ef354da5
...
...
@@ -821,7 +821,7 @@ static void test_source_reader(const char *filename, bool video)
(
unsigned
int
)(
framesize
>>
32
),
(
unsigned
int
)
framesize
);
hr
=
IMFMediaType_GetUINT32
(
mediatype
,
&
MF_MT_DEFAULT_STRIDE
,
&
stride
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaType_Release
(
mediatype
);
...
...
@@ -845,8 +845,8 @@ static void test_source_reader(const char *filename, bool video)
ok
(
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_NV12
),
"Got subtype %s.
\n
"
,
debugstr_guid
(
&
subtype
));
hr
=
IMFMediaType_GetUINT32
(
mediatype
,
&
MF_MT_DEFAULT_STRIDE
,
&
stride
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
stride
==
160
,
"Got stride %u.
\n
"
,
stride
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
stride
==
160
,
"Got stride %u.
\n
"
,
stride
);
IMFMediaType_Release
(
mediatype
);
...
...
dlls/winegstreamer/gst_private.h
View file @
ef354da5
...
...
@@ -148,6 +148,10 @@ HRESULT wg_transform_read_dmo(struct wg_transform *transform, DMO_OUTPUT_DATA_BU
HRESULT
winegstreamer_stream_handler_create
(
REFIID
riid
,
void
**
obj
);
unsigned
int
wg_format_get_stride
(
const
struct
wg_format
*
format
);
bool
wg_video_format_is_rgb
(
enum
wg_video_format
format
);
HRESULT
aac_decoder_create
(
REFIID
riid
,
void
**
ret
);
HRESULT
h264_decoder_create
(
REFIID
riid
,
void
**
ret
);
HRESULT
video_processor_create
(
REFIID
riid
,
void
**
ret
);
...
...
dlls/winegstreamer/main.c
View file @
ef354da5
...
...
@@ -413,6 +413,70 @@ bool wg_transform_set_output_format(struct wg_transform *transform, struct wg_fo
return
!
WINE_UNIX_CALL
(
unix_wg_transform_set_output_format
,
&
params
);
}
#define ALIGN(n, alignment) (((n) + (alignment) - 1) & ~((alignment) - 1))
unsigned
int
wg_format_get_stride
(
const
struct
wg_format
*
format
)
{
const
unsigned
int
width
=
format
->
u
.
video
.
width
;
switch
(
format
->
u
.
video
.
format
)
{
case
WG_VIDEO_FORMAT_AYUV
:
return
width
*
4
;
case
WG_VIDEO_FORMAT_BGRA
:
case
WG_VIDEO_FORMAT_BGRx
:
return
width
*
4
;
case
WG_VIDEO_FORMAT_BGR
:
return
ALIGN
(
width
*
3
,
4
);
case
WG_VIDEO_FORMAT_UYVY
:
case
WG_VIDEO_FORMAT_YUY2
:
case
WG_VIDEO_FORMAT_YVYU
:
return
ALIGN
(
width
*
2
,
4
);
case
WG_VIDEO_FORMAT_RGB15
:
case
WG_VIDEO_FORMAT_RGB16
:
return
ALIGN
(
width
*
2
,
4
);
case
WG_VIDEO_FORMAT_I420
:
case
WG_VIDEO_FORMAT_NV12
:
case
WG_VIDEO_FORMAT_YV12
:
return
ALIGN
(
width
,
4
);
/* Y plane */
case
WG_VIDEO_FORMAT_UNKNOWN
:
FIXME
(
"Cannot calculate stride for unknown video format.
\n
"
);
}
return
0
;
}
bool
wg_video_format_is_rgb
(
enum
wg_video_format
format
)
{
switch
(
format
)
{
case
WG_VIDEO_FORMAT_BGRA
:
case
WG_VIDEO_FORMAT_BGRx
:
case
WG_VIDEO_FORMAT_BGR
:
case
WG_VIDEO_FORMAT_RGB15
:
case
WG_VIDEO_FORMAT_RGB16
:
return
true
;
case
WG_VIDEO_FORMAT_AYUV
:
case
WG_VIDEO_FORMAT_I420
:
case
WG_VIDEO_FORMAT_NV12
:
case
WG_VIDEO_FORMAT_UYVY
:
case
WG_VIDEO_FORMAT_YUY2
:
case
WG_VIDEO_FORMAT_YV12
:
case
WG_VIDEO_FORMAT_YVYU
:
case
WG_VIDEO_FORMAT_UNKNOWN
:
break
;
}
return
false
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
instance
,
DWORD
reason
,
void
*
reserved
)
{
if
(
reason
==
DLL_PROCESS_ATTACH
)
...
...
dlls/winegstreamer/mfplat.c
View file @
ef354da5
...
...
@@ -511,6 +511,7 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format *
{
if
(
format
->
u
.
video
.
format
==
video_formats
[
i
].
format
)
{
unsigned
int
stride
=
wg_format_get_stride
(
format
);
int32_t
height
=
abs
(
format
->
u
.
video
.
height
);
int32_t
width
=
format
->
u
.
video
.
width
;
...
...
@@ -526,6 +527,12 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format *
IMFMediaType_SetUINT32
(
type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
TRUE
);
IMFMediaType_SetUINT32
(
type
,
&
MF_MT_VIDEO_ROTATION
,
MFVideoRotationFormat_0
);
if
(
wg_video_format_is_rgb
(
format
->
u
.
video
.
format
))
stride
=
-
stride
;
if
(
format
->
u
.
video
.
height
<
0
)
stride
=
-
stride
;
IMFMediaType_SetUINT32
(
type
,
&
MF_MT_DEFAULT_STRIDE
,
stride
);
if
(
!
IsRectEmpty
(
&
format
->
u
.
video
.
padding
))
{
MFVideoArea
aperture
=
...
...
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