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
1cb37f7e
Commit
1cb37f7e
authored
Oct 14, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/sample: Implement IMFDesiredSample.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db8f8591
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
5 deletions
+68
-5
sample.c
dlls/evr/sample.c
+38
-4
evr.c
dlls/evr/tests/evr.c
+30
-1
No files found.
dlls/evr/sample.c
View file @
1cb37f7e
...
...
@@ -59,6 +59,10 @@ struct video_sample
IMFAsyncResult
*
tracked_result
;
LONG
tracked_refcount
;
LONGLONG
desired_time
;
LONGLONG
desired_duration
;
BOOL
desired_set
;
};
static
struct
video_sample
*
impl_from_IMFSample
(
IMFSample
*
iface
)
...
...
@@ -869,20 +873,50 @@ static ULONG WINAPI desired_video_sample_Release(IMFDesiredSample *iface)
static
HRESULT
WINAPI
desired_video_sample_GetDesiredSampleTimeAndDuration
(
IMFDesiredSample
*
iface
,
LONGLONG
*
sample_time
,
LONGLONG
*
sample_duration
)
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
sample_time
,
sample_duration
);
struct
video_sample
*
sample
=
impl_from_IMFDesiredSample
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
sample_time
,
sample_duration
);
if
(
!
sample_time
||
!
sample_duration
)
return
E_POINTER
;
IMFSample_LockStore
(
sample
->
sample
);
if
(
sample
->
desired_set
)
{
*
sample_time
=
sample
->
desired_time
;
*
sample_duration
=
sample
->
desired_duration
;
}
else
hr
=
MF_E_NOT_AVAILABLE
;
IMFSample_UnlockStore
(
sample
->
sample
);
return
hr
;
}
static
void
WINAPI
desired_video_sample_SetDesiredSampleTimeAndDuration
(
IMFDesiredSample
*
iface
,
LONGLONG
sample_time
,
LONGLONG
sample_duration
)
{
FIXME
(
"%p, %s, %s.
\n
"
,
iface
,
debugstr_time
(
sample_time
),
debugstr_time
(
sample_duration
));
struct
video_sample
*
sample
=
impl_from_IMFDesiredSample
(
iface
);
TRACE
(
"%p, %s, %s.
\n
"
,
iface
,
debugstr_time
(
sample_time
),
debugstr_time
(
sample_duration
));
IMFSample_LockStore
(
sample
->
sample
);
sample
->
desired_set
=
TRUE
;
sample
->
desired_time
=
sample_time
;
sample
->
desired_duration
=
sample_duration
;
IMFSample_UnlockStore
(
sample
->
sample
);
}
static
void
WINAPI
desired_video_sample_Clear
(
IMFDesiredSample
*
iface
)
{
FIXME
(
"%p.
\n
"
,
iface
);
struct
video_sample
*
sample
=
impl_from_IMFDesiredSample
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
IMFSample_LockStore
(
sample
->
sample
);
sample
->
desired_set
=
FALSE
;
IMFSample_UnlockStore
(
sample
->
sample
);
}
static
const
IMFDesiredSampleVtbl
desired_video_sample_vtbl
=
...
...
dlls/evr/tests/evr.c
View file @
1cb37f7e
...
...
@@ -721,11 +721,11 @@ static void test_surface_sample(void)
IDirect3DSurface9
*
backbuffer
=
NULL
;
IMFDesiredSample
*
desired_sample
;
IMFMediaBuffer
*
buffer
,
*
buffer2
;
LONGLONG
duration
,
time1
,
time2
;
IDirect3DSwapChain9
*
swapchain
;
DWORD
flags
,
count
,
length
;
IDirect3DDevice9
*
device
;
IMFSample
*
sample
;
LONGLONG
duration
;
IDirect3D9
*
d3d
;
IUnknown
*
unk
;
HWND
window
;
...
...
@@ -764,8 +764,37 @@ static void test_surface_sample(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Unexpected attribute count %u.
\n
"
,
count
);
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
NULL
,
&
time2
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
&
time1
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
&
time1
,
&
time2
);
ok
(
hr
==
MF_E_NOT_AVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFDesiredSample_SetDesiredSampleTimeAndDuration
(
desired_sample
,
123
,
456
);
time1
=
time2
=
0
;
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
&
time1
,
&
time2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
time1
==
123
&&
time2
==
456
,
"Unexpected time values.
\n
"
);
IMFDesiredSample_SetDesiredSampleTimeAndDuration
(
desired_sample
,
0
,
0
);
time1
=
time2
=
1
;
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
&
time1
,
&
time2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
time1
==
0
&&
time2
==
0
,
"Unexpected time values.
\n
"
);
IMFDesiredSample_Clear
(
desired_sample
);
hr
=
IMFDesiredSample_GetDesiredSampleTimeAndDuration
(
desired_sample
,
&
time1
,
&
time2
);
ok
(
hr
==
MF_E_NOT_AVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_GetCount
(
sample
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Unexpected attribute count %u.
\n
"
,
count
);
...
...
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