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
e4ec280e
Commit
e4ec280e
authored
Nov 10, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Add a helpe for input processing.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
603b00fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
presenter.c
dlls/evr/presenter.c
+54
-0
No files found.
dlls/evr/presenter.c
View file @
e4ec280e
...
...
@@ -40,6 +40,11 @@ enum presenter_state
PRESENTER_STATE_PAUSED
,
};
enum
presenter_flags
{
PRESENTER_MIXER_HAS_INPUT
=
0x1
,
};
enum
streaming_thread_message
{
EVRM_STOP
=
WM_USER
,
...
...
@@ -82,6 +87,7 @@ struct video_presenter
SIZE
native_ratio
;
unsigned
int
ar_mode
;
unsigned
int
state
;
unsigned
int
flags
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -311,6 +317,50 @@ static HRESULT video_presenter_end_streaming(struct video_presenter *presenter)
return
S_OK
;
}
static
HRESULT
video_presenter_process_input
(
struct
video_presenter
*
presenter
)
{
MFT_OUTPUT_DATA_BUFFER
buffer
;
HRESULT
hr
=
S_OK
;
IMFSample
*
sample
;
DWORD
status
;
if
(
!
presenter
->
media_type
)
return
S_OK
;
while
(
hr
==
S_OK
)
{
if
(
!
(
presenter
->
flags
&
PRESENTER_MIXER_HAS_INPUT
))
break
;
if
(
FAILED
(
hr
=
IMFVideoSampleAllocator_AllocateSample
(
presenter
->
allocator
,
&
sample
)))
{
WARN
(
"Failed to allocate a sample, hr %#x.
\n
"
,
hr
);
break
;
}
memset
(
&
buffer
,
0
,
sizeof
(
buffer
));
buffer
.
pSample
=
sample
;
if
(
FAILED
(
hr
=
IMFTransform_ProcessOutput
(
presenter
->
mixer
,
0
,
1
,
&
buffer
,
&
status
)))
{
/* FIXME: failure path probably needs to handle some errors specifically */
presenter
->
flags
&=
~
PRESENTER_MIXER_HAS_INPUT
;
IMFSample_Release
(
sample
);
break
;
}
else
{
if
(
buffer
.
pEvents
)
IMFCollection_Release
(
buffer
.
pEvents
);
/* FIXME: for now drop output sample back to the pool */
IMFSample_Release
(
sample
);
}
}
return
S_OK
;
}
static
HRESULT
WINAPI
video_presenter_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
video_presenter
*
presenter
=
impl_from_IUnknown
(
iface
);
...
...
@@ -511,6 +561,10 @@ static HRESULT WINAPI video_presenter_ProcessMessage(IMFVideoPresenter *iface, M
case
MFVP_MESSAGE_ENDSTREAMING
:
hr
=
video_presenter_end_streaming
(
presenter
);
break
;
case
MFVP_MESSAGE_PROCESSINPUTNOTIFY
:
presenter
->
flags
|=
PRESENTER_MIXER_HAS_INPUT
;
hr
=
video_presenter_process_input
(
presenter
);
break
;
default:
FIXME
(
"Unsupported message %u.
\n
"
,
message
);
hr
=
E_NOTIMPL
;
...
...
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