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
8e82c720
Commit
8e82c720
authored
Nov 17, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/mixer: Set timestamp and duration for output samples.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
061c747b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
mixer.c
dlls/evr/mixer.c
+11
-0
evr.c
dlls/evr/tests/evr.c
+54
-2
No files found.
dlls/evr/mixer.c
View file @
8e82c720
...
...
@@ -1272,8 +1272,19 @@ static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, D
}
if
(
SUCCEEDED
(
hr
))
{
video_mixer_render
(
mixer
,
surface
);
timestamp
=
duration
=
0
;
if
(
SUCCEEDED
(
IMFSample_GetSampleTime
(
mixer
->
inputs
[
0
].
sample
,
&
timestamp
)))
{
IMFSample_SetSampleTime
(
buffers
->
pSample
,
timestamp
);
IMFSample_GetSampleDuration
(
mixer
->
inputs
[
0
].
sample
,
&
duration
);
IMFSample_SetSampleDuration
(
buffers
->
pSample
,
duration
);
}
}
if
(
SUCCEEDED
(
hr
))
{
for
(
i
=
0
;
i
<
mixer
->
input_count
;
++
i
)
...
...
dlls/evr/tests/evr.c
View file @
8e82c720
...
...
@@ -2219,13 +2219,14 @@ static void test_mixer_samples(void)
IMFDesiredSample
*
desired
;
IDirect3DDevice9
*
device
;
IMFMediaType
*
video_type
;
DWORD
color
,
status
;
DWORD
co
unt
,
flags
,
co
lor
,
status
;
IMFTransform
*
mixer
;
IMFSample
*
sample
;
IMFSample
*
sample
,
*
sample2
;
IDirect3D9
*
d3d
;
HWND
window
;
UINT
token
;
HRESULT
hr
;
LONGLONG
pts
,
duration
;
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
...
...
@@ -2395,6 +2396,57 @@ static void test_mixer_samples(void)
hr
=
IMFTransform_ProcessInput
(
mixer
,
5
,
sample
,
0
);
ok
(
hr
==
MF_E_INVALIDSTREAMNUMBER
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* ProcessOutput() sets sample time and duration. */
hr
=
MFCreateVideoSampleFromSurface
((
IUnknown
*
)
surface
,
&
sample2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_SetUINT32
(
sample2
,
&
IID_IMFSample
,
1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_SetSampleFlags
(
sample2
,
0x123
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_GetSampleTime
(
sample2
,
&
pts
);
ok
(
hr
==
MF_E_NO_SAMPLE_TIMESTAMP
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_GetSampleDuration
(
sample2
,
&
duration
);
ok
(
hr
==
MF_E_NO_SAMPLE_DURATION
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_SetSampleTime
(
sample
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_SetSampleDuration
(
sample
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
memset
(
buffers
,
0
,
sizeof
(
buffers
));
buffers
[
0
].
pSample
=
sample2
;
hr
=
IMFTransform_ProcessOutput
(
mixer
,
0
,
1
,
buffers
,
&
status
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_GetSampleTime
(
sample2
,
&
pts
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
pts
,
"Unexpected sample time.
\n
"
);
hr
=
IMFSample_GetSampleDuration
(
sample2
,
&
duration
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
duration
,
"Unexpected duration
\n
"
);
/* Flags are not copied. */
hr
=
IMFSample_GetSampleFlags
(
sample2
,
&
flags
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
flags
==
0x123
,
"Unexpected flags %#x.
\n
"
,
flags
);
/* Attributes are not removed. */
hr
=
IMFSample_GetCount
(
sample2
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected attribute count %u.
\n
"
,
count
);
hr
=
IMFSample_GetCount
(
sample
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Unexpected attribute count %u.
\n
"
,
count
);
IMFSample_Release
(
sample2
);
hr
=
IMFTransform_ProcessMessage
(
mixer
,
MFT_MESSAGE_COMMAND_DRAIN
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
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