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
b6a7a385
Commit
b6a7a385
authored
Aug 17, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite/writer: Update some stats on MEStreamSinkRequestSample.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
080fe842
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
writer.c
dlls/mfreadwrite/writer.c
+48
-2
No files found.
dlls/mfreadwrite/writer.c
View file @
b6a7a385
...
@@ -60,6 +60,7 @@ struct sink_writer
...
@@ -60,6 +60,7 @@ struct sink_writer
IMFPresentationClock
*
clock
;
IMFPresentationClock
*
clock
;
IMFMediaSink
*
sink
;
IMFMediaSink
*
sink
;
enum
writer_state
state
;
enum
writer_state
state
;
HRESULT
status
;
MF_SINK_WRITER_STATISTICS
stats
;
MF_SINK_WRITER_STATISTICS
stats
;
CRITICAL_SECTION
cs
;
CRITICAL_SECTION
cs
;
...
@@ -419,7 +420,9 @@ static HRESULT WINAPI sink_writer_GetStatistics(IMFSinkWriter *iface, DWORD inde
...
@@ -419,7 +420,9 @@ static HRESULT WINAPI sink_writer_GetStatistics(IMFSinkWriter *iface, DWORD inde
EnterCriticalSection
(
&
writer
->
cs
);
EnterCriticalSection
(
&
writer
->
cs
);
if
(
index
==
MF_SINK_WRITER_ALL_STREAMS
)
if
(
FAILED
(
writer
->
status
))
hr
=
writer
->
status
;
else
if
(
index
==
MF_SINK_WRITER_ALL_STREAMS
)
*
stats
=
writer
->
stats
;
*
stats
=
writer
->
stats
;
else
if
((
stream
=
sink_writer_get_stream
(
writer
,
index
)))
else
if
((
stream
=
sink_writer_get_stream
(
writer
,
index
)))
*
stats
=
stream
->
stats
;
*
stats
=
stream
->
stats
;
...
@@ -483,12 +486,28 @@ static HRESULT WINAPI sink_writer_callback_GetParameters(IMFAsyncCallback *iface
...
@@ -483,12 +486,28 @@ static HRESULT WINAPI sink_writer_callback_GetParameters(IMFAsyncCallback *iface
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
struct
stream
*
sink_writer_get_stream_for_stream_sink
(
struct
sink_writer
*
writer
,
IMFStreamSink
*
stream_sink
)
{
size_t
i
;
for
(
i
=
0
;
i
<
writer
->
streams
.
count
;
++
i
)
{
if
(
writer
->
streams
.
items
[
i
].
stream_sink
==
stream_sink
)
return
&
writer
->
streams
.
items
[
i
];
}
return
NULL
;
}
static
HRESULT
WINAPI
sink_writer_events_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
static
HRESULT
WINAPI
sink_writer_events_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
{
{
struct
sink_writer
*
writer
=
impl_from_events_callback_IMFAsyncCallback
(
iface
);
IMFStreamSink
*
stream_sink
;
IMFStreamSink
*
stream_sink
;
MediaEventType
event_type
;
MediaEventType
event_type
;
struct
stream
*
stream
;
IMFMediaEvent
*
event
;
IMFMediaEvent
*
event
;
HRESULT
hr
;
LONGLONG
timestamp
;
HRESULT
status
,
hr
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
result
);
TRACE
(
"%p, %p.
\n
"
,
iface
,
result
);
...
@@ -498,9 +517,36 @@ static HRESULT WINAPI sink_writer_events_callback_Invoke(IMFAsyncCallback *iface
...
@@ -498,9 +517,36 @@ static HRESULT WINAPI sink_writer_events_callback_Invoke(IMFAsyncCallback *iface
return
hr
;
return
hr
;
IMFMediaEvent_GetType
(
event
,
&
event_type
);
IMFMediaEvent_GetType
(
event
,
&
event_type
);
IMFMediaEvent_GetStatus
(
event
,
&
status
);
TRACE
(
"Got event %lu.
\n
"
,
event_type
);
TRACE
(
"Got event %lu.
\n
"
,
event_type
);
EnterCriticalSection
(
&
writer
->
cs
);
if
(
writer
->
status
==
S_OK
&&
FAILED
(
status
))
writer
->
status
=
status
;
if
(
writer
->
status
==
S_OK
&&
(
stream
=
sink_writer_get_stream_for_stream_sink
(
writer
,
stream_sink
)))
{
switch
(
event_type
)
{
case
MEStreamSinkRequestSample
:
timestamp
=
MFGetSystemTime
();
writer
->
stats
.
llLastSinkSampleRequest
=
timestamp
;
writer
->
stats
.
dwNumOutstandingSinkSampleRequests
++
;
stream
->
stats
.
llLastSinkSampleRequest
=
timestamp
;
stream
->
stats
.
dwNumOutstandingSinkSampleRequests
++
;
break
;
default:
;
}
}
LeaveCriticalSection
(
&
writer
->
cs
);
IMFMediaEvent_Release
(
event
);
IMFMediaEvent_Release
(
event
);
IMFStreamSink_BeginGetEvent
(
stream_sink
,
iface
,
(
IUnknown
*
)
stream_sink
);
IMFStreamSink_BeginGetEvent
(
stream_sink
,
iface
,
(
IUnknown
*
)
stream_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