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
4d2c94e1
Commit
4d2c94e1
authored
Jul 10, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Factor out create_element().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bcc19e88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
47 deletions
+21
-47
wg_parser.c
dlls/winegstreamer/wg_parser.c
+21
-47
No files found.
dlls/winegstreamer/wg_parser.c
View file @
4d2c94e1
...
...
@@ -992,6 +992,16 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
}
}
static
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
;
...
...
@@ -1046,39 +1056,23 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
/* DirectShow can express interlaced video, but downstream filters can't
* necessarily consume it. In particular, the video renderer can't. */
if
(
!
(
deinterlace
=
gst_element_factory_make
(
"deinterlace"
,
NULL
)))
{
fprintf
(
stderr
,
"winegstreamer: failed to create deinterlace, are %u-bit GStreamer
\"
good
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
deinterlace
=
create_element
(
"deinterlace"
,
"good"
)))
goto
out
;
}
/* decodebin considers many YUV formats to be "raw", but some quartz
* filters can't handle those. Also, videoflip can't handle all "raw"
* formats either. Add a videoconvert to swap color spaces. */
if
(
!
(
vconv
=
gst_element_factory_make
(
"videoconvert"
,
NULL
)))
{
fprintf
(
stderr
,
"winegstreamer: failed to create videoconvert, are %u-bit GStreamer
\"
base
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
vconv
=
create_element
(
"videoconvert"
,
"base"
)))
goto
out
;
}
/* GStreamer outputs RGB video top-down, but DirectShow expects bottom-up. */
if
(
!
(
flip
=
gst_element_factory_make
(
"videoflip"
,
NULL
)))
{
fprintf
(
stderr
,
"winegstreamer: failed to create videoflip, are %u-bit GStreamer
\"
good
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
flip
=
create_element
(
"videoflip"
,
"good"
)))
goto
out
;
}
/* videoflip does not support 15 and 16-bit RGB so add a second videoconvert
* to do the final conversion. */
if
(
!
(
vconv2
=
gst_element_factory_make
(
"videoconvert"
,
NULL
)))
{
fprintf
(
stderr
,
"winegstreamer: failed to create videoconvert, are %u-bit GStreamer
\"
base
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
vconv2
=
create_element
(
"videoconvert"
,
"base"
)))
goto
out
;
}
/* The bin takes ownership of these elements. */
gst_bin_add
(
GST_BIN
(
parser
->
container
),
deinterlace
);
...
...
@@ -1106,12 +1100,8 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
* surround-sound configurations. Native dsound can't always handle
* 64-bit formats either. Add an audioconvert to allow changing bit
* depth and channel count. */
if
(
!
(
convert
=
gst_element_factory_make
(
"audioconvert"
,
NULL
)))
{
fprintf
(
stderr
,
"winegstreamer: failed to create audioconvert, are %u-bit GStreamer
\"
base
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
convert
=
create_element
(
"audioconvert"
,
"base"
)))
goto
out
;
}
gst_bin_add
(
GST_BIN
(
parser
->
container
),
convert
);
gst_element_sync_state_with_parent
(
convert
);
...
...
@@ -1636,15 +1626,11 @@ static void CDECL wg_parser_disconnect(struct wg_parser *parser)
static
BOOL
decodebin_parser_init_gst
(
struct
wg_parser
*
parser
)
{
GstElement
*
element
=
gst_element_factory_make
(
"decodebin"
,
NULL
)
;
GstElement
*
element
;
int
ret
;
if
(
!
element
)
{
ERR
(
"Failed to create decodebin; are %u-bit GStreamer
\"
base
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
element
=
create_element
(
"decodebin"
,
"base"
)))
return
FALSE
;
}
gst_bin_add
(
GST_BIN
(
parser
->
container
),
element
);
parser
->
decodebin
=
element
;
...
...
@@ -1689,15 +1675,11 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
static
BOOL
avi_parser_init_gst
(
struct
wg_parser
*
parser
)
{
GstElement
*
element
=
gst_element_factory_make
(
"avidemux"
,
NULL
)
;
GstElement
*
element
;
int
ret
;
if
(
!
element
)
{
ERR
(
"Failed to create avidemux; are %u-bit GStreamer
\"
good
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
element
=
create_element
(
"avidemux"
,
"good"
)))
return
FALSE
;
}
gst_bin_add
(
GST_BIN
(
parser
->
container
),
element
);
...
...
@@ -1744,12 +1726,8 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser)
GstElement
*
element
;
int
ret
;
if
(
!
(
element
=
gst_element_factory_make
(
"mpegaudioparse"
,
NULL
)))
{
ERR
(
"Failed to create mpegaudioparse; are %u-bit GStreamer
\"
good
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
element
=
create_element
(
"mpegaudioparse"
,
"good"
)))
return
FALSE
;
}
gst_bin_add
(
GST_BIN
(
parser
->
container
),
element
);
...
...
@@ -1797,12 +1775,8 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser)
GstElement
*
element
;
int
ret
;
if
(
!
(
element
=
gst_element_factory_make
(
"wavparse"
,
NULL
)))
{
ERR
(
"Failed to create wavparse; are %u-bit GStreamer
\"
good
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
if
(
!
(
element
=
create_element
(
"wavparse"
,
"good"
)))
return
FALSE
;
}
gst_bin_add
(
GST_BIN
(
parser
->
container
),
element
);
...
...
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