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
880559b2
Commit
880559b2
authored
Jun 07, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Implement stream flushing for sample grabber.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f5252512
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
8 deletions
+33
-8
samplegrabber.c
dlls/mf/samplegrabber.c
+33
-8
No files found.
dlls/mf/samplegrabber.c
View file @
880559b2
...
...
@@ -171,7 +171,7 @@ static ULONG WINAPI sample_grabber_stream_AddRef(IMFStreamSink *iface)
return
refcount
;
}
static
void
stream_release_pending_item
(
struct
s
ample_grabber_stream
*
stream
,
struct
s
cheduled_item
*
item
)
static
void
stream_release_pending_item
(
struct
scheduled_item
*
item
)
{
list_remove
(
&
item
->
entry
);
switch
(
item
->
type
)
...
...
@@ -211,7 +211,7 @@ static ULONG WINAPI sample_grabber_stream_Release(IMFStreamSink *iface)
}
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
next_item
,
&
stream
->
items
,
struct
scheduled_item
,
entry
)
{
stream_release_pending_item
(
stream
,
item
);
stream_release_pending_item
(
item
);
}
DeleteCriticalSection
(
&
stream
->
cs
);
heap_free
(
stream
);
...
...
@@ -392,7 +392,7 @@ static HRESULT stream_queue_sample(struct sample_grabber_stream *stream, IMFSamp
if
(
SUCCEEDED
(
hr
))
list_add_tail
(
&
stream
->
items
,
&
item
->
entry
);
else
stream_release_pending_item
(
stream
,
item
);
stream_release_pending_item
(
item
);
return
hr
;
}
...
...
@@ -459,7 +459,7 @@ static HRESULT stream_place_marker(struct sample_grabber_stream *stream, MFSTREA
if
(
SUCCEEDED
(
hr
))
list_add_tail
(
&
stream
->
items
,
&
item
->
entry
);
else
stream_release_pending_item
(
stream
,
item
);
stream_release_pending_item
(
item
);
return
hr
;
}
...
...
@@ -487,9 +487,34 @@ static HRESULT WINAPI sample_grabber_stream_PlaceMarker(IMFStreamSink *iface, MF
static
HRESULT
WINAPI
sample_grabber_stream_Flush
(
IMFStreamSink
*
iface
)
{
FIXME
(
"%p.
\n
"
,
iface
);
struct
sample_grabber_stream
*
stream
=
impl_from_IMFStreamSink
(
iface
);
struct
scheduled_item
*
item
,
*
next_item
;
return
E_NOTIMPL
;
TRACE
(
"%p.
\n
"
,
iface
);
if
(
!
stream
->
sink
)
return
MF_E_STREAMSINK_REMOVED
;
EnterCriticalSection
(
&
stream
->
cs
);
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
next_item
,
&
stream
->
items
,
struct
scheduled_item
,
entry
)
{
/* Samples are discarded, markers are processed immediately. */
switch
(
item
->
type
)
{
case
ITEM_TYPE_SAMPLE
:
break
;
case
ITEM_TYPE_MARKER
:
sample_grabber_stream_report_marker
(
stream
,
&
item
->
u
.
marker
.
context
,
E_ABORT
);
break
;
}
stream_release_pending_item
(
item
);
}
LeaveCriticalSection
(
&
stream
->
cs
);
return
S_OK
;
}
static
const
IMFStreamSinkVtbl
sample_grabber_stream_vtbl
=
...
...
@@ -706,7 +731,7 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba
case
ITEM_TYPE_SAMPLE
:
if
(
FAILED
(
hr
=
sample_grabber_report_sample
(
stream
->
sink
,
item
->
u
.
sample
)))
WARN
(
"Failed to report a sample, hr %#x.
\n
"
,
hr
);
stream_release_pending_item
(
stream
,
item
);
stream_release_pending_item
(
item
);
item
=
stream_get_next_item
(
stream
);
if
(
item
&&
item
->
type
==
ITEM_TYPE_SAMPLE
)
{
...
...
@@ -718,7 +743,7 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba
break
;
case
ITEM_TYPE_MARKER
:
sample_grabber_stream_report_marker
(
stream
,
&
item
->
u
.
marker
.
context
,
S_OK
);
stream_release_pending_item
(
stream
,
item
);
stream_release_pending_item
(
item
);
item
=
stream_get_next_item
(
stream
);
break
;
}
...
...
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