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
223d2792
Commit
223d2792
authored
Mar 15, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Introduce new stream_type_from_caps helper.
parent
6d37b673
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
14 deletions
+25
-14
unix_private.h
dlls/winegstreamer/unix_private.h
+1
-0
unixlib.c
dlls/winegstreamer/unixlib.c
+21
-0
wg_transform.c
dlls/winegstreamer/wg_transform.c
+3
-14
No files found.
dlls/winegstreamer/unix_private.h
View file @
223d2792
...
...
@@ -32,6 +32,7 @@ GST_DEBUG_CATEGORY_EXTERN(wine) DECLSPEC_HIDDEN;
extern
NTSTATUS
wg_init_gstreamer
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
GstStreamType
stream_type_from_caps
(
GstCaps
*
caps
)
DECLSPEC_HIDDEN
;
extern
GstElement
*
create_element
(
const
char
*
name
,
const
char
*
plugin_set
)
DECLSPEC_HIDDEN
;
extern
GstElement
*
find_element
(
GstElementFactoryListType
type
,
GstCaps
*
src_caps
,
GstCaps
*
sink_caps
)
DECLSPEC_HIDDEN
;
extern
bool
append_element
(
GstElement
*
container
,
GstElement
*
element
,
GstElement
**
first
,
GstElement
**
last
)
DECLSPEC_HIDDEN
;
...
...
dlls/winegstreamer/unixlib.c
View file @
223d2792
...
...
@@ -47,6 +47,27 @@
GST_DEBUG_CATEGORY
(
wine
);
GstStreamType
stream_type_from_caps
(
GstCaps
*
caps
)
{
const
gchar
*
media_type
;
if
(
!
caps
||
!
gst_caps_get_size
(
caps
))
return
GST_STREAM_TYPE_UNKNOWN
;
media_type
=
gst_structure_get_name
(
gst_caps_get_structure
(
caps
,
0
));
if
(
g_str_has_prefix
(
media_type
,
"video/"
)
||
g_str_has_prefix
(
media_type
,
"image/"
))
return
GST_STREAM_TYPE_VIDEO
;
if
(
g_str_has_prefix
(
media_type
,
"audio/"
))
return
GST_STREAM_TYPE_AUDIO
;
if
(
g_str_has_prefix
(
media_type
,
"text/"
)
||
g_str_has_prefix
(
media_type
,
"subpicture/"
)
||
g_str_has_prefix
(
media_type
,
"closedcaption/"
))
return
GST_STREAM_TYPE_TEXT
;
return
GST_STREAM_TYPE_UNKNOWN
;
}
GstElement
*
create_element
(
const
char
*
name
,
const
char
*
plugin_set
)
{
GstElement
*
element
;
...
...
dlls/winegstreamer/wg_transform.c
View file @
223d2792
...
...
@@ -60,17 +60,6 @@ struct wg_transform
GstCaps
*
output_caps
;
};
static
bool
is_caps_video
(
GstCaps
*
caps
)
{
const
gchar
*
media_type
;
if
(
!
caps
||
!
gst_caps_get_size
(
caps
))
return
false
;
media_type
=
gst_structure_get_name
(
gst_caps_get_structure
(
caps
,
0
));
return
g_str_has_prefix
(
media_type
,
"video/"
);
}
static
void
align_video_info_planes
(
gsize
plane_align
,
GstVideoInfo
*
info
,
GstVideoAlignment
*
align
)
{
gst_video_alignment_reset
(
align
);
...
...
@@ -127,7 +116,7 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery
GstCaps
*
caps
;
gst_query_parse_allocation
(
query
,
&
caps
,
&
needs_pool
);
if
(
!
is_caps_video
(
caps
)
||
!
needs_pool
)
if
(
stream_type_from_caps
(
caps
)
!=
GST_STREAM_TYPE_VIDEO
||
!
needs_pool
)
break
;
if
(
!
gst_video_info_from_caps
(
&
info
,
caps
)
...
...
@@ -671,7 +660,7 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi
if
((
ret
=
!
needs_copy
))
total_size
=
sample
->
size
=
info
.
size
;
else
if
(
is_caps_video
(
caps
)
)
else
if
(
stream_type_from_caps
(
caps
)
==
GST_STREAM_TYPE_VIDEO
)
ret
=
copy_video_buffer
(
buffer
,
caps
,
plane_align
,
sample
,
&
total_size
);
else
ret
=
copy_buffer
(
buffer
,
caps
,
sample
,
&
total_size
);
...
...
@@ -707,7 +696,7 @@ static NTSTATUS read_transform_output_data(GstBuffer *buffer, GstCaps *caps, gsi
if
(
needs_copy
)
{
if
(
is_caps_video
(
caps
)
)
if
(
stream_type_from_caps
(
caps
)
==
GST_STREAM_TYPE_VIDEO
)
GST_WARNING
(
"Copied %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
else
GST_INFO
(
"Copied %u bytes, sample %p, flags %#x"
,
sample
->
size
,
sample
,
sample
->
flags
);
...
...
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