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
c23f6650
Commit
c23f6650
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: Move some wg_parser / wg_transform helpers to unixlib.c.
parent
2df0b960
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
57 deletions
+56
-57
unix_private.h
dlls/winegstreamer/unix_private.h
+1
-2
unixlib.c
dlls/winegstreamer/unixlib.c
+54
-0
wg_parser.c
dlls/winegstreamer/wg_parser.c
+0
-10
wg_transform.c
dlls/winegstreamer/wg_transform.c
+1
-45
No files found.
dlls/winegstreamer/unix_private.h
View file @
c23f6650
...
...
@@ -32,9 +32,8 @@ GST_DEBUG_CATEGORY_EXTERN(wine) DECLSPEC_HIDDEN;
extern
NTSTATUS
wg_init_gstreamer
(
void
*
args
)
DECLSPEC_HIDDEN
;
/* wg_parser.c */
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
;
/* wg_format.c */
...
...
dlls/winegstreamer/unixlib.c
View file @
c23f6650
...
...
@@ -47,6 +47,60 @@
GST_DEBUG_CATEGORY
(
wine
);
GstElement
*
create_element
(
const
char
*
name
,
const
char
*
plugin_set
)
{
GstElement
*
element
;
if
(
!
(
element
=
gst_element_factory_make
(
name
,
NULL
)))
fprintf
(
stderr
,
"winegstreamer: failed to create %s, are %u-bit GStreamer
\"
%s
\"
plugins installed?
\n
"
,
name
,
8
*
(
unsigned
int
)
sizeof
(
void
*
),
plugin_set
);
return
element
;
}
GstElement
*
find_element
(
GstElementFactoryListType
type
,
GstCaps
*
src_caps
,
GstCaps
*
sink_caps
)
{
GstElement
*
element
=
NULL
;
GList
*
tmp
,
*
transforms
;
const
gchar
*
name
;
if
(
!
(
transforms
=
gst_element_factory_list_get_elements
(
type
,
GST_RANK_MARGINAL
)))
goto
done
;
tmp
=
gst_element_factory_list_filter
(
transforms
,
src_caps
,
GST_PAD_SINK
,
FALSE
);
gst_plugin_feature_list_free
(
transforms
);
if
(
!
(
transforms
=
tmp
))
goto
done
;
tmp
=
gst_element_factory_list_filter
(
transforms
,
sink_caps
,
GST_PAD_SRC
,
FALSE
);
gst_plugin_feature_list_free
(
transforms
);
if
(
!
(
transforms
=
tmp
))
goto
done
;
transforms
=
g_list_sort
(
transforms
,
gst_plugin_feature_rank_compare_func
);
for
(
tmp
=
transforms
;
tmp
!=
NULL
&&
element
==
NULL
;
tmp
=
tmp
->
next
)
{
name
=
gst_plugin_feature_get_name
(
GST_PLUGIN_FEATURE
(
tmp
->
data
));
if
(
!
(
element
=
gst_element_factory_create
(
GST_ELEMENT_FACTORY
(
tmp
->
data
),
NULL
)))
GST_WARNING
(
"Failed to create %s element."
,
name
);
}
gst_plugin_feature_list_free
(
transforms
);
done:
if
(
element
)
{
GST_DEBUG
(
"Created %s element %p."
,
name
,
element
);
}
else
{
gchar
*
src_str
=
gst_caps_to_string
(
src_caps
),
*
sink_str
=
gst_caps_to_string
(
sink_caps
);
GST_WARNING
(
"Failed to create element matching caps %s / %s."
,
src_str
,
sink_str
);
g_free
(
sink_str
);
g_free
(
src_str
);
}
return
element
;
}
NTSTATUS
wg_init_gstreamer
(
void
*
arg
)
{
char
arg0
[]
=
"wine"
;
...
...
dlls/winegstreamer/wg_parser.c
View file @
c23f6650
...
...
@@ -727,16 +727,6 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
}
}
GstElement
*
create_element
(
const
char
*
name
,
const
char
*
plugin_set
)
{
GstElement
*
element
;
if
(
!
(
element
=
gst_element_factory_make
(
name
,
NULL
)))
fprintf
(
stderr
,
"winegstreamer: failed to create %s, are %u-bit GStreamer
\"
%s
\"
plugins installed?
\n
"
,
name
,
8
*
(
unsigned
int
)
sizeof
(
void
*
),
plugin_set
);
return
element
;
}
static
struct
wg_parser_stream
*
create_stream
(
struct
wg_parser
*
parser
)
{
struct
wg_parser_stream
*
stream
,
**
new_array
;
...
...
dlls/winegstreamer/wg_transform.c
View file @
c23f6650
...
...
@@ -267,50 +267,6 @@ NTSTATUS wg_transform_destroy(void *args)
return
STATUS_SUCCESS
;
}
static
GstElement
*
transform_find_element
(
GstElementFactoryListType
type
,
GstCaps
*
src_caps
,
GstCaps
*
sink_caps
)
{
GstElement
*
element
=
NULL
;
GList
*
tmp
,
*
transforms
;
const
gchar
*
name
;
if
(
!
(
transforms
=
gst_element_factory_list_get_elements
(
type
,
GST_RANK_MARGINAL
)))
goto
done
;
tmp
=
gst_element_factory_list_filter
(
transforms
,
src_caps
,
GST_PAD_SINK
,
FALSE
);
gst_plugin_feature_list_free
(
transforms
);
if
(
!
(
transforms
=
tmp
))
goto
done
;
tmp
=
gst_element_factory_list_filter
(
transforms
,
sink_caps
,
GST_PAD_SRC
,
FALSE
);
gst_plugin_feature_list_free
(
transforms
);
if
(
!
(
transforms
=
tmp
))
goto
done
;
transforms
=
g_list_sort
(
transforms
,
gst_plugin_feature_rank_compare_func
);
for
(
tmp
=
transforms
;
tmp
!=
NULL
&&
element
==
NULL
;
tmp
=
tmp
->
next
)
{
name
=
gst_plugin_feature_get_name
(
GST_PLUGIN_FEATURE
(
tmp
->
data
));
if
(
!
(
element
=
gst_element_factory_create
(
GST_ELEMENT_FACTORY
(
tmp
->
data
),
NULL
)))
GST_WARNING
(
"Failed to create %s element."
,
name
);
}
gst_plugin_feature_list_free
(
transforms
);
done:
if
(
element
)
{
GST_DEBUG
(
"Created %s element %p."
,
name
,
element
);
}
else
{
gchar
*
src_str
=
gst_caps_to_string
(
src_caps
),
*
sink_str
=
gst_caps_to_string
(
sink_caps
);
GST_WARNING
(
"Failed to create transform matching caps %s / %s."
,
src_str
,
sink_str
);
g_free
(
sink_str
);
g_free
(
src_str
);
}
return
element
;
}
static
bool
transform_append_element
(
struct
wg_transform
*
transform
,
GstElement
*
element
,
GstElement
**
first
,
GstElement
**
last
)
{
...
...
@@ -423,7 +379,7 @@ NTSTATUS wg_transform_create(void *args)
case
WG_MAJOR_TYPE_VIDEO_CINEPAK
:
case
WG_MAJOR_TYPE_VIDEO_INDEO
:
case
WG_MAJOR_TYPE_VIDEO_WMV
:
if
(
!
(
element
=
transform_
find_element
(
GST_ELEMENT_FACTORY_TYPE_DECODER
,
src_caps
,
raw_caps
))
if
(
!
(
element
=
find_element
(
GST_ELEMENT_FACTORY_TYPE_DECODER
,
src_caps
,
raw_caps
))
||
!
transform_append_element
(
transform
,
element
,
&
first
,
&
last
))
{
gst_caps_unref
(
raw_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