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
8547ee35
Commit
8547ee35
authored
Feb 15, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Move QoS notification to the Unix library.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7a5224be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
18 deletions
+24
-18
gst_private.h
dlls/winegstreamer/gst_private.h
+2
-0
gstdemux.c
dlls/winegstreamer/gstdemux.c
+10
-18
wg_parser.c
dlls/winegstreamer/wg_parser.c
+12
-0
No files found.
dlls/winegstreamer/gst_private.h
View file @
8547ee35
...
...
@@ -226,6 +226,8 @@ struct unix_funcs
void
(
CDECL
*
wg_parser_stream_disable
)(
struct
wg_parser_stream
*
stream
);
bool
(
CDECL
*
wg_parser_stream_get_event
)(
struct
wg_parser_stream
*
stream
,
struct
wg_parser_event
*
event
);
void
(
CDECL
*
wg_parser_stream_notify_qos
)(
struct
wg_parser_stream
*
stream
,
bool
underflow
,
double
proportion
,
int64_t
diff
,
uint64_t
timestamp
);
};
extern
const
struct
unix_funcs
*
unix_funcs
;
...
...
dlls/winegstreamer/gstdemux.c
View file @
8547ee35
...
...
@@ -1350,11 +1350,8 @@ static ULONG WINAPI GST_QualityControl_Release(IQualityControl *iface)
static
HRESULT
WINAPI
GST_QualityControl_Notify
(
IQualityControl
*
iface
,
IBaseFilter
*
sender
,
Quality
q
)
{
struct
parser_source
*
pin
=
impl_from_IQualityControl
(
iface
);
struct
wg_parser_stream
*
stream
=
pin
->
wg_stream
;
GstQOSType
type
=
GST_QOS_TYPE_OVERFLOW
;
GstClockTime
timestamp
;
GstClockTimeDiff
diff
;
GstEvent
*
event
;
uint64_t
timestamp
;
int64_t
diff
;
TRACE
(
"pin %p, sender %p, type %s, proportion %u, late %s, timestamp %s.
\n
"
,
pin
,
sender
,
q
.
Type
==
Famine
?
"Famine"
:
"Flood"
,
q
.
Proportion
,
...
...
@@ -1362,20 +1359,14 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil
mark_wine_thread
();
/* GST_QOS_TYPE_OVERFLOW is also used for buffers that arrive on time, but
* DirectShow filters might use Famine, so check that there actually is an
* underrun. */
if
(
q
.
Type
==
Famine
&&
q
.
Proportion
<
1000
)
type
=
GST_QOS_TYPE_UNDERFLOW
;
/* DirectShow filters sometimes pass negative timestamps (Audiosurf uses the
* current time instead of the time of the last buffer). GstClockTime is
* unsigned, so clamp it to 0. */
timestamp
=
max
(
q
.
TimeStamp
*
100
,
0
);
timestamp
=
max
(
q
.
TimeStamp
,
0
);
/* The documentation specifies that timestamp + diff must be nonnegative. */
diff
=
q
.
Late
*
100
;
if
(
diff
<
0
&&
timestamp
<
(
GstClockTime
)
-
diff
)
diff
=
q
.
Late
;
if
(
diff
<
0
&&
timestamp
<
(
uint64_t
)
-
diff
)
diff
=
-
timestamp
;
/* DirectShow "Proportion" describes what percentage of buffers the upstream
...
...
@@ -1395,10 +1386,11 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil
return
S_OK
;
}
if
(
!
(
event
=
gst_event_new_qos
(
type
,
1000
.
0
/
q
.
Proportion
,
diff
,
timestamp
)))
ERR
(
"Failed to create QOS event.
\n
"
);
gst_pad_push_event
(
stream
->
my_sink
,
event
);
/* GST_QOS_TYPE_OVERFLOW is also used for buffers that arrive on time, but
* DirectShow filters might use Famine, so check that there actually is an
* underrun. */
unix_funcs
->
wg_parser_stream_notify_qos
(
pin
->
wg_stream
,
q
.
Type
==
Famine
&&
q
.
Proportion
<
1000
,
1000
.
0
/
q
.
Proportion
,
diff
,
timestamp
);
return
S_OK
;
}
...
...
dlls/winegstreamer/wg_parser.c
View file @
8547ee35
...
...
@@ -391,6 +391,17 @@ static bool CDECL wg_parser_stream_get_event(struct wg_parser_stream *stream, st
return
true
;
}
static
void
CDECL
wg_parser_stream_notify_qos
(
struct
wg_parser_stream
*
stream
,
bool
underflow
,
double
proportion
,
int64_t
diff
,
uint64_t
timestamp
)
{
GstEvent
*
event
;
if
(
!
(
event
=
gst_event_new_qos
(
underflow
?
GST_QOS_TYPE_UNDERFLOW
:
GST_QOS_TYPE_OVERFLOW
,
1000
.
0
/
proportion
,
diff
*
100
,
timestamp
*
100
)))
ERR
(
"Failed to create QOS event.
\n
"
);
gst_pad_push_event
(
stream
->
my_sink
,
event
);
}
static
GstAutoplugSelectResult
autoplug_blacklist
(
GstElement
*
bin
,
GstPad
*
pad
,
GstCaps
*
caps
,
GstElementFactory
*
fact
,
gpointer
user
)
{
const
char
*
name
=
gst_element_factory_get_longname
(
fact
);
...
...
@@ -1553,6 +1564,7 @@ static const struct unix_funcs funcs =
wg_parser_stream_disable
,
wg_parser_stream_get_event
,
wg_parser_stream_notify_qos
,
};
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
...
...
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