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
11b30ffc
Commit
11b30ffc
authored
Jan 27, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Append an audioconvert element to raw audio streams.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aa701751
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
77 deletions
+78
-77
gstdemux.c
dlls/winegstreamer/gstdemux.c
+78
-77
No files found.
dlls/winegstreamer/gstdemux.c
View file @
11b30ffc
...
@@ -85,10 +85,7 @@ struct gstdemux_source
...
@@ -85,10 +85,7 @@ struct gstdemux_source
struct
strmbase_source
pin
;
struct
strmbase_source
pin
;
IQualityControl
IQualityControl_iface
;
IQualityControl
IQualityControl_iface
;
GstElement
*
flipfilter
;
GstPad
*
their_src
,
*
post_sink
,
*
post_src
,
*
my_sink
;
GstPad
*
flip_sink
,
*
flip_src
;
GstPad
*
their_src
;
GstPad
*
my_sink
;
AM_MEDIA_TYPE
mt
;
AM_MEDIA_TYPE
mt
;
HANDLE
caps_event
;
HANDLE
caps_event
;
GstSegment
*
segment
;
GstSegment
*
segment
;
...
@@ -1004,11 +1001,10 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user)
...
@@ -1004,11 +1001,10 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user)
if
(
pin
->
their_src
==
pad
)
if
(
pin
->
their_src
==
pad
)
{
{
if
(
pin
->
flipfilter
)
if
(
pin
->
post_sink
)
gst_pad_unlink
(
pin
->
their_src
,
pin
->
flip
_sink
);
gst_pad_unlink
(
pin
->
their_src
,
pin
->
post
_sink
);
else
else
gst_pad_unlink
(
pin
->
their_src
,
pin
->
my_sink
);
gst_pad_unlink
(
pin
->
their_src
,
pin
->
my_sink
);
gst_object_unref
(
pin
->
their_src
);
gst_object_unref
(
pin
->
their_src
);
pin
->
their_src
=
NULL
;
pin
->
their_src
=
NULL
;
return
;
return
;
...
@@ -1052,85 +1048,91 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
...
@@ -1052,85 +1048,91 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
if
(
!
strcmp
(
typename
,
"video/x-raw"
))
if
(
!
strcmp
(
typename
,
"video/x-raw"
))
{
{
GstElement
*
vconv
;
GstElement
*
vconv
,
*
flip
;
TRACE
(
"setting up videoflip filter for pin %p, my_sink: %p, their_src: %p
\n
"
,
pin
,
pin
->
my_sink
,
pad
);
/* gstreamer outputs video top-down, but dshow expects bottom-up, so
/* decodebin considers many YUV formats to be "raw", but some quartz
* make new transform filter to invert video */
* filters can't handle those. Also, videoflip can't handle all "raw"
vconv
=
gst_element_factory_make
(
"videoconvert"
,
NULL
);
* formats either. Add a videoconvert to swap color spaces. */
if
(
!
vconv
){
if
(
!
(
vconv
=
gst_element_factory_make
(
"videoconvert"
,
NULL
)))
ERR
(
"Missing videoconvert filter?
\n
"
);
{
ret
=
-
1
;
ERR
(
"Failed to create videoconvert, are %u-bit GStreamer
\"
base
\"
plugins installed?
\n
"
,
goto
exit
;
8
*
(
int
)
sizeof
(
void
*
));
return
;
}
}
pin
->
flipfilter
=
gst_element_factory_make
(
"videoflip"
,
NULL
);
/* GStreamer outputs video top-down, but DirectShow expects bottom-up. */
if
(
!
pin
->
flipfilter
){
if
(
!
(
flip
=
gst_element_factory_make
(
"videoflip"
,
NULL
)))
ERR
(
"Missing videoflip filter?
\n
"
);
{
ret
=
-
1
;
ERR
(
"Failed to create videoflip, are %u-bit GStreamer
\"
good
\"
plugins installed?
\n
"
,
goto
exit
;
8
*
(
int
)
sizeof
(
void
*
));
return
;
}
}
gst_util_set_object_arg
(
G_OBJECT
(
pin
->
flipfilter
),
"method"
,
"vertical-flip"
);
gst_util_set_object_arg
(
G_OBJECT
(
flip
),
"method"
,
"vertical-flip"
);
gst_bin_add
(
GST_BIN
(
This
->
container
),
vconv
);
/* bin takes ownership */
gst_bin_add
(
GST_BIN
(
This
->
container
),
vconv
);
/* bin takes ownership */
gst_element_sync_state_with_parent
(
vconv
);
gst_element_sync_state_with_parent
(
vconv
);
gst_bin_add
(
GST_BIN
(
This
->
container
),
pin
->
flipfilter
);
/* bin takes ownership */
gst_bin_add
(
GST_BIN
(
This
->
container
),
flip
);
/* bin takes ownership */
gst_element_sync_state_with_parent
(
pin
->
flipfilter
);
gst_element_sync_state_with_parent
(
flip
);
gst_element_link
(
vconv
,
pin
->
flipfilter
);
gst_element_link
(
vconv
,
flip
);
pin
->
flip_sink
=
gst_element_get_static_pad
(
vconv
,
"sink"
);
pin
->
post_sink
=
gst_element_get_static_pad
(
vconv
,
"sink"
);
if
(
!
pin
->
flip_sink
){
pin
->
post_src
=
gst_element_get_static_pad
(
flip
,
"src"
);
WARN
(
"Couldn't find sink on flip filter
\n
"
);
}
pin
->
flipfilter
=
NULL
;
else
if
(
!
strcmp
(
typename
,
"audio/x-raw"
))
ret
=
-
1
;
{
goto
exit
;
GstElement
*
convert
;
}
ret
=
gst_pad_link
(
pad
,
pin
->
flip_sink
);
/* Currently our dsound can't handle 64-bit formats or all
if
(
ret
<
0
){
* surround-sound configurations. Native dsound can't always handle
WARN
(
"gst_pad_link failed: %d
\n
"
,
ret
);
* 64-bit formats either. Add an audioconvert to allow changing bit
gst_object_unref
(
pin
->
flip_sink
);
* depth and channel count. */
pin
->
flip_sink
=
NULL
;
if
(
!
(
convert
=
gst_element_factory_make
(
"audioconvert"
,
NULL
)))
pin
->
flipfilter
=
NULL
;
{
goto
exit
;
ERR
(
"Failed to create audioconvert, are %u-bit GStreamer
\"
base
\"
plugins installed?
\n
"
,
8
*
(
int
)
sizeof
(
void
*
));
return
;
}
}
pin
->
flip_src
=
gst_element_get_static_pad
(
pin
->
flipfilter
,
"src"
);
gst_bin_add
(
GST_BIN
(
This
->
container
),
convert
);
if
(
!
pin
->
flip_src
){
gst_element_sync_state_with_parent
(
convert
);
WARN
(
"Couldn't find src on flip filter
\n
"
);
gst_object_unref
(
pin
->
flip_sink
);
pin
->
post_sink
=
gst_element_get_static_pad
(
convert
,
"sink"
);
pin
->
flip_sink
=
NULL
;
pin
->
post_src
=
gst_element_get_static_pad
(
convert
,
"src"
);
pin
->
flipfilter
=
NULL
;
}
ret
=
-
1
;
goto
exit
;
if
(
pin
->
post_sink
)
{
if
((
ret
=
gst_pad_link
(
pad
,
pin
->
post_sink
))
<
0
)
{
ERR
(
"Failed to link decodebin source pad to post-processing elements, error %s.
\n
"
,
gst_pad_link_get_name
(
ret
));
gst_object_unref
(
pin
->
post_sink
);
pin
->
post_sink
=
NULL
;
return
;
}
}
ret
=
gst_pad_link
(
pin
->
flip_src
,
pin
->
my_sink
);
if
((
ret
=
gst_pad_link
(
pin
->
post_src
,
pin
->
my_sink
))
<
0
)
if
(
ret
<
0
)
{
{
WARN
(
"gst_pad_link failed: %d
\n
"
,
ret
);
ERR
(
"Failed to link post-processing elements to our sink pad, error %s.
\n
"
,
gst_object_unref
(
pin
->
flip_src
);
gst_pad_link_get_name
(
ret
)
);
pin
->
flip_src
=
NULL
;
gst_object_unref
(
pin
->
post_src
)
;
gst_object_unref
(
pin
->
flip_sink
)
;
pin
->
post_src
=
NULL
;
pin
->
flip_sink
=
NULL
;
gst_object_unref
(
pin
->
post_sink
)
;
pin
->
flipfilter
=
NULL
;
pin
->
post_sink
=
NULL
;
goto
exit
;
return
;
}
}
}
else
}
ret
=
gst_pad_link
(
pad
,
pin
->
my_sink
);
else
if
((
ret
=
gst_pad_link
(
pad
,
pin
->
my_sink
))
<
0
)
{
ERR
(
"Failed to link decodebin source pad to our sink pad, error %s.
\n
"
,
gst_pad_link_get_name
(
ret
));
return
;
}
gst_pad_set_active
(
pin
->
my_sink
,
1
);
gst_pad_set_active
(
pin
->
my_sink
,
1
);
gst_object_ref
(
pin
->
their_src
=
pad
);
exit:
TRACE
(
"Linking: %i
\n
"
,
ret
);
if
(
ret
>=
0
)
{
pin
->
their_src
=
pad
;
gst_object_ref
(
pin
->
their_src
);
}
}
}
static
void
existing_new_pad
(
GstElement
*
bin
,
GstPad
*
pad
,
gpointer
user
)
static
void
existing_new_pad
(
GstElement
*
bin
,
GstPad
*
pad
,
gpointer
user
)
...
@@ -1156,8 +1158,8 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user)
...
@@ -1156,8 +1158,8 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user)
if
(
!
pin
->
their_src
)
{
if
(
!
pin
->
their_src
)
{
gst_segment_init
(
pin
->
segment
,
GST_FORMAT_TIME
);
gst_segment_init
(
pin
->
segment
,
GST_FORMAT_TIME
);
if
(
pin
->
flipfilter
)
if
(
pin
->
post_sink
)
ret
=
gst_pad_link
(
pad
,
pin
->
flip
_sink
);
ret
=
gst_pad_link
(
pad
,
pin
->
post
_sink
);
else
else
ret
=
gst_pad_link
(
pad
,
pin
->
my_sink
);
ret
=
gst_pad_link
(
pad
,
pin
->
my_sink
);
...
@@ -2136,14 +2138,13 @@ static void free_source_pin(struct gstdemux_source *pin)
...
@@ -2136,14 +2138,13 @@ static void free_source_pin(struct gstdemux_source *pin)
if
(
pin
->
their_src
)
if
(
pin
->
their_src
)
{
{
if
(
pin
->
flipfilter
)
if
(
pin
->
post_sink
)
{
{
gst_pad_unlink
(
pin
->
their_src
,
pin
->
flip_sink
);
gst_pad_unlink
(
pin
->
their_src
,
pin
->
post_sink
);
gst_pad_unlink
(
pin
->
flip_src
,
pin
->
my_sink
);
gst_pad_unlink
(
pin
->
post_src
,
pin
->
my_sink
);
gst_object_unref
(
pin
->
flip_src
);
gst_object_unref
(
pin
->
post_src
);
gst_object_unref
(
pin
->
flip_sink
);
gst_object_unref
(
pin
->
post_sink
);
pin
->
flipfilter
=
NULL
;
pin
->
post_src
=
pin
->
post_sink
=
NULL
;
pin
->
flip_src
=
pin
->
flip_sink
=
NULL
;
}
}
else
else
gst_pad_unlink
(
pin
->
their_src
,
pin
->
my_sink
);
gst_pad_unlink
(
pin
->
their_src
,
pin
->
my_sink
);
...
...
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