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
703a82a7
Commit
703a82a7
authored
Nov 20, 2023
by
Alfred Agrell
Committed by
Alexandre Julliard
Dec 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Add codec_data to WMVs.
parent
31788cdc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
+43
-3
quartz_parser.c
dlls/winegstreamer/quartz_parser.c
+11
-3
unixlib.h
dlls/winegstreamer/unixlib.h
+2
-0
wg_format.c
dlls/winegstreamer/wg_format.c
+30
-0
No files found.
dlls/winegstreamer/quartz_parser.c
View file @
703a82a7
...
...
@@ -621,7 +621,7 @@ static bool amt_from_wg_format_video_cinepak(AM_MEDIA_TYPE *mt, const struct wg_
static
bool
amt_from_wg_format_video_wmv
(
AM_MEDIA_TYPE
*
mt
,
const
struct
wg_format
*
format
)
{
VIDEOINFO
*
video_format
;
VIDEOINFO
HEADER
*
video_format
;
uint32_t
frame_time
;
const
GUID
*
subtype
;
...
...
@@ -647,7 +647,7 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form
return
false
;
}
if
(
!
(
video_format
=
CoTaskMemAlloc
(
sizeof
(
*
video_format
))))
if
(
!
(
video_format
=
CoTaskMemAlloc
(
sizeof
(
*
video_format
)
+
format
->
u
.
video_wmv
.
codec_data_len
)))
return
false
;
mt
->
majortype
=
MEDIATYPE_Video
;
...
...
@@ -656,7 +656,7 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form
mt
->
bTemporalCompression
=
TRUE
;
mt
->
lSampleSize
=
0
;
mt
->
formattype
=
FORMAT_VideoInfo
;
mt
->
cbFormat
=
sizeof
(
VIDEOINFOHEADER
)
;
mt
->
cbFormat
=
sizeof
(
*
video_format
)
+
format
->
u
.
video_wmv
.
codec_data_len
;
mt
->
pbFormat
=
(
BYTE
*
)
video_format
;
memset
(
video_format
,
0
,
sizeof
(
*
video_format
));
...
...
@@ -669,6 +669,7 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form
video_format
->
bmiHeader
.
biHeight
=
format
->
u
.
video_wmv
.
height
;
video_format
->
bmiHeader
.
biPlanes
=
1
;
video_format
->
bmiHeader
.
biCompression
=
mt
->
subtype
.
Data1
;
memcpy
(
video_format
+
1
,
format
->
u
.
video_wmv
.
codec_data
,
format
->
u
.
video_wmv
.
codec_data_len
);
return
true
;
}
...
...
@@ -997,6 +998,13 @@ static bool amt_to_wg_format_video_wmv(const AM_MEDIA_TYPE *mt, struct wg_format
else
format
->
u
.
video_wmv
.
format
=
WG_WMV_VIDEO_FORMAT_UNKNOWN
;
format
->
u
.
video_wmv
.
codec_data_len
=
mt
->
cbFormat
-
sizeof
(
VIDEOINFOHEADER
);
if
(
format
->
u
.
video_wmv
.
codec_data_len
>
sizeof
(
format
->
u
.
video_wmv
.
codec_data
))
{
ERR
(
"Too big codec_data value (%u).
\n
"
,
format
->
u
.
video_wmv
.
codec_data_len
);
format
->
u
.
video_wmv
.
codec_data_len
=
0
;
}
memcpy
(
format
->
u
.
video_wmv
.
codec_data
,
video_format
+
1
,
format
->
u
.
video_wmv
.
codec_data_len
);
return
true
;
}
...
...
dlls/winegstreamer/unixlib.h
View file @
703a82a7
...
...
@@ -157,6 +157,8 @@ struct wg_format
wg_wmv_video_format
format
;
int32_t
width
,
height
;
uint32_t
fps_n
,
fps_d
;
uint32_t
codec_data_len
;
unsigned
char
codec_data
[
64
];
}
video_wmv
;
struct
{
...
...
dlls/winegstreamer/wg_format.c
View file @
703a82a7
...
...
@@ -300,6 +300,9 @@ static void wg_format_from_caps_video_wmv(struct wg_format *format, const GstCap
gchar
format_buffer
[
5
]
=
{
'W'
,
'M'
,
'V'
,
'0'
,
0
};
enum
wg_wmv_video_format
wmv_format
;
const
gchar
*
wmv_format_str
=
NULL
;
const
GValue
*
codec_data_value
;
GstBuffer
*
codec_data
;
GstMapInfo
map
;
if
(
!
gst_structure_get_int
(
structure
,
"width"
,
&
width
))
{
...
...
@@ -344,6 +347,19 @@ static void wg_format_from_caps_video_wmv(struct wg_format *format, const GstCap
format
->
u
.
video_wmv
.
format
=
wmv_format
;
format
->
u
.
video_wmv
.
fps_n
=
fps_n
;
format
->
u
.
video_wmv
.
fps_d
=
fps_d
;
if
((
codec_data_value
=
gst_structure_get_value
(
structure
,
"codec_data"
))
&&
(
codec_data
=
gst_value_get_buffer
(
codec_data_value
)))
{
gst_buffer_map
(
codec_data
,
&
map
,
GST_MAP_READ
);
if
(
map
.
size
<=
sizeof
(
format
->
u
.
video_wmv
.
codec_data
))
{
format
->
u
.
video_wmv
.
codec_data_len
=
map
.
size
;
memcpy
(
format
->
u
.
video_wmv
.
codec_data
,
map
.
data
,
map
.
size
);
}
else
GST_WARNING
(
"Too big codec_data value (%u) in %"
GST_PTR_FORMAT
"."
,
(
UINT
)
map
.
size
,
caps
);
gst_buffer_unmap
(
codec_data
,
&
map
);
}
}
static
void
wg_format_from_caps_video_mpeg1
(
struct
wg_format
*
format
,
const
GstCaps
*
caps
)
...
...
@@ -733,6 +749,7 @@ static GstCaps *wg_format_to_caps_video_wmv(const struct wg_format *format)
{
unsigned
int
wmv_version
;
const
char
*
wmv_format
;
GstBuffer
*
buffer
;
GstCaps
*
caps
;
if
(
!
(
caps
=
gst_caps_new_empty_simple
(
"video/x-wmv"
)))
...
...
@@ -780,6 +797,19 @@ static GstCaps *wg_format_to_caps_video_wmv(const struct wg_format *format)
if
(
format
->
u
.
video_wmv
.
fps_d
||
format
->
u
.
video_wmv
.
fps_n
)
gst_caps_set_simple
(
caps
,
"framerate"
,
GST_TYPE_FRACTION
,
format
->
u
.
video_wmv
.
fps_n
,
format
->
u
.
video_wmv
.
fps_d
,
NULL
);
if
(
format
->
u
.
video_wmv
.
codec_data_len
)
{
if
(
!
(
buffer
=
gst_buffer_new_and_alloc
(
format
->
u
.
video_wmv
.
codec_data_len
)))
{
gst_caps_unref
(
caps
);
return
NULL
;
}
gst_buffer_fill
(
buffer
,
0
,
format
->
u
.
video_wmv
.
codec_data
,
format
->
u
.
video_wmv
.
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