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
3e784ab4
Commit
3e784ab4
authored
Jun 03, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Set presentation duration attribute.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c1a12f10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
main.c
dlls/mfmediaengine/main.c
+27
-3
No files found.
dlls/mfmediaengine/main.c
View file @
3e784ab4
...
...
@@ -18,6 +18,7 @@
#define COBJMACROS
#include <math.h>
#include <stdarg.h>
#include "windef.h"
...
...
@@ -82,6 +83,7 @@ struct media_engine
double
playback_rate
;
double
default_playback_rate
;
double
volume
;
double
duration
;
IMFMediaSession
*
session
;
IMFSourceResolver
*
resolver
;
CRITICAL_SECTION
cs
;
...
...
@@ -208,6 +210,7 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
IMFStreamDescriptor
*
sd_audio
=
NULL
,
*
sd_video
=
NULL
;
unsigned
int
stream_count
=
0
,
i
;
IMFPresentationDescriptor
*
pd
;
UINT64
duration
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IMFMediaSource_CreatePresentationDescriptor
(
source
,
&
pd
)))
...
...
@@ -265,7 +268,20 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
if
(
sd_audio
)
engine
->
flags
|=
FLAGS_ENGINE_HAS_AUDIO
;
/* TODO: set duration */
/* Assume live source if duration was not provided. */
if
(
SUCCEEDED
(
IMFPresentationDescriptor_GetUINT64
(
pd
,
&
MF_PD_DURATION
,
&
duration
)))
{
/* Convert 100ns to seconds. */
engine
->
duration
=
duration
/
10000000
;
}
else
engine
->
duration
=
INFINITY
;
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE
,
0
,
0
);
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA
,
0
,
0
);
IMFMediaEngineNotify_EventNotify
(
engine
->
callback
,
MF_MEDIA_ENGINE_EVENT_LOADEDDATA
,
0
,
0
);
/* TODO: set up topology nodes */
if
(
sd_video
)
IMFStreamDescriptor_Release
(
sd_video
);
...
...
@@ -513,9 +529,16 @@ static double WINAPI media_engine_GetStartTime(IMFMediaEngine *iface)
static
double
WINAPI
media_engine_GetDuration
(
IMFMediaEngine
*
iface
)
{
FIXME
(
"(%p): stub.
\n
"
,
iface
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
double
value
;
return
0
.
0
;
TRACE
(
"%p.
\n
"
,
iface
);
EnterCriticalSection
(
&
engine
->
cs
);
value
=
engine
->
duration
;
LeaveCriticalSection
(
&
engine
->
cs
);
return
value
;
}
static
BOOL
WINAPI
media_engine_IsPaused
(
IMFMediaEngine
*
iface
)
...
...
@@ -962,6 +985,7 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct
engine
->
default_playback_rate
=
1
.
0
;
engine
->
playback_rate
=
1
.
0
;
engine
->
volume
=
1
.
0
;
engine
->
duration
=
NAN
;
InitializeCriticalSection
(
&
engine
->
cs
);
hr
=
IMFAttributes_GetUnknown
(
attributes
,
&
MF_MEDIA_ENGINE_CALLBACK
,
&
IID_IMFMediaEngineNotify
,
...
...
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