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
320383c5
Commit
320383c5
authored
Aug 16, 2023
by
Ziqing Hui
Committed by
Alexandre Julliard
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Add codec data to h264 format.
parent
97555dff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
mfplat.c
dlls/winegstreamer/mfplat.c
+16
-1
unixlib.h
dlls/winegstreamer/unixlib.h
+2
-0
wg_format.c
dlls/winegstreamer/wg_format.c
+14
-0
No files found.
dlls/winegstreamer/mfplat.c
View file @
320383c5
...
...
@@ -804,8 +804,9 @@ static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID
static
void
mf_media_type_to_wg_format_video_h264
(
IMFMediaType
*
type
,
struct
wg_format
*
format
)
{
UINT32
profile
,
level
,
codec_data_len
;
UINT64
frame_rate
,
frame_size
;
UINT32
profile
,
level
;
BYTE
*
codec_data
;
memset
(
format
,
0
,
sizeof
(
*
format
));
format
->
major_type
=
WG_MAJOR_TYPE_VIDEO_H264
;
...
...
@@ -832,6 +833,20 @@ static void mf_media_type_to_wg_format_video_h264(IMFMediaType *type, struct wg_
if
(
SUCCEEDED
(
IMFMediaType_GetUINT32
(
type
,
&
MF_MT_MPEG2_LEVEL
,
&
level
)))
format
->
u
.
video_h264
.
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
))
{
format
->
u
.
video_h264
.
codec_data_len
=
codec_data_len
;
memcpy
(
format
->
u
.
video_h264
.
codec_data
,
codec_data
,
codec_data_len
);
}
else
{
WARN
(
"Codec data buffer too small, codec data size %u.
\n
"
,
codec_data_len
);
}
CoTaskMemFree
(
codec_data
);
}
}
static
void
mf_media_type_to_wg_format_video_indeo
(
IMFMediaType
*
type
,
uint32_t
version
,
struct
wg_format
*
format
)
...
...
dlls/winegstreamer/unixlib.h
View file @
320383c5
...
...
@@ -148,6 +148,8 @@ struct wg_format
uint32_t
fps_n
,
fps_d
;
uint32_t
profile
;
uint32_t
level
;
uint32_t
codec_data_len
;
unsigned
char
codec_data
[
64
];
}
video_h264
;
struct
{
...
...
dlls/winegstreamer/wg_format.c
View file @
320383c5
...
...
@@ -553,6 +553,7 @@ static GstCaps *wg_format_to_caps_audio_wma(const struct wg_format *format)
static
GstCaps
*
wg_format_to_caps_video_h264
(
const
struct
wg_format
*
format
)
{
const
char
*
profile
,
*
level
;
GstBuffer
*
buffer
;
GstCaps
*
caps
;
if
(
!
(
caps
=
gst_caps_new_empty_simple
(
"video/x-h264"
)))
...
...
@@ -609,6 +610,19 @@ 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
(
!
(
buffer
=
gst_buffer_new_and_alloc
(
format
->
u
.
video_h264
.
codec_data_len
)))
{
gst_caps_unref
(
caps
);
return
NULL
;
}
gst_buffer_fill
(
buffer
,
0
,
format
->
u
.
video_h264
.
codec_data
,
format
->
u
.
video_h264
.
codec_data_len
);
gst_caps_set_simple
(
caps
,
"codec_data"
,
GST_TYPE_BUFFER
,
buffer
,
NULL
);
gst_buffer_unref
(
buffer
);
}
return
caps
;
}
...
...
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