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
602d44a1
Commit
602d44a1
authored
Oct 11, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Move mediaSeeking to strmbase SourceSeeking.
parent
a8740a46
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
425 additions
and
377 deletions
+425
-377
avisplit.c
dlls/quartz/avisplit.c
+14
-9
control.c
dlls/quartz/control.c
+0
-282
control_private.h
dlls/quartz/control_private.h
+0
-38
mpegsplit.c
dlls/quartz/mpegsplit.c
+12
-7
parser.c
dlls/quartz/parser.c
+29
-31
parser.h
dlls/quartz/parser.h
+2
-2
videorenderer.c
dlls/quartz/videorenderer.c
+0
-1
waveparser.c
dlls/quartz/waveparser.c
+12
-7
Makefile.in
dlls/strmbase/Makefile.in
+1
-0
seeking.c
dlls/strmbase/seeking.c
+315
-0
strmbase.h
include/wine/strmbase.h
+40
-0
No files found.
dlls/quartz/avisplit.c
View file @
602d44a1
...
...
@@ -101,6 +101,11 @@ struct thread_args {
DWORD
stream
;
};
static
inline
AVISplitterImpl
*
impl_from_IMediaSeeking
(
IMediaSeeking
*
iface
)
{
return
(
AVISplitterImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
AVISplitterImpl
,
Parser
.
sourceSeeking
.
lpVtbl
));
}
/* The threading stuff cries for an explanation
*
* PullPin starts processing and calls AVISplitter_first_request
...
...
@@ -970,16 +975,16 @@ static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This)
frames
*=
stream
->
streamheader
.
dwScale
;
/* Keep accuracy as high as possible for duration */
This
->
Parser
.
media
Seeking
.
llDuration
=
frames
*
10000000
;
This
->
Parser
.
media
Seeking
.
llDuration
/=
stream
->
streamheader
.
dwRate
;
This
->
Parser
.
mediaSeeking
.
llStop
=
This
->
Parser
.
media
Seeking
.
llDuration
;
This
->
Parser
.
media
Seeking
.
llCurrent
=
0
;
This
->
Parser
.
source
Seeking
.
llDuration
=
frames
*
10000000
;
This
->
Parser
.
source
Seeking
.
llDuration
/=
stream
->
streamheader
.
dwRate
;
This
->
Parser
.
sourceSeeking
.
llStop
=
This
->
Parser
.
source
Seeking
.
llDuration
;
This
->
Parser
.
source
Seeking
.
llCurrent
=
0
;
frames
/=
stream
->
streamheader
.
dwRate
;
TRACE
(
"Duration: %d days, %d hours, %d minutes and %d.%03u seconds
\n
"
,
(
DWORD
)(
frames
/
86400
),
(
DWORD
)((
frames
%
86400
)
/
3600
),
(
DWORD
)((
frames
%
3600
)
/
60
),
(
DWORD
)(
frames
%
60
),
(
DWORD
)(
This
->
Parser
.
media
Seeking
.
llDuration
/
10000
)
%
1000
);
(
DWORD
)(
This
->
Parser
.
source
Seeking
.
llDuration
/
10000
)
%
1000
);
}
return
S_OK
;
...
...
@@ -1252,15 +1257,15 @@ static ULONG WINAPI AVISplitter_Release(IBaseFilter *iface)
return
ref
;
}
static
HRESULT
AVISplitter_seek
(
IBaseFilter
*
iface
)
static
HRESULT
WINAPI
AVISplitter_seek
(
IMediaSeeking
*
iface
)
{
AVISplitterImpl
*
This
=
(
AVISplitterImpl
*
)
iface
;
AVISplitterImpl
*
This
=
impl_from_IMediaSeeking
(
iface
)
;
PullPin
*
pPin
=
This
->
Parser
.
pInputPin
;
LONGLONG
newpos
,
endpos
;
DWORD
x
;
newpos
=
This
->
Parser
.
media
Seeking
.
llCurrent
;
endpos
=
This
->
Parser
.
media
Seeking
.
llDuration
;
newpos
=
This
->
Parser
.
source
Seeking
.
llCurrent
;
endpos
=
This
->
Parser
.
source
Seeking
.
llDuration
;
if
(
newpos
>
endpos
)
{
...
...
dlls/quartz/control.c
View file @
602d44a1
...
...
@@ -224,288 +224,6 @@ HRESULT SeekingPassThru_create(IUnknown *pUnkOuter, LPVOID *ppObj)
return
S_OK
;
}
HRESULT
MediaSeekingImpl_Init
(
IBaseFilter
*
pUserData
,
CHANGEPROC
fnChangeStop
,
CHANGEPROC
fnChangeCurrent
,
CHANGEPROC
fnChangeRate
,
MediaSeekingImpl
*
pSeeking
,
PCRITICAL_SECTION
crit_sect
)
{
assert
(
fnChangeStop
&&
fnChangeCurrent
&&
fnChangeRate
);
pSeeking
->
refCount
=
1
;
pSeeking
->
pUserData
=
pUserData
;
pSeeking
->
fnChangeRate
=
fnChangeRate
;
pSeeking
->
fnChangeStop
=
fnChangeStop
;
pSeeking
->
fnChangeCurrent
=
fnChangeCurrent
;
pSeeking
->
dwCapabilities
=
AM_SEEKING_CanSeekForwards
|
AM_SEEKING_CanSeekBackwards
|
AM_SEEKING_CanSeekAbsolute
|
AM_SEEKING_CanGetStopPos
|
AM_SEEKING_CanGetDuration
;
pSeeking
->
llCurrent
=
0
;
pSeeking
->
llStop
=
((
ULONGLONG
)
0x80000000
)
<<
32
;
pSeeking
->
llDuration
=
pSeeking
->
llStop
;
pSeeking
->
dRate
=
1
.
0
;
pSeeking
->
timeformat
=
TIME_FORMAT_MEDIA_TIME
;
pSeeking
->
crst
=
crit_sect
;
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pCapabilities
);
*
pCapabilities
=
This
->
dwCapabilities
;
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_CheckCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
HRESULT
hr
;
DWORD
dwCommonCaps
;
TRACE
(
"(%p)
\n
"
,
pCapabilities
);
if
(
!
pCapabilities
)
return
E_POINTER
;
dwCommonCaps
=
*
pCapabilities
&
This
->
dwCapabilities
;
if
(
!
dwCommonCaps
)
hr
=
E_FAIL
;
else
hr
=
(
*
pCapabilities
==
dwCommonCaps
)
?
S_OK
:
S_FALSE
;
*
pCapabilities
=
dwCommonCaps
;
return
hr
;
}
HRESULT
WINAPI
MediaSeekingImpl_IsFormatSupported
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
)
{
TRACE
(
"(%s)
\n
"
,
qzdebugstr_guid
(
pFormat
));
return
(
IsEqualIID
(
pFormat
,
&
TIME_FORMAT_MEDIA_TIME
)
?
S_OK
:
S_FALSE
);
}
HRESULT
WINAPI
MediaSeekingImpl_QueryPreferredFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
)
{
TRACE
(
"(%s)
\n
"
,
qzdebugstr_guid
(
pFormat
));
*
pFormat
=
TIME_FORMAT_MEDIA_TIME
;
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetTimeFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%s)
\n
"
,
qzdebugstr_guid
(
pFormat
));
EnterCriticalSection
(
This
->
crst
);
*
pFormat
=
This
->
timeformat
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_IsUsingTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%s)
\n
"
,
qzdebugstr_guid
(
pFormat
));
EnterCriticalSection
(
This
->
crst
);
if
(
!
IsEqualIID
(
pFormat
,
&
This
->
timeformat
))
hr
=
S_FALSE
;
LeaveCriticalSection
(
This
->
crst
);
return
hr
;
}
HRESULT
WINAPI
MediaSeekingImpl_SetTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"%p %s
\n
"
,
This
,
qzdebugstr_guid
(
pFormat
));
return
(
IsEqualIID
(
pFormat
,
&
TIME_FORMAT_MEDIA_TIME
)
?
S_OK
:
E_INVALIDARG
);
}
HRESULT
WINAPI
MediaSeekingImpl_GetDuration
(
IMediaSeeking
*
iface
,
LONGLONG
*
pDuration
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pDuration
);
EnterCriticalSection
(
This
->
crst
);
*
pDuration
=
This
->
llDuration
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetStopPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pStop
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pStop
);
EnterCriticalSection
(
This
->
crst
);
*
pStop
=
This
->
llStop
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
/* FIXME: Make use of the info the filter should expose */
HRESULT
WINAPI
MediaSeekingImpl_GetCurrentPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pCurrent
);
EnterCriticalSection
(
This
->
crst
);
*
pCurrent
=
This
->
llCurrent
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_ConvertTimeFormat
(
IMediaSeeking
*
iface
,
LONGLONG
*
pTarget
,
const
GUID
*
pTargetFormat
,
LONGLONG
Source
,
const
GUID
*
pSourceFormat
)
{
if
(
IsEqualIID
(
pTargetFormat
,
&
TIME_FORMAT_MEDIA_TIME
)
&&
IsEqualIID
(
pSourceFormat
,
&
TIME_FORMAT_MEDIA_TIME
))
{
*
pTarget
=
Source
;
return
S_OK
;
}
/* FIXME: clear pTarget? */
return
E_INVALIDARG
;
}
static
inline
LONGLONG
Adjust
(
LONGLONG
value
,
const
LONGLONG
*
pModifier
,
DWORD
dwFlags
)
{
switch
(
dwFlags
&
AM_SEEKING_PositioningBitsMask
)
{
case
AM_SEEKING_NoPositioning
:
return
value
;
case
AM_SEEKING_AbsolutePositioning
:
return
*
pModifier
;
case
AM_SEEKING_RelativePositioning
:
case
AM_SEEKING_IncrementalPositioning
:
return
value
+
*
pModifier
;
default:
assert
(
FALSE
);
return
0
;
}
}
HRESULT
WINAPI
MediaSeekingImpl_SetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
DWORD
dwCurrentFlags
,
LONGLONG
*
pStop
,
DWORD
dwStopFlags
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
BOOL
bChangeCurrent
=
FALSE
,
bChangeStop
=
FALSE
;
LONGLONG
llNewCurrent
,
llNewStop
;
TRACE
(
"(%p, %x, %p, %x)
\n
"
,
pCurrent
,
dwCurrentFlags
,
pStop
,
dwStopFlags
);
EnterCriticalSection
(
This
->
crst
);
llNewCurrent
=
Adjust
(
This
->
llCurrent
,
pCurrent
,
dwCurrentFlags
);
llNewStop
=
Adjust
(
This
->
llStop
,
pStop
,
dwStopFlags
);
if
(
pCurrent
)
bChangeCurrent
=
TRUE
;
if
(
llNewStop
!=
This
->
llStop
)
bChangeStop
=
TRUE
;
TRACE
(
"Old: %u, New: %u
\n
"
,
(
DWORD
)(
This
->
llCurrent
/
10000000
),
(
DWORD
)(
llNewCurrent
/
10000000
));
This
->
llCurrent
=
llNewCurrent
;
This
->
llStop
=
llNewStop
;
if
(
pCurrent
&&
(
dwCurrentFlags
&
AM_SEEKING_ReturnTime
))
*
pCurrent
=
llNewCurrent
;
if
(
pStop
&&
(
dwStopFlags
&
AM_SEEKING_ReturnTime
))
*
pStop
=
llNewStop
;
LeaveCriticalSection
(
This
->
crst
);
if
(
bChangeCurrent
)
This
->
fnChangeCurrent
(
This
->
pUserData
);
if
(
bChangeStop
)
This
->
fnChangeStop
(
This
->
pUserData
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
LONGLONG
*
pStop
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
pCurrent
,
pStop
);
EnterCriticalSection
(
This
->
crst
);
IMediaSeeking_GetCurrentPosition
(
iface
,
pCurrent
);
IMediaSeeking_GetStopPosition
(
iface
,
pStop
);
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetAvailable
(
IMediaSeeking
*
iface
,
LONGLONG
*
pEarliest
,
LONGLONG
*
pLatest
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
pEarliest
,
pLatest
);
EnterCriticalSection
(
This
->
crst
);
*
pEarliest
=
0
;
*
pLatest
=
This
->
llDuration
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_SetRate
(
IMediaSeeking
*
iface
,
double
dRate
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
BOOL
bChangeRate
=
(
dRate
!=
This
->
dRate
);
HRESULT
hr
=
S_OK
;
TRACE
(
"(%e)
\n
"
,
dRate
);
if
(
dRate
>
100
||
dRate
<
.
001
)
{
FIXME
(
"Excessive rate %e, ignoring
\n
"
,
dRate
);
return
VFW_E_UNSUPPORTED_AUDIO
;
}
EnterCriticalSection
(
This
->
crst
);
This
->
dRate
=
dRate
;
if
(
bChangeRate
)
hr
=
This
->
fnChangeRate
(
This
->
pUserData
);
LeaveCriticalSection
(
This
->
crst
);
return
hr
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetRate
(
IMediaSeeking
*
iface
,
double
*
dRate
)
{
MediaSeekingImpl
*
This
=
(
MediaSeekingImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
dRate
);
EnterCriticalSection
(
This
->
crst
);
/* Forward? */
*
dRate
=
This
->
dRate
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
MediaSeekingImpl_GetPreroll
(
IMediaSeeking
*
iface
,
LONGLONG
*
pPreroll
)
{
TRACE
(
"(%p)
\n
"
,
pPreroll
);
*
pPreroll
=
0
;
return
S_OK
;
}
static
HRESULT
WINAPI
MediaSeekingPassThru_QueryInterface
(
IMediaSeeking
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ICOM_THIS_MULTI
(
PassThruImpl
,
IMediaSeeking_vtbl
,
iface
);
...
...
dlls/quartz/control_private.h
View file @
602d44a1
...
...
@@ -21,44 +21,6 @@
#ifndef QUARTZ_CONTROL_H
#define QUARTZ_CONTROL_H
typedef
HRESULT
(
*
CHANGEPROC
)(
IBaseFilter
*
pUserData
);
typedef
struct
MediaSeekingImpl
{
const
IMediaSeekingVtbl
*
lpVtbl
;
ULONG
refCount
;
IBaseFilter
*
pUserData
;
CHANGEPROC
fnChangeStop
;
CHANGEPROC
fnChangeCurrent
;
CHANGEPROC
fnChangeRate
;
DWORD
dwCapabilities
;
double
dRate
;
LONGLONG
llCurrent
,
llStop
,
llDuration
;
GUID
timeformat
;
PCRITICAL_SECTION
crst
;
}
MediaSeekingImpl
;
HRESULT
MediaSeekingImpl_Init
(
IBaseFilter
*
pUserData
,
CHANGEPROC
fnChangeStop
,
CHANGEPROC
fnChangeCurrent
,
CHANGEPROC
fnChangeRate
,
MediaSeekingImpl
*
pSeeking
,
PCRITICAL_SECTION
crit_sect
);
HRESULT
WINAPI
MediaSeekingImpl_GetCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
);
HRESULT
WINAPI
MediaSeekingImpl_CheckCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
);
HRESULT
WINAPI
MediaSeekingImpl_IsFormatSupported
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
);
HRESULT
WINAPI
MediaSeekingImpl_QueryPreferredFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
);
HRESULT
WINAPI
MediaSeekingImpl_GetTimeFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
);
HRESULT
WINAPI
MediaSeekingImpl_IsUsingTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
);
HRESULT
WINAPI
MediaSeekingImpl_SetTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
);
HRESULT
WINAPI
MediaSeekingImpl_GetDuration
(
IMediaSeeking
*
iface
,
LONGLONG
*
pDuration
);
HRESULT
WINAPI
MediaSeekingImpl_GetStopPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pStop
);
HRESULT
WINAPI
MediaSeekingImpl_GetCurrentPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
);
HRESULT
WINAPI
MediaSeekingImpl_ConvertTimeFormat
(
IMediaSeeking
*
iface
,
LONGLONG
*
pTarget
,
const
GUID
*
pTargetFormat
,
LONGLONG
Source
,
const
GUID
*
pSourceFormat
);
HRESULT
WINAPI
MediaSeekingImpl_SetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
DWORD
dwCurrentFlags
,
LONGLONG
*
pStop
,
DWORD
dwStopFlags
);
HRESULT
WINAPI
MediaSeekingImpl_GetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
LONGLONG
*
pStop
);
HRESULT
WINAPI
MediaSeekingImpl_GetAvailable
(
IMediaSeeking
*
iface
,
LONGLONG
*
pEarliest
,
LONGLONG
*
pLatest
);
HRESULT
WINAPI
MediaSeekingImpl_SetRate
(
IMediaSeeking
*
iface
,
double
dRate
);
HRESULT
WINAPI
MediaSeekingImpl_GetRate
(
IMediaSeeking
*
iface
,
double
*
dRate
);
HRESULT
WINAPI
MediaSeekingImpl_GetPreroll
(
IMediaSeeking
*
iface
,
LONGLONG
*
pPreroll
);
void
MediaSeekingPassThru_RegisterMediaTime
(
IUnknown
*
iface
,
REFERENCE_TIME
start
);
void
MediaSeekingPassThru_ResetMediaTime
(
IUnknown
*
iface
);
void
MediaSeekingPassThru_EOS
(
IUnknown
*
iface
);
...
...
dlls/quartz/mpegsplit.c
View file @
602d44a1
...
...
@@ -77,6 +77,11 @@ typedef struct MPEGSplitterImpl
struct
seek_entry
*
seektable
;
}
MPEGSplitterImpl
;
static
inline
MPEGSplitterImpl
*
impl_from_IMediaSeeking
(
IMediaSeeking
*
iface
)
{
return
(
MPEGSplitterImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
MPEGSplitterImpl
,
Parser
.
sourceSeeking
.
lpVtbl
));
}
static
int
MPEGSplitter_head_check
(
const
BYTE
*
header
)
{
/* If this is a possible start code, check for a system or video header */
...
...
@@ -280,7 +285,7 @@ static HRESULT MPEGSplitter_process_sample(LPVOID iface, IMediaSample * pSample,
}
}
if
(
BYTES_FROM_MEDIATIME
(
tStop
)
>=
This
->
EndOfFile
||
This
->
position
>=
This
->
Parser
.
media
Seeking
.
llStop
)
if
(
BYTES_FROM_MEDIATIME
(
tStop
)
>=
This
->
EndOfFile
||
This
->
position
>=
This
->
Parser
.
source
Seeking
.
llStop
)
{
unsigned
int
i
;
...
...
@@ -587,9 +592,9 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO
TRACE
(
"Parsing took %u ms
\n
"
,
GetTickCount
()
-
ticks
);
This
->
duration
=
duration
;
This
->
Parser
.
media
Seeking
.
llCurrent
=
0
;
This
->
Parser
.
media
Seeking
.
llDuration
=
duration
;
This
->
Parser
.
media
Seeking
.
llStop
=
duration
;
This
->
Parser
.
source
Seeking
.
llCurrent
=
0
;
This
->
Parser
.
source
Seeking
.
llDuration
=
duration
;
This
->
Parser
.
source
Seeking
.
llStop
=
duration
;
break
;
}
case
MPEG_VIDEO_HEADER
:
...
...
@@ -618,15 +623,15 @@ static HRESULT MPEGSplitter_cleanup(LPVOID iface)
return
S_OK
;
}
static
HRESULT
MPEGSplitter_seek
(
IBaseFilter
*
iface
)
static
HRESULT
WINAPI
MPEGSplitter_seek
(
IMediaSeeking
*
iface
)
{
MPEGSplitterImpl
*
This
=
(
MPEGSplitterImpl
*
)
iface
;
MPEGSplitterImpl
*
This
=
impl_from_IMediaSeeking
(
iface
)
;
PullPin
*
pPin
=
This
->
Parser
.
pInputPin
;
LONGLONG
newpos
,
timepos
,
bytepos
;
HRESULT
hr
=
S_OK
;
BYTE
header
[
4
];
newpos
=
This
->
Parser
.
media
Seeking
.
llCurrent
;
newpos
=
This
->
Parser
.
source
Seeking
.
llCurrent
;
if
(
newpos
>
This
->
duration
)
{
...
...
dlls/quartz/parser.c
View file @
602d44a1
...
...
@@ -20,7 +20,6 @@
*/
#include "quartz_private.h"
#include "control_private.h"
#include "pin.h"
#include "vfwmsgs.h"
...
...
@@ -41,13 +40,13 @@ static const IMediaSeekingVtbl Parser_Seeking_Vtbl;
static
const
IPinVtbl
Parser_OutputPin_Vtbl
;
static
const
IPinVtbl
Parser_InputPin_Vtbl
;
static
HRESULT
Parser_ChangeCurrent
(
IBaseFilter
*
iface
);
static
HRESULT
Parser_ChangeStop
(
IBaseFilter
*
iface
);
static
HRESULT
Parser_ChangeRate
(
IBaseFilter
*
iface
);
static
HRESULT
WINAPI
Parser_ChangeStart
(
IMediaSeeking
*
iface
);
static
HRESULT
WINAPI
Parser_ChangeStop
(
IMediaSeeking
*
iface
);
static
HRESULT
WINAPI
Parser_ChangeRate
(
IMediaSeeking
*
iface
);
static
inline
ParserImpl
*
impl_from_IMediaSeeking
(
IMediaSeeking
*
iface
)
{
return
(
ParserImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
ParserImpl
,
media
Seeking
.
lpVtbl
));
return
(
ParserImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
ParserImpl
,
source
Seeking
.
lpVtbl
));
}
/* FIXME: WRONG */
...
...
@@ -72,7 +71,7 @@ static LONG WINAPI Parser_GetPinCount(IBaseFilter *iface)
return
This
->
cStreams
;
}
HRESULT
Parser_Create
(
ParserImpl
*
pParser
,
const
IBaseFilterVtbl
*
Parser_Vtbl
,
const
CLSID
*
pClsid
,
PFN_PROCESS_SAMPLE
fnProcessSample
,
PFN_QUERY_ACCEPT
fnQueryAccept
,
PFN_PRE_CONNECT
fnPreConnect
,
PFN_CLEANUP
fnCleanup
,
PFN_DISCONNECT
fnDisconnect
,
REQUESTPROC
fnRequest
,
STOPPROCESSPROC
fnDone
,
CHANGEPROC
stop
,
CHANGEPROC
current
,
CHANGEPROC
rate
)
HRESULT
Parser_Create
(
ParserImpl
*
pParser
,
const
IBaseFilterVtbl
*
Parser_Vtbl
,
const
CLSID
*
pClsid
,
PFN_PROCESS_SAMPLE
fnProcessSample
,
PFN_QUERY_ACCEPT
fnQueryAccept
,
PFN_PRE_CONNECT
fnPreConnect
,
PFN_CLEANUP
fnCleanup
,
PFN_DISCONNECT
fnDisconnect
,
REQUESTPROC
fnRequest
,
STOPPROCESSPROC
fnDone
,
SourceSeeking_ChangeStop
stop
,
SourceSeeking_ChangeStart
start
,
SourceSeeking_ChangeRate
rate
)
{
HRESULT
hr
;
PIN_INFO
piInput
;
...
...
@@ -90,8 +89,8 @@ HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, c
piInput
.
pFilter
=
(
IBaseFilter
*
)
pParser
;
lstrcpynW
(
piInput
.
achName
,
wcsInputPinName
,
sizeof
(
piInput
.
achName
)
/
sizeof
(
piInput
.
achName
[
0
]));
if
(
!
curren
t
)
current
=
Parser_ChangeCurren
t
;
if
(
!
star
t
)
start
=
Parser_ChangeStar
t
;
if
(
!
stop
)
stop
=
Parser_ChangeStop
;
...
...
@@ -99,8 +98,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, c
if
(
!
rate
)
rate
=
Parser_ChangeRate
;
MediaSeekingImpl_Init
((
IBaseFilter
*
)
pParser
,
stop
,
current
,
rate
,
&
pParser
->
mediaSeeking
,
&
pParser
->
filter
.
csFilter
);
pParser
->
mediaSeeking
.
lpVtbl
=
&
Parser_Seeking_Vtbl
;
SourceSeeking_Init
(
&
pParser
->
sourceSeeking
,
&
Parser_Seeking_Vtbl
,
stop
,
start
,
rate
,
&
pParser
->
filter
.
csFilter
);
hr
=
PullPin_Construct
(
&
Parser_InputPin_Vtbl
,
&
piInput
,
fnProcessSample
,
(
LPVOID
)
pParser
,
fnQueryAccept
,
fnCleanup
,
fnRequest
,
fnDone
,
&
pParser
->
filter
.
csFilter
,
(
IPin
**
)
&
pParser
->
pInputPin
);
...
...
@@ -466,19 +464,19 @@ static HRESULT Parser_RemoveOutputPins(ParserImpl * This)
return
S_OK
;
}
static
HRESULT
Parser_ChangeCurrent
(
IBaseFilter
*
iface
)
static
HRESULT
WINAPI
Parser_ChangeStart
(
IMediaSeeking
*
iface
)
{
FIXME
(
"(%p) filter hasn't implemented
curren
t position change!
\n
"
,
iface
);
FIXME
(
"(%p) filter hasn't implemented
star
t position change!
\n
"
,
iface
);
return
S_OK
;
}
static
HRESULT
Parser_ChangeStop
(
IBaseFilter
*
iface
)
static
HRESULT
WINAPI
Parser_ChangeStop
(
IMediaSeeking
*
iface
)
{
FIXME
(
"(%p) filter hasn't implemented stop position change!
\n
"
,
iface
);
return
S_OK
;
}
static
HRESULT
Parser_ChangeRate
(
IBaseFilter
*
iface
)
static
HRESULT
WINAPI
Parser_ChangeRate
(
IMediaSeeking
*
iface
)
{
FIXME
(
"(%p) filter hasn't implemented rate change!
\n
"
,
iface
);
return
S_OK
;
...
...
@@ -511,23 +509,23 @@ static const IMediaSeekingVtbl Parser_Seeking_Vtbl =
Parser_Seeking_QueryInterface
,
Parser_Seeking_AddRef
,
Parser_Seeking_Release
,
Media
SeekingImpl_GetCapabilities
,
Media
SeekingImpl_CheckCapabilities
,
Media
SeekingImpl_IsFormatSupported
,
Media
SeekingImpl_QueryPreferredFormat
,
Media
SeekingImpl_GetTimeFormat
,
Media
SeekingImpl_IsUsingTimeFormat
,
Media
SeekingImpl_SetTimeFormat
,
Media
SeekingImpl_GetDuration
,
Media
SeekingImpl_GetStopPosition
,
Media
SeekingImpl_GetCurrentPosition
,
Media
SeekingImpl_ConvertTimeFormat
,
Media
SeekingImpl_SetPositions
,
Media
SeekingImpl_GetPositions
,
Media
SeekingImpl_GetAvailable
,
Media
SeekingImpl_SetRate
,
Media
SeekingImpl_GetRate
,
Media
SeekingImpl_GetPreroll
Source
SeekingImpl_GetCapabilities
,
Source
SeekingImpl_CheckCapabilities
,
Source
SeekingImpl_IsFormatSupported
,
Source
SeekingImpl_QueryPreferredFormat
,
Source
SeekingImpl_GetTimeFormat
,
Source
SeekingImpl_IsUsingTimeFormat
,
Source
SeekingImpl_SetTimeFormat
,
Source
SeekingImpl_GetDuration
,
Source
SeekingImpl_GetStopPosition
,
Source
SeekingImpl_GetCurrentPosition
,
Source
SeekingImpl_ConvertTimeFormat
,
Source
SeekingImpl_SetPositions
,
Source
SeekingImpl_GetPositions
,
Source
SeekingImpl_GetAvailable
,
Source
SeekingImpl_SetRate
,
Source
SeekingImpl_GetRate
,
Source
SeekingImpl_GetPreroll
};
static
HRESULT
WINAPI
Parser_OutputPin_GetMediaType
(
IPin
*
iface
,
int
iPosition
,
AM_MEDIA_TYPE
*
pmt
)
...
...
dlls/quartz/parser.h
View file @
602d44a1
...
...
@@ -36,7 +36,7 @@ struct ParserImpl
PullPin
*
pInputPin
;
IPin
**
ppPins
;
ULONG
cStreams
;
MediaSeekingImpl
media
Seeking
;
SourceSeeking
source
Seeking
;
};
typedef
struct
Parser_OutputPin
...
...
@@ -50,7 +50,7 @@ typedef struct Parser_OutputPin
extern
HRESULT
Parser_AddPin
(
ParserImpl
*
This
,
const
PIN_INFO
*
piOutput
,
ALLOCATOR_PROPERTIES
*
props
,
const
AM_MEDIA_TYPE
*
amt
);
extern
HRESULT
Parser_Create
(
ParserImpl
*
,
const
IBaseFilterVtbl
*
,
const
CLSID
*
,
PFN_PROCESS_SAMPLE
,
PFN_QUERY_ACCEPT
,
PFN_PRE_CONNECT
,
PFN_CLEANUP
,
PFN_DISCONNECT
,
REQUESTPROC
,
STOPPROCESSPROC
,
CHANGEPROC
stop
,
CHANGEPROC
current
,
CHANGEPROC
rate
);
PFN_CLEANUP
,
PFN_DISCONNECT
,
REQUESTPROC
,
STOPPROCESSPROC
,
SourceSeeking_ChangeStop
stop
,
SourceSeeking_ChangeStart
start
,
SourceSeeking_ChangeRate
rate
);
/* Override the _Release function and call this when releasing */
extern
void
Parser_Destroy
(
ParserImpl
*
This
);
...
...
dlls/quartz/videorenderer.c
View file @
602d44a1
...
...
@@ -82,7 +82,6 @@ typedef struct VideoRendererImpl
BOOL
bUnkOuterValid
;
BOOL
bAggregatable
;
REFERENCE_TIME
rtLastStop
;
MediaSeekingImpl
mediaSeeking
;
LONG
WindowStyle
;
/* During pause we can hold a single sample, for use in GetCurrentImage */
...
...
dlls/quartz/waveparser.c
View file @
602d44a1
...
...
@@ -49,6 +49,11 @@ typedef struct WAVEParserImpl
DWORD
dwLength
;
}
WAVEParserImpl
;
static
inline
WAVEParserImpl
*
impl_from_IMediaSeeking
(
IMediaSeeking
*
iface
)
{
return
(
WAVEParserImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
WAVEParserImpl
,
Parser
.
sourceSeeking
.
lpVtbl
));
}
static
LONGLONG
bytepos_to_duration
(
WAVEParserImpl
*
This
,
LONGLONG
bytepos
)
{
LONGLONG
duration
=
BYTES_FROM_MEDIATIME
(
bytepos
-
This
->
StartOfFile
);
...
...
@@ -140,7 +145,7 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR
This
->
Parser
.
pInputPin
->
rtCurrent
=
tStart
;
}
if
(
tStop
>=
This
->
EndOfFile
||
(
bytepos_to_duration
(
This
,
tStop
)
>=
This
->
Parser
.
media
Seeking
.
llStop
)
||
hr
==
VFW_E_NOT_CONNECTED
)
if
(
tStop
>=
This
->
EndOfFile
||
(
bytepos_to_duration
(
This
,
tStop
)
>=
This
->
Parser
.
source
Seeking
.
llStop
)
||
hr
==
VFW_E_NOT_CONNECTED
)
{
unsigned
int
i
;
...
...
@@ -184,14 +189,14 @@ static HRESULT WAVEParser_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
return
S_FALSE
;
}
static
HRESULT
W
AVEParserImpl_seek
(
IBaseFilter
*
iface
)
static
HRESULT
W
INAPI
WAVEParserImpl_seek
(
IMediaSeeking
*
iface
)
{
WAVEParserImpl
*
This
=
(
WAVEParserImpl
*
)
iface
;
WAVEParserImpl
*
This
=
impl_from_IMediaSeeking
(
iface
)
;
PullPin
*
pPin
=
This
->
Parser
.
pInputPin
;
IPin
*
victim
=
NULL
;
LONGLONG
newpos
,
curpos
,
endpos
,
bytepos
;
newpos
=
This
->
Parser
.
media
Seeking
.
llCurrent
;
newpos
=
This
->
Parser
.
source
Seeking
.
llCurrent
;
curpos
=
bytepos_to_duration
(
This
,
pPin
->
rtCurrent
);
endpos
=
bytepos_to_duration
(
This
,
This
->
EndOfFile
);
bytepos
=
duration_to_bytepos
(
This
,
newpos
);
...
...
@@ -319,9 +324,9 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
hr
=
Parser_AddPin
(
&
(
pWAVEParser
->
Parser
),
&
piOutput
,
props
,
&
amt
);
CoTaskMemFree
(
amt
.
pbFormat
);
pWAVEParser
->
Parser
.
media
Seeking
.
llCurrent
=
0
;
pWAVEParser
->
Parser
.
mediaSeeking
.
llStop
=
pWAVEParser
->
Parser
.
media
Seeking
.
llDuration
=
bytepos_to_duration
(
pWAVEParser
,
pWAVEParser
->
EndOfFile
);
TRACE
(
"Duration: %u seconds
\n
"
,
(
DWORD
)(
pWAVEParser
->
Parser
.
media
Seeking
.
llDuration
/
(
LONGLONG
)
10000000
));
pWAVEParser
->
Parser
.
source
Seeking
.
llCurrent
=
0
;
pWAVEParser
->
Parser
.
sourceSeeking
.
llStop
=
pWAVEParser
->
Parser
.
source
Seeking
.
llDuration
=
bytepos_to_duration
(
pWAVEParser
,
pWAVEParser
->
EndOfFile
);
TRACE
(
"Duration: %u seconds
\n
"
,
(
DWORD
)(
pWAVEParser
->
Parser
.
source
Seeking
.
llDuration
/
(
LONGLONG
)
10000000
));
This
->
rtStop
=
pWAVEParser
->
EndOfFile
;
This
->
rtStart
=
pWAVEParser
->
StartOfFile
;
...
...
dlls/strmbase/Makefile.in
View file @
602d44a1
...
...
@@ -5,6 +5,7 @@ C_SRCS = \
filter.c
\
mediatype.c
\
pin.c
\
seeking.c
\
transform.c
@MAKE_IMPLIB_RULES@
dlls/strmbase/seeking.c
0 → 100644
View file @
602d44a1
/*
* Filter Seeking and Control Interfaces
*
* Copyright 2003 Robert Shearman
* Copyright 2010 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* FIXME: critical sections */
#define COBJMACROS
#include "dshow.h"
#include "wine/strmbase.h"
#include "uuids.h"
#include "wine/debug.h"
#include <assert.h>
WINE_DEFAULT_DEBUG_CHANNEL
(
strmbase
);
HRESULT
SourceSeeking_Init
(
SourceSeeking
*
pSeeking
,
const
IMediaSeekingVtbl
*
Vtbl
,
SourceSeeking_ChangeStop
fnChangeStop
,
SourceSeeking_ChangeStart
fnChangeStart
,
SourceSeeking_ChangeRate
fnChangeRate
,
PCRITICAL_SECTION
crit_sect
)
{
assert
(
fnChangeStop
&&
fnChangeStart
&&
fnChangeRate
);
pSeeking
->
lpVtbl
=
Vtbl
;
pSeeking
->
refCount
=
1
;
pSeeking
->
fnChangeRate
=
fnChangeRate
;
pSeeking
->
fnChangeStop
=
fnChangeStop
;
pSeeking
->
fnChangeStart
=
fnChangeStart
;
pSeeking
->
dwCapabilities
=
AM_SEEKING_CanSeekForwards
|
AM_SEEKING_CanSeekBackwards
|
AM_SEEKING_CanSeekAbsolute
|
AM_SEEKING_CanGetStopPos
|
AM_SEEKING_CanGetDuration
;
pSeeking
->
llCurrent
=
0
;
pSeeking
->
llStop
=
((
ULONGLONG
)
0x80000000
)
<<
32
;
pSeeking
->
llDuration
=
pSeeking
->
llStop
;
pSeeking
->
dRate
=
1
.
0
;
pSeeking
->
timeformat
=
TIME_FORMAT_MEDIA_TIME
;
pSeeking
->
crst
=
crit_sect
;
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pCapabilities
);
*
pCapabilities
=
This
->
dwCapabilities
;
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_CheckCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
HRESULT
hr
;
DWORD
dwCommonCaps
;
TRACE
(
"(%p)
\n
"
,
pCapabilities
);
if
(
!
pCapabilities
)
return
E_POINTER
;
dwCommonCaps
=
*
pCapabilities
&
This
->
dwCapabilities
;
if
(
!
dwCommonCaps
)
hr
=
E_FAIL
;
else
hr
=
(
*
pCapabilities
==
dwCommonCaps
)
?
S_OK
:
S_FALSE
;
*
pCapabilities
=
dwCommonCaps
;
return
hr
;
}
HRESULT
WINAPI
SourceSeekingImpl_IsFormatSupported
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
)
{
TRACE
(
"(%s)
\n
"
,
debugstr_guid
(
pFormat
));
return
(
IsEqualIID
(
pFormat
,
&
TIME_FORMAT_MEDIA_TIME
)
?
S_OK
:
S_FALSE
);
}
HRESULT
WINAPI
SourceSeekingImpl_QueryPreferredFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
)
{
TRACE
(
"(%s)
\n
"
,
debugstr_guid
(
pFormat
));
*
pFormat
=
TIME_FORMAT_MEDIA_TIME
;
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetTimeFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%s)
\n
"
,
debugstr_guid
(
pFormat
));
EnterCriticalSection
(
This
->
crst
);
*
pFormat
=
This
->
timeformat
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_IsUsingTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%s)
\n
"
,
debugstr_guid
(
pFormat
));
EnterCriticalSection
(
This
->
crst
);
if
(
!
IsEqualIID
(
pFormat
,
&
This
->
timeformat
))
hr
=
S_FALSE
;
LeaveCriticalSection
(
This
->
crst
);
return
hr
;
}
HRESULT
WINAPI
SourceSeekingImpl_SetTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"%p %s
\n
"
,
This
,
debugstr_guid
(
pFormat
));
return
(
IsEqualIID
(
pFormat
,
&
TIME_FORMAT_MEDIA_TIME
)
?
S_OK
:
E_INVALIDARG
);
}
HRESULT
WINAPI
SourceSeekingImpl_GetDuration
(
IMediaSeeking
*
iface
,
LONGLONG
*
pDuration
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pDuration
);
EnterCriticalSection
(
This
->
crst
);
*
pDuration
=
This
->
llDuration
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetStopPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pStop
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pStop
);
EnterCriticalSection
(
This
->
crst
);
*
pStop
=
This
->
llStop
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
/* FIXME: Make use of the info the filter should expose */
HRESULT
WINAPI
SourceSeekingImpl_GetCurrentPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
pCurrent
);
EnterCriticalSection
(
This
->
crst
);
*
pCurrent
=
This
->
llCurrent
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_ConvertTimeFormat
(
IMediaSeeking
*
iface
,
LONGLONG
*
pTarget
,
const
GUID
*
pTargetFormat
,
LONGLONG
Source
,
const
GUID
*
pSourceFormat
)
{
if
(
IsEqualIID
(
pTargetFormat
,
&
TIME_FORMAT_MEDIA_TIME
)
&&
IsEqualIID
(
pSourceFormat
,
&
TIME_FORMAT_MEDIA_TIME
))
{
*
pTarget
=
Source
;
return
S_OK
;
}
/* FIXME: clear pTarget? */
return
E_INVALIDARG
;
}
static
inline
LONGLONG
Adjust
(
LONGLONG
value
,
const
LONGLONG
*
pModifier
,
DWORD
dwFlags
)
{
switch
(
dwFlags
&
AM_SEEKING_PositioningBitsMask
)
{
case
AM_SEEKING_NoPositioning
:
return
value
;
case
AM_SEEKING_AbsolutePositioning
:
return
*
pModifier
;
case
AM_SEEKING_RelativePositioning
:
case
AM_SEEKING_IncrementalPositioning
:
return
value
+
*
pModifier
;
default:
assert
(
FALSE
);
return
0
;
}
}
HRESULT
WINAPI
SourceSeekingImpl_SetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
DWORD
dwCurrentFlags
,
LONGLONG
*
pStop
,
DWORD
dwStopFlags
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
BOOL
bChangeCurrent
=
FALSE
,
bChangeStop
=
FALSE
;
LONGLONG
llNewCurrent
,
llNewStop
;
TRACE
(
"(%p, %x, %p, %x)
\n
"
,
pCurrent
,
dwCurrentFlags
,
pStop
,
dwStopFlags
);
EnterCriticalSection
(
This
->
crst
);
llNewCurrent
=
Adjust
(
This
->
llCurrent
,
pCurrent
,
dwCurrentFlags
);
llNewStop
=
Adjust
(
This
->
llStop
,
pStop
,
dwStopFlags
);
if
(
pCurrent
)
bChangeCurrent
=
TRUE
;
if
(
llNewStop
!=
This
->
llStop
)
bChangeStop
=
TRUE
;
TRACE
(
"Old: %u, New: %u
\n
"
,
(
DWORD
)(
This
->
llCurrent
/
10000000
),
(
DWORD
)(
llNewCurrent
/
10000000
));
This
->
llCurrent
=
llNewCurrent
;
This
->
llStop
=
llNewStop
;
if
(
pCurrent
&&
(
dwCurrentFlags
&
AM_SEEKING_ReturnTime
))
*
pCurrent
=
llNewCurrent
;
if
(
pStop
&&
(
dwStopFlags
&
AM_SEEKING_ReturnTime
))
*
pStop
=
llNewStop
;
LeaveCriticalSection
(
This
->
crst
);
if
(
bChangeCurrent
)
This
->
fnChangeStart
(
iface
);
if
(
bChangeStop
)
This
->
fnChangeStop
(
iface
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
LONGLONG
*
pStop
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
pCurrent
,
pStop
);
EnterCriticalSection
(
This
->
crst
);
IMediaSeeking_GetCurrentPosition
(
iface
,
pCurrent
);
IMediaSeeking_GetStopPosition
(
iface
,
pStop
);
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetAvailable
(
IMediaSeeking
*
iface
,
LONGLONG
*
pEarliest
,
LONGLONG
*
pLatest
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
pEarliest
,
pLatest
);
EnterCriticalSection
(
This
->
crst
);
*
pEarliest
=
0
;
*
pLatest
=
This
->
llDuration
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_SetRate
(
IMediaSeeking
*
iface
,
double
dRate
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
BOOL
bChangeRate
=
(
dRate
!=
This
->
dRate
);
HRESULT
hr
=
S_OK
;
TRACE
(
"(%e)
\n
"
,
dRate
);
if
(
dRate
>
100
||
dRate
<
.
001
)
{
FIXME
(
"Excessive rate %e, ignoring
\n
"
,
dRate
);
return
VFW_E_UNSUPPORTED_AUDIO
;
}
EnterCriticalSection
(
This
->
crst
);
This
->
dRate
=
dRate
;
if
(
bChangeRate
)
hr
=
This
->
fnChangeRate
(
iface
);
LeaveCriticalSection
(
This
->
crst
);
return
hr
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetRate
(
IMediaSeeking
*
iface
,
double
*
dRate
)
{
SourceSeeking
*
This
=
(
SourceSeeking
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
dRate
);
EnterCriticalSection
(
This
->
crst
);
/* Forward? */
*
dRate
=
This
->
dRate
;
LeaveCriticalSection
(
This
->
crst
);
return
S_OK
;
}
HRESULT
WINAPI
SourceSeekingImpl_GetPreroll
(
IMediaSeeking
*
iface
,
LONGLONG
*
pPreroll
)
{
TRACE
(
"(%p)
\n
"
,
pPreroll
);
*
pPreroll
=
0
;
return
S_OK
;
}
include/wine/strmbase.h
View file @
602d44a1
...
...
@@ -206,3 +206,43 @@ HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStar
HRESULT
WINAPI
TransformFilterImpl_FindPin
(
IBaseFilter
*
iface
,
LPCWSTR
Id
,
IPin
**
ppPin
);
HRESULT
TransformFilter_Construct
(
const
IBaseFilterVtbl
*
filterVtbl
,
LONG
filter_size
,
const
CLSID
*
pClsid
,
const
TransformFilterFuncTable
*
pFuncsTable
,
IBaseFilter
**
ppTransformFilter
);
/* Source Seeking */
typedef
HRESULT
(
WINAPI
*
SourceSeeking_ChangeRate
)(
IMediaSeeking
*
iface
);
typedef
HRESULT
(
WINAPI
*
SourceSeeking_ChangeStart
)(
IMediaSeeking
*
iface
);
typedef
HRESULT
(
WINAPI
*
SourceSeeking_ChangeStop
)(
IMediaSeeking
*
iface
);
typedef
struct
SourceSeeking
{
const
IMediaSeekingVtbl
*
lpVtbl
;
ULONG
refCount
;
SourceSeeking_ChangeStop
fnChangeStop
;
SourceSeeking_ChangeStart
fnChangeStart
;
SourceSeeking_ChangeRate
fnChangeRate
;
DWORD
dwCapabilities
;
double
dRate
;
LONGLONG
llCurrent
,
llStop
,
llDuration
;
GUID
timeformat
;
PCRITICAL_SECTION
crst
;
}
SourceSeeking
;
HRESULT
SourceSeeking_Init
(
SourceSeeking
*
pSeeking
,
const
IMediaSeekingVtbl
*
Vtbl
,
SourceSeeking_ChangeStop
fnChangeStop
,
SourceSeeking_ChangeStart
fnChangeStart
,
SourceSeeking_ChangeRate
fnChangeRate
,
PCRITICAL_SECTION
crit_sect
);
HRESULT
WINAPI
SourceSeekingImpl_GetCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
);
HRESULT
WINAPI
SourceSeekingImpl_CheckCapabilities
(
IMediaSeeking
*
iface
,
DWORD
*
pCapabilities
);
HRESULT
WINAPI
SourceSeekingImpl_IsFormatSupported
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
);
HRESULT
WINAPI
SourceSeekingImpl_QueryPreferredFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
);
HRESULT
WINAPI
SourceSeekingImpl_GetTimeFormat
(
IMediaSeeking
*
iface
,
GUID
*
pFormat
);
HRESULT
WINAPI
SourceSeekingImpl_IsUsingTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
);
HRESULT
WINAPI
SourceSeekingImpl_SetTimeFormat
(
IMediaSeeking
*
iface
,
const
GUID
*
pFormat
);
HRESULT
WINAPI
SourceSeekingImpl_GetDuration
(
IMediaSeeking
*
iface
,
LONGLONG
*
pDuration
);
HRESULT
WINAPI
SourceSeekingImpl_GetStopPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pStop
);
HRESULT
WINAPI
SourceSeekingImpl_GetCurrentPosition
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
);
HRESULT
WINAPI
SourceSeekingImpl_ConvertTimeFormat
(
IMediaSeeking
*
iface
,
LONGLONG
*
pTarget
,
const
GUID
*
pTargetFormat
,
LONGLONG
Source
,
const
GUID
*
pSourceFormat
);
HRESULT
WINAPI
SourceSeekingImpl_SetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
DWORD
dwCurrentFlags
,
LONGLONG
*
pStop
,
DWORD
dwStopFlags
);
HRESULT
WINAPI
SourceSeekingImpl_GetPositions
(
IMediaSeeking
*
iface
,
LONGLONG
*
pCurrent
,
LONGLONG
*
pStop
);
HRESULT
WINAPI
SourceSeekingImpl_GetAvailable
(
IMediaSeeking
*
iface
,
LONGLONG
*
pEarliest
,
LONGLONG
*
pLatest
);
HRESULT
WINAPI
SourceSeekingImpl_SetRate
(
IMediaSeeking
*
iface
,
double
dRate
);
HRESULT
WINAPI
SourceSeekingImpl_GetRate
(
IMediaSeeking
*
iface
,
double
*
dRate
);
HRESULT
WINAPI
SourceSeekingImpl_GetPreroll
(
IMediaSeeking
*
iface
,
LONGLONG
*
pPreroll
);
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