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
654dc115
Commit
654dc115
authored
Apr 03, 2024
by
Ziqing Hui
Committed by
Alexandre Julliard
Apr 23, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Merge video_h264 into video field.
parent
b3a46a94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
31 deletions
+27
-31
mfplat.c
dlls/winegstreamer/mfplat.c
+11
-11
unixlib.h
dlls/winegstreamer/unixlib.h
+3
-7
wg_format.c
dlls/winegstreamer/wg_format.c
+13
-13
No files found.
dlls/winegstreamer/mfplat.c
View file @
654dc115
...
...
@@ -800,33 +800,33 @@ static void mf_media_type_to_wg_format_video_h264(IMFMediaType *type, struct wg_
if
(
SUCCEEDED
(
IMFMediaType_GetUINT64
(
type
,
&
MF_MT_FRAME_SIZE
,
&
frame_size
)))
{
format
->
u
.
video
_h264
.
width
=
frame_size
>>
32
;
format
->
u
.
video
_h264
.
height
=
(
UINT32
)
frame_size
;
format
->
u
.
video
.
width
=
frame_size
>>
32
;
format
->
u
.
video
.
height
=
(
UINT32
)
frame_size
;
}
if
(
SUCCEEDED
(
IMFMediaType_GetUINT64
(
type
,
&
MF_MT_FRAME_RATE
,
&
frame_rate
))
&&
(
UINT32
)
frame_rate
)
{
format
->
u
.
video
_h264
.
fps_n
=
frame_rate
>>
32
;
format
->
u
.
video
_h264
.
fps_d
=
(
UINT32
)
frame_rate
;
format
->
u
.
video
.
fps_n
=
frame_rate
>>
32
;
format
->
u
.
video
.
fps_d
=
(
UINT32
)
frame_rate
;
}
else
{
format
->
u
.
video
_h264
.
fps_n
=
1
;
format
->
u
.
video
_h264
.
fps_d
=
1
;
format
->
u
.
video
.
fps_n
=
1
;
format
->
u
.
video
.
fps_d
=
1
;
}
if
(
SUCCEEDED
(
IMFMediaType_GetUINT32
(
type
,
&
MF_MT_MPEG2_PROFILE
,
&
profile
)))
format
->
u
.
video
_h264
.
profile
=
profile
;
format
->
u
.
video
.
profile
=
profile
;
if
(
SUCCEEDED
(
IMFMediaType_GetUINT32
(
type
,
&
MF_MT_MPEG2_LEVEL
,
&
level
)))
format
->
u
.
video
_h264
.
level
=
level
;
format
->
u
.
video
.
level
=
level
;
if
(
SUCCEEDED
(
IMFMediaType_GetAllocatedBlob
(
type
,
&
MF_MT_MPEG_SEQUENCE_HEADER
,
&
codec_data
,
&
codec_data_len
)))
{
if
(
codec_data_len
<=
sizeof
(
format
->
u
.
video
_h264
.
codec_data
))
if
(
codec_data_len
<=
sizeof
(
format
->
u
.
video
.
codec_data
))
{
format
->
u
.
video
_h264
.
codec_data_len
=
codec_data_len
;
memcpy
(
format
->
u
.
video
_h264
.
codec_data
,
codec_data
,
codec_data_len
);
format
->
u
.
video
.
codec_data_len
=
codec_data_len
;
memcpy
(
format
->
u
.
video
.
codec_data
,
codec_data
,
codec_data_len
);
}
else
{
...
...
dlls/winegstreamer/unixlib.h
View file @
654dc115
...
...
@@ -122,7 +122,8 @@ struct wg_format
/* Valid members for different video formats:
*
* Uncompressed(RGB and YUV): width, height, fps_n, fps_d, padding.
* CINEPAK: width, height, fps_n, fps_d. */
* CINEPAK: width, height, fps_n, fps_d.
* H264: width, height, fps_n, fps_d, profile, level, codec_data_len, codec_data. */
struct
{
wg_video_format
format
;
...
...
@@ -132,16 +133,11 @@ struct wg_format
int32_t
width
,
height
;
uint32_t
fps_n
,
fps_d
;
RECT
padding
;
}
video
;
struct
{
int32_t
width
,
height
;
uint32_t
fps_n
,
fps_d
;
uint32_t
profile
;
uint32_t
level
;
uint32_t
codec_data_len
;
unsigned
char
codec_data
[
64
];
}
video
_h264
;
}
video
;
struct
{
wg_wmv_video_format
format
;
...
...
dlls/winegstreamer/wg_format.c
View file @
654dc115
...
...
@@ -680,20 +680,20 @@ static GstCaps *wg_format_to_caps_video_h264(const struct wg_format *format)
gst_caps_set_simple
(
caps
,
"stream-format"
,
G_TYPE_STRING
,
"byte-stream"
,
NULL
);
gst_caps_set_simple
(
caps
,
"alignment"
,
G_TYPE_STRING
,
"au"
,
NULL
);
if
(
format
->
u
.
video
_h264
.
width
)
gst_caps_set_simple
(
caps
,
"width"
,
G_TYPE_INT
,
format
->
u
.
video
_h264
.
width
,
NULL
);
if
(
format
->
u
.
video
_h264
.
height
)
gst_caps_set_simple
(
caps
,
"height"
,
G_TYPE_INT
,
format
->
u
.
video
_h264
.
height
,
NULL
);
if
(
format
->
u
.
video
_h264
.
fps_n
||
format
->
u
.
video_h264
.
fps_d
)
gst_caps_set_simple
(
caps
,
"framerate"
,
GST_TYPE_FRACTION
,
format
->
u
.
video
_h264
.
fps_n
,
format
->
u
.
video_h264
.
fps_d
,
NULL
);
if
(
format
->
u
.
video
.
width
)
gst_caps_set_simple
(
caps
,
"width"
,
G_TYPE_INT
,
format
->
u
.
video
.
width
,
NULL
);
if
(
format
->
u
.
video
.
height
)
gst_caps_set_simple
(
caps
,
"height"
,
G_TYPE_INT
,
format
->
u
.
video
.
height
,
NULL
);
if
(
format
->
u
.
video
.
fps_n
||
format
->
u
.
video
.
fps_d
)
gst_caps_set_simple
(
caps
,
"framerate"
,
GST_TYPE_FRACTION
,
format
->
u
.
video
.
fps_n
,
format
->
u
.
video
.
fps_d
,
NULL
);
switch
(
format
->
u
.
video
_h264
.
profile
)
switch
(
format
->
u
.
video
.
profile
)
{
case
eAVEncH264VProfile_Main
:
profile
=
"main"
;
break
;
case
eAVEncH264VProfile_High
:
profile
=
"high"
;
break
;
case
eAVEncH264VProfile_444
:
profile
=
"high-4:4:4"
;
break
;
default:
GST_FIXME
(
"H264 profile attribute %u not implemented."
,
format
->
u
.
video
_h264
.
profile
);
GST_FIXME
(
"H264 profile attribute %u not implemented."
,
format
->
u
.
video
.
profile
);
/* fallthrough */
case
eAVEncH264VProfile_unknown
:
profile
=
"baseline"
;
...
...
@@ -701,7 +701,7 @@ static GstCaps *wg_format_to_caps_video_h264(const struct wg_format *format)
}
gst_caps_set_simple
(
caps
,
"profile"
,
G_TYPE_STRING
,
profile
,
NULL
);
switch
(
format
->
u
.
video
_h264
.
level
)
switch
(
format
->
u
.
video
.
level
)
{
case
eAVEncH264VLevel1
:
level
=
"1"
;
break
;
case
eAVEncH264VLevel1_1
:
level
=
"1.1"
;
break
;
...
...
@@ -720,7 +720,7 @@ static GstCaps *wg_format_to_caps_video_h264(const struct wg_format *format)
case
eAVEncH264VLevel5_1
:
level
=
"5.1"
;
break
;
case
eAVEncH264VLevel5_2
:
level
=
"5.2"
;
break
;
default:
GST_FIXME
(
"H264 level attribute %u not implemented."
,
format
->
u
.
video
_h264
.
level
);
GST_FIXME
(
"H264 level attribute %u not implemented."
,
format
->
u
.
video
.
level
);
/* fallthrough */
case
0
:
level
=
NULL
;
...
...
@@ -729,9 +729,9 @@ static GstCaps *wg_format_to_caps_video_h264(const struct wg_format *format)
if
(
level
)
gst_caps_set_simple
(
caps
,
"level"
,
G_TYPE_STRING
,
level
,
NULL
);
if
(
format
->
u
.
video
_h264
.
codec_data_len
)
if
(
format
->
u
.
video
.
codec_data_len
)
{
if
(
!
(
buffer
=
gst_buffer_new_and_alloc
(
format
->
u
.
video
_h264
.
codec_data_len
)))
if
(
!
(
buffer
=
gst_buffer_new_and_alloc
(
format
->
u
.
video
.
codec_data_len
)))
{
gst_caps_unref
(
caps
);
return
NULL
;
...
...
@@ -739,7 +739,7 @@ static GstCaps *wg_format_to_caps_video_h264(const struct wg_format *format)
GST_BUFFER_PTS
(
buffer
)
=
0
;
GST_BUFFER_DTS
(
buffer
)
=
0
;
gst_buffer_fill
(
buffer
,
0
,
format
->
u
.
video
_h264
.
codec_data
,
format
->
u
.
video_h264
.
codec_data_len
);
gst_buffer_fill
(
buffer
,
0
,
format
->
u
.
video
.
codec_data
,
format
->
u
.
video
.
codec_data_len
);
gst_caps_set_simple
(
caps
,
"streamheader"
,
GST_TYPE_BUFFER
,
buffer
,
NULL
);
gst_buffer_unref
(
buffer
);
}
...
...
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