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
3cef365f
Commit
3cef365f
authored
Mar 13, 2023
by
Ziqing Hui
Committed by
Alexandre Julliard
Apr 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement wg_format_from_caps_video_wmv.
parent
5ae89b0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
wg_format.c
dlls/winegstreamer/wg_format.c
+57
-0
No files found.
dlls/winegstreamer/wg_format.c
View file @
3cef365f
...
...
@@ -229,6 +229,59 @@ static void wg_format_from_caps_video_cinepak(struct wg_format *format, const Gs
format
->
u
.
video_cinepak
.
fps_d
=
fps_d
;
}
static
void
wg_format_from_caps_video_wmv
(
struct
wg_format
*
format
,
const
GstCaps
*
caps
)
{
const
GstStructure
*
structure
=
gst_caps_get_structure
(
caps
,
0
);
gint
width
,
height
,
fps_n
,
fps_d
,
wmv_version
=
0
;
gchar
format_buffer
[
5
]
=
{
'W'
,
'M'
,
'V'
,
'0'
,
0
};
enum
wg_wmv_video_format
wmv_format
;
const
gchar
*
wmv_format_str
=
NULL
;
if
(
!
gst_structure_get_int
(
structure
,
"width"
,
&
width
))
{
GST_WARNING
(
"Missing
\"
width
\"
value."
);
return
;
}
if
(
!
gst_structure_get_int
(
structure
,
"height"
,
&
height
))
{
GST_WARNING
(
"Missing
\"
height
\"
value."
);
return
;
}
if
(
!
(
wmv_format_str
=
gst_structure_get_string
(
structure
,
"format"
)))
{
if
(
!
gst_structure_get_int
(
structure
,
"wmvversion"
,
&
wmv_version
))
GST_WARNING
(
"Unable to get WMV format."
);
format_buffer
[
3
]
+=
wmv_version
;
wmv_format_str
=
format_buffer
;
}
if
(
!
strcmp
(
wmv_format_str
,
"WMV1"
))
wmv_format
=
WG_WMV_VIDEO_FORMAT_WMV1
;
else
if
(
!
strcmp
(
wmv_format_str
,
"WMV2"
))
wmv_format
=
WG_WMV_VIDEO_FORMAT_WMV2
;
else
if
(
!
strcmp
(
wmv_format_str
,
"WMV3"
))
wmv_format
=
WG_WMV_VIDEO_FORMAT_WMV3
;
else
if
(
!
strcmp
(
wmv_format_str
,
"WMVA"
))
wmv_format
=
WG_WMV_VIDEO_FORMAT_WMVA
;
else
if
(
!
strcmp
(
wmv_format_str
,
"WVC1"
))
wmv_format
=
WG_WMV_VIDEO_FORMAT_WVC1
;
else
wmv_format
=
WG_WMV_VIDEO_FORMAT_UNKNOWN
;
if
(
!
gst_structure_get_fraction
(
structure
,
"framerate"
,
&
fps_n
,
&
fps_d
))
{
fps_n
=
0
;
fps_d
=
1
;
}
format
->
major_type
=
WG_MAJOR_TYPE_VIDEO_WMV
;
format
->
u
.
video_wmv
.
width
=
width
;
format
->
u
.
video_wmv
.
height
=
height
;
format
->
u
.
video_wmv
.
format
=
wmv_format
;
format
->
u
.
video_wmv
.
fps_n
=
fps_n
;
format
->
u
.
video_wmv
.
fps_d
=
fps_d
;
}
void
wg_format_from_caps
(
struct
wg_format
*
format
,
const
GstCaps
*
caps
)
{
const
GstStructure
*
structure
=
gst_caps_get_structure
(
caps
,
0
);
...
...
@@ -258,6 +311,10 @@ void wg_format_from_caps(struct wg_format *format, const GstCaps *caps)
{
wg_format_from_caps_video_cinepak
(
format
,
caps
);
}
else
if
(
!
strcmp
(
name
,
"video/x-wmv"
))
{
wg_format_from_caps_video_wmv
(
format
,
caps
);
}
else
{
gchar
*
str
=
gst_caps_to_string
(
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