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
a6d048f6
Commit
a6d048f6
authored
Feb 21, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Request another sample from sample grabber in clock-ignoring mode.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
431afba5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
samplegrabber.c
dlls/mf/samplegrabber.c
+20
-8
No files found.
dlls/mf/samplegrabber.c
View file @
a6d048f6
...
@@ -315,7 +315,7 @@ static HRESULT WINAPI sample_grabber_stream_GetMediaTypeHandler(IMFStreamSink *i
...
@@ -315,7 +315,7 @@ static HRESULT WINAPI sample_grabber_stream_GetMediaTypeHandler(IMFStreamSink *i
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
sample_grabber_report_sample
(
struct
sample_grabber
*
grabber
,
IMFSample
*
sample
)
static
HRESULT
sample_grabber_report_sample
(
struct
sample_grabber
*
grabber
,
IMFSample
*
sample
,
BOOL
*
sample_delivered
)
{
{
LONGLONG
sample_time
,
sample_duration
=
0
;
LONGLONG
sample_time
,
sample_duration
=
0
;
IMFMediaBuffer
*
buffer
;
IMFMediaBuffer
*
buffer
;
...
@@ -324,6 +324,8 @@ static HRESULT sample_grabber_report_sample(struct sample_grabber *grabber, IMFS
...
@@ -324,6 +324,8 @@ static HRESULT sample_grabber_report_sample(struct sample_grabber *grabber, IMFS
BYTE
*
data
;
BYTE
*
data
;
HRESULT
hr
;
HRESULT
hr
;
*
sample_delivered
=
FALSE
;
hr
=
IMFMediaType_GetMajorType
(
grabber
->
media_type
,
&
major_type
);
hr
=
IMFMediaType_GetMajorType
(
grabber
->
media_type
,
&
major_type
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
...
@@ -342,6 +344,8 @@ static HRESULT sample_grabber_report_sample(struct sample_grabber *grabber, IMFS
...
@@ -342,6 +344,8 @@ static HRESULT sample_grabber_report_sample(struct sample_grabber *grabber, IMFS
if
(
SUCCEEDED
(
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
NULL
,
&
size
)))
if
(
SUCCEEDED
(
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
NULL
,
&
size
)))
{
{
*
sample_delivered
=
TRUE
;
if
(
grabber
->
callback2
)
if
(
grabber
->
callback2
)
{
{
hr
=
IMFSample_CopyAllItems
(
sample
,
grabber
->
stream
->
sample_attributes
);
hr
=
IMFSample_CopyAllItems
(
sample
,
grabber
->
stream
->
sample_attributes
);
...
@@ -414,9 +418,15 @@ static HRESULT stream_queue_sample(struct sample_grabber_stream *stream, IMFSamp
...
@@ -414,9 +418,15 @@ static HRESULT stream_queue_sample(struct sample_grabber_stream *stream, IMFSamp
return
hr
;
return
hr
;
}
}
static
void
sample_grabber_stream_request_sample
(
struct
sample_grabber_stream
*
stream
)
{
IMFStreamSink_QueueEvent
(
&
stream
->
IMFStreamSink_iface
,
MEStreamSinkRequestSample
,
&
GUID_NULL
,
S_OK
,
NULL
);
}
static
HRESULT
WINAPI
sample_grabber_stream_ProcessSample
(
IMFStreamSink
*
iface
,
IMFSample
*
sample
)
static
HRESULT
WINAPI
sample_grabber_stream_ProcessSample
(
IMFStreamSink
*
iface
,
IMFSample
*
sample
)
{
{
struct
sample_grabber_stream
*
stream
=
impl_from_IMFStreamSink
(
iface
);
struct
sample_grabber_stream
*
stream
=
impl_from_IMFStreamSink
(
iface
);
BOOL
sample_delivered
;
LONGLONG
sampletime
;
LONGLONG
sampletime
;
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
...
@@ -437,7 +447,13 @@ static HRESULT WINAPI sample_grabber_stream_ProcessSample(IMFStreamSink *iface,
...
@@ -437,7 +447,13 @@ static HRESULT WINAPI sample_grabber_stream_ProcessSample(IMFStreamSink *iface,
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
if
(
stream
->
sink
->
ignore_clock
)
if
(
stream
->
sink
->
ignore_clock
)
hr
=
sample_grabber_report_sample
(
stream
->
sink
,
sample
);
{
/* OnProcessSample() could return error code, which has to be propagated but isn't a blocker.
Use additional flag indicating that user callback was called at all. */
hr
=
sample_grabber_report_sample
(
stream
->
sink
,
sample
,
&
sample_delivered
);
if
(
sample_delivered
)
sample_grabber_stream_request_sample
(
stream
);
}
else
else
hr
=
stream_queue_sample
(
stream
,
sample
);
hr
=
stream_queue_sample
(
stream
,
sample
);
}
}
...
@@ -725,15 +741,11 @@ static struct scheduled_item *stream_get_next_item(struct sample_grabber_stream
...
@@ -725,15 +741,11 @@ static struct scheduled_item *stream_get_next_item(struct sample_grabber_stream
return
item
;
return
item
;
}
}
static
void
sample_grabber_stream_request_sample
(
struct
sample_grabber_stream
*
stream
)
{
IMFStreamSink_QueueEvent
(
&
stream
->
IMFStreamSink_iface
,
MEStreamSinkRequestSample
,
&
GUID_NULL
,
S_OK
,
NULL
);
}
static
HRESULT
WINAPI
sample_grabber_stream_timer_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
static
HRESULT
WINAPI
sample_grabber_stream_timer_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
{
{
struct
sample_grabber_stream
*
stream
=
impl_from_IMFAsyncCallback
(
iface
);
struct
sample_grabber_stream
*
stream
=
impl_from_IMFAsyncCallback
(
iface
);
struct
scheduled_item
*
item
;
struct
scheduled_item
*
item
;
BOOL
sample_delivered
;
HRESULT
hr
;
HRESULT
hr
;
EnterCriticalSection
(
&
stream
->
cs
);
EnterCriticalSection
(
&
stream
->
cs
);
...
@@ -746,7 +758,7 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba
...
@@ -746,7 +758,7 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba
switch
(
item
->
type
)
switch
(
item
->
type
)
{
{
case
ITEM_TYPE_SAMPLE
:
case
ITEM_TYPE_SAMPLE
:
if
(
FAILED
(
hr
=
sample_grabber_report_sample
(
stream
->
sink
,
item
->
u
.
sample
)))
if
(
FAILED
(
hr
=
sample_grabber_report_sample
(
stream
->
sink
,
item
->
u
.
sample
,
&
sample_delivered
)))
WARN
(
"Failed to report a sample, hr %#x.
\n
"
,
hr
);
WARN
(
"Failed to report a sample, hr %#x.
\n
"
,
hr
);
stream_release_pending_item
(
item
);
stream_release_pending_item
(
item
);
item
=
stream_get_next_item
(
stream
);
item
=
stream_get_next_item
(
stream
);
...
...
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