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
34f3f7ca
Commit
34f3f7ca
authored
Oct 07, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Move TransformFilter implementation to strmbase.
parent
79108708
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
234 additions
and
123 deletions
+234
-123
Makefile.in
dlls/quartz/Makefile.in
+0
-1
acmwrapper.c
dlls/quartz/acmwrapper.c
+97
-33
avidec.c
dlls/quartz/avidec.c
+87
-38
transform.h
dlls/quartz/transform.h
+0
-50
Makefile.in
dlls/strmbase/Makefile.in
+2
-1
transform.c
dlls/strmbase/transform.c
+0
-0
strmbase.h
include/wine/strmbase.h
+48
-0
No files found.
dlls/quartz/Makefile.in
View file @
34f3f7ca
...
@@ -24,7 +24,6 @@ C_SRCS = \
...
@@ -24,7 +24,6 @@ C_SRCS = \
pin.c
\
pin.c
\
regsvr.c
\
regsvr.c
\
systemclock.c
\
systemclock.c
\
transform.c
\
videorenderer.c
\
videorenderer.c
\
waveparser.c
waveparser.c
...
...
dlls/quartz/acmwrapper.c
View file @
34f3f7ca
...
@@ -37,13 +37,13 @@
...
@@ -37,13 +37,13 @@
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "transform.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
quartz
);
WINE_DEFAULT_DEBUG_CHANNEL
(
quartz
);
typedef
struct
ACMWrapperImpl
typedef
struct
ACMWrapperImpl
{
{
TransformFilterImpl
tf
;
TransformFilter
tf
;
IUnknown
*
seekthru_unk
;
HACMSTREAM
has
;
HACMSTREAM
has
;
LPWAVEFORMATEX
pWfIn
;
LPWAVEFORMATEX
pWfIn
;
LPWAVEFORMATEX
pWfOut
;
LPWAVEFORMATEX
pWfOut
;
...
@@ -52,10 +52,11 @@ typedef struct ACMWrapperImpl
...
@@ -52,10 +52,11 @@ typedef struct ACMWrapperImpl
LONGLONG
lasttime_sent
;
LONGLONG
lasttime_sent
;
}
ACMWrapperImpl
;
}
ACMWrapperImpl
;
static
HRESULT
WINAPI
ACMWrapper_ProcessSampleData
(
IPin
*
iface
,
IMediaSample
*
pSample
)
static
const
IBaseFilterVtbl
ACMWrapper_Vtbl
;
static
HRESULT
WINAPI
ACMWrapper_Receive
(
TransformFilter
*
tf
,
IMediaSample
*
pSample
)
{
{
BaseInputPin
*
pin
=
(
BaseInputPin
*
)
iface
;
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
tf
;
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
pin
->
pin
.
pinInfo
.
pFilter
;
AM_MEDIA_TYPE
amt
;
AM_MEDIA_TYPE
amt
;
IMediaSample
*
pOutSample
=
NULL
;
IMediaSample
*
pOutSample
=
NULL
;
DWORD
cbDstStream
,
cbSrcStream
;
DWORD
cbDstStream
,
cbSrcStream
;
...
@@ -68,18 +69,6 @@ static HRESULT WINAPI ACMWrapper_ProcessSampleData(IPin *iface, IMediaSample *pS
...
@@ -68,18 +69,6 @@ static HRESULT WINAPI ACMWrapper_ProcessSampleData(IPin *iface, IMediaSample *pS
LONGLONG
tStart
=
-
1
,
tStop
=
-
1
,
tMed
;
LONGLONG
tStart
=
-
1
,
tStop
=
-
1
,
tMed
;
EnterCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
EnterCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
if
(
This
->
tf
.
filter
.
state
==
State_Stopped
)
{
LeaveCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
return
VFW_E_WRONG_STATE
;
}
if
(
pin
->
end_of_stream
||
pin
->
flushing
)
{
LeaveCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
return
S_FALSE
;
}
hr
=
IMediaSample_GetPointer
(
pSample
,
&
pbSrcStream
);
hr
=
IMediaSample_GetPointer
(
pSample
,
&
pbSrcStream
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
...
@@ -235,12 +224,15 @@ error:
...
@@ -235,12 +224,15 @@ error:
return
hr
;
return
hr
;
}
}
static
HRESULT
ACMWrapper_ConnectInput
(
BaseInputPin
*
pin
,
const
AM_MEDIA_TYPE
*
pmt
)
static
HRESULT
WINAPI
ACMWrapper_SetMediaType
(
TransformFilter
*
tf
,
PIN_DIRECTION
dir
,
const
AM_MEDIA_TYPE
*
pmt
)
{
{
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
pin
->
pin
.
pinInfo
.
pFilter
;
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
tf
;
MMRESULT
res
;
MMRESULT
res
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pmt
);
TRACE
(
"(%p)->(%i %p)
\n
"
,
This
,
dir
,
pmt
);
if
(
dir
!=
PINDIR_INPUT
)
return
S_OK
;
/* Check root (GUID w/o FOURCC) */
/* Check root (GUID w/o FOURCC) */
if
((
IsEqualIID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Audio
))
&&
if
((
IsEqualIID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Audio
))
&&
...
@@ -287,28 +279,62 @@ static HRESULT ACMWrapper_ConnectInput(BaseInputPin *pin, const AM_MEDIA_TYPE *
...
@@ -287,28 +279,62 @@ static HRESULT ACMWrapper_ConnectInput(BaseInputPin *pin, const AM_MEDIA_TYPE *
return
VFW_E_TYPE_NOT_ACCEPTED
;
return
VFW_E_TYPE_NOT_ACCEPTED
;
}
}
static
HRESULT
ACMWrapper_Cleanup
(
BaseInputPin
*
pin
)
static
HRESULT
WINAPI
ACMWrapper_CompleteConnect
(
TransformFilter
*
tf
,
PIN_DIRECTION
dir
,
IPin
*
pin
)
{
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
tf
;
MMRESULT
res
;
HACMSTREAM
drv
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
dir
!=
PINDIR_INPUT
)
return
S_OK
;
if
(
!
(
res
=
acmStreamOpen
(
&
drv
,
NULL
,
This
->
pWfIn
,
This
->
pWfOut
,
NULL
,
0
,
0
,
0
)))
{
This
->
has
=
drv
;
/* Update buffer size of media samples in output */
((
BaseOutputPin
*
)
This
->
tf
.
ppPins
[
1
])
->
allocProps
.
cbBuffer
=
This
->
pWfOut
->
nAvgBytesPerSec
/
2
;
TRACE
(
"Connection accepted
\n
"
);
return
S_OK
;
}
FIXME
(
"acmStreamOpen returned %d
\n
"
,
res
);
TRACE
(
"Unable to find a suitable ACM decompressor
\n
"
);
return
VFW_E_TYPE_NOT_ACCEPTED
;
}
static
HRESULT
WINAPI
ACMWrapper_BreakConnect
(
TransformFilter
*
tf
,
PIN_DIRECTION
dir
)
{
{
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
pin
->
pin
.
pinInfo
.
pFilter
;
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
tf
;
TRACE
(
"(%p)->(
)
\n
"
,
This
);
TRACE
(
"(%p)->(
%i)
\n
"
,
This
,
dir
);
if
(
dir
==
PINDIR_INPUT
)
{
if
(
This
->
has
)
if
(
This
->
has
)
acmStreamClose
(
This
->
has
,
0
);
acmStreamClose
(
This
->
has
,
0
);
This
->
has
=
0
;
This
->
has
=
0
;
This
->
lasttime_real
=
This
->
lasttime_sent
=
-
1
;
This
->
lasttime_real
=
This
->
lasttime_sent
=
-
1
;
}
return
S_OK
;
return
S_OK
;
}
}
static
const
TransformFuncsTable
ACMWrapper_FuncsTable
=
{
static
const
TransformFilterFuncTable
ACMWrapper_FuncsTable
=
{
NULL
,
ACMWrapper_Receive
,
NULL
,
NULL
,
NULL
,
ACMWrapper_ProcessSampleData
,
ACMWrapper_SetMediaType
,
ACMWrapper_CompleteConnect
,
ACMWrapper_BreakConnect
,
NULL
,
NULL
,
NULL
,
NULL
,
ACMWrapper_ConnectInput
,
NULL
,
ACMWrapper_Cleanup
NULL
};
};
HRESULT
ACMWrapper_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppv
)
HRESULT
ACMWrapper_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppv
)
...
@@ -323,17 +349,55 @@ HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv)
...
@@ -323,17 +349,55 @@ HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv)
if
(
pUnkOuter
)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
return
CLASS_E_NOAGGREGATION
;
/* Note: This memory is managed by the transform filter once created */
hr
=
TransformFilter_Construct
(
&
ACMWrapper_Vtbl
,
sizeof
(
ACMWrapperImpl
),
&
CLSID_ACMWrapper
,
&
ACMWrapper_FuncsTable
,
(
IBaseFilter
**
)
&
This
);
This
=
CoTaskMemAlloc
(
sizeof
(
ACMWrapperImpl
));
ZeroMemory
(
This
,
sizeof
(
ACMWrapperImpl
));
hr
=
TransformFilter_Create
(
&
(
This
->
tf
),
&
CLSID_ACMWrapper
,
&
ACMWrapper_FuncsTable
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
return
hr
;
return
hr
;
else
{
ISeekingPassThru
*
passthru
;
hr
=
CoCreateInstance
(
&
CLSID_SeekingPassThru
,
(
IUnknown
*
)
This
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
This
->
seekthru_unk
);
IUnknown_QueryInterface
(
This
->
seekthru_unk
,
&
IID_ISeekingPassThru
,
(
void
**
)
&
passthru
);
ISeekingPassThru_Init
(
passthru
,
FALSE
,
(
IPin
*
)
This
->
tf
.
ppPins
[
0
]);
ISeekingPassThru_Release
(
passthru
);
}
*
ppv
=
This
;
*
ppv
=
This
;
This
->
lasttime_real
=
This
->
lasttime_sent
=
-
1
;
This
->
lasttime_real
=
This
->
lasttime_sent
=
-
1
;
return
hr
;
return
hr
;
}
}
HRESULT
WINAPI
ACMWrapper_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
HRESULT
hr
;
ACMWrapperImpl
*
This
=
(
ACMWrapperImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%s, %p)
\n
"
,
This
,
iface
,
qzdebugstr_guid
(
riid
),
ppv
);
if
(
IsEqualIID
(
riid
,
&
IID_IMediaSeeking
))
return
IUnknown_QueryInterface
(
This
->
seekthru_unk
,
riid
,
ppv
);
hr
=
TransformFilterImpl_QueryInterface
(
iface
,
riid
,
ppv
);
return
hr
;
}
static
const
IBaseFilterVtbl
ACMWrapper_Vtbl
=
{
ACMWrapper_QueryInterface
,
BaseFilterImpl_AddRef
,
TransformFilterImpl_Release
,
BaseFilterImpl_GetClassID
,
TransformFilterImpl_Stop
,
TransformFilterImpl_Pause
,
TransformFilterImpl_Run
,
BaseFilterImpl_GetState
,
BaseFilterImpl_SetSyncSource
,
BaseFilterImpl_GetSyncSource
,
BaseFilterImpl_EnumPins
,
TransformFilterImpl_FindPin
,
BaseFilterImpl_QueryFilterInfo
,
BaseFilterImpl_JoinFilterGraph
,
BaseFilterImpl_QueryVendorInfo
};
dlls/quartz/avidec.c
View file @
34f3f7ca
...
@@ -38,19 +38,21 @@
...
@@ -38,19 +38,21 @@
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "transform.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
quartz
);
WINE_DEFAULT_DEBUG_CHANNEL
(
quartz
);
typedef
struct
AVIDecImpl
typedef
struct
AVIDecImpl
{
{
TransformFilterImpl
tf
;
TransformFilter
tf
;
IUnknown
*
seekthru_unk
;
HIC
hvid
;
HIC
hvid
;
BITMAPINFOHEADER
*
pBihIn
;
BITMAPINFOHEADER
*
pBihIn
;
BITMAPINFOHEADER
*
pBihOut
;
BITMAPINFOHEADER
*
pBihOut
;
}
AVIDecImpl
;
}
AVIDecImpl
;
static
HRESULT
AVIDec_ProcessBegin
(
TransformFilterImpl
*
pTransformFilter
)
static
const
IBaseFilterVtbl
AVIDec_Vtbl
;
static
HRESULT
WINAPI
AVIDec_StartStreaming
(
TransformFilter
*
pTransformFilter
)
{
{
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pTransformFilter
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pTransformFilter
;
DWORD
result
;
DWORD
result
;
...
@@ -66,10 +68,9 @@ static HRESULT AVIDec_ProcessBegin(TransformFilterImpl* pTransformFilter)
...
@@ -66,10 +68,9 @@ static HRESULT AVIDec_ProcessBegin(TransformFilterImpl* pTransformFilter)
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
AVIDec_
ProcessSampleData
(
IPin
*
iface
,
IMediaSample
*
pSample
)
static
HRESULT
WINAPI
AVIDec_
Receive
(
TransformFilter
*
tf
,
IMediaSample
*
pSample
)
{
{
BaseInputPin
*
pin
=
(
BaseInputPin
*
)
iface
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
tf
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pin
->
pin
.
pinInfo
.
pFilter
;
AM_MEDIA_TYPE
amt
;
AM_MEDIA_TYPE
amt
;
HRESULT
hr
;
HRESULT
hr
;
DWORD
res
;
DWORD
res
;
...
@@ -81,18 +82,6 @@ static HRESULT WINAPI AVIDec_ProcessSampleData(IPin *iface, IMediaSample *pSampl
...
@@ -81,18 +82,6 @@ static HRESULT WINAPI AVIDec_ProcessSampleData(IPin *iface, IMediaSample *pSampl
LONGLONG
tStart
,
tStop
;
LONGLONG
tStart
,
tStop
;
EnterCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
EnterCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
if
(
This
->
tf
.
filter
.
state
==
State_Stopped
)
{
LeaveCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
return
VFW_E_WRONG_STATE
;
}
if
(
pin
->
end_of_stream
||
pin
->
flushing
)
{
LeaveCriticalSection
(
&
This
->
tf
.
filter
.
csFilter
);
return
S_FALSE
;
}
hr
=
IMediaSample_GetPointer
(
pSample
,
&
pbSrcStream
);
hr
=
IMediaSample_GetPointer
(
pSample
,
&
pbSrcStream
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
...
@@ -164,7 +153,7 @@ error:
...
@@ -164,7 +153,7 @@ error:
return
hr
;
return
hr
;
}
}
static
HRESULT
AVIDec_ProcessEnd
(
TransformFilterImpl
*
pTransformFilter
)
static
HRESULT
WINAPI
AVIDec_StopStreaming
(
TransformFilter
*
pTransformFilter
)
{
{
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pTransformFilter
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pTransformFilter
;
DWORD
result
;
DWORD
result
;
...
@@ -183,13 +172,16 @@ static HRESULT AVIDec_ProcessEnd(TransformFilterImpl* pTransformFilter)
...
@@ -183,13 +172,16 @@ static HRESULT AVIDec_ProcessEnd(TransformFilterImpl* pTransformFilter)
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
AVIDec_ConnectInput
(
BaseInputPin
*
pin
,
const
AM_MEDIA_TYPE
*
pmt
)
static
HRESULT
WINAPI
AVIDec_SetMediaType
(
TransformFilter
*
tf
,
PIN_DIRECTION
dir
,
const
AM_MEDIA_TYPE
*
pmt
)
{
{
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pin
->
pin
.
pinInfo
.
pFilter
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
tf
;
HRESULT
hr
=
VFW_E_TYPE_NOT_ACCEPTED
;
HRESULT
hr
=
VFW_E_TYPE_NOT_ACCEPTED
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pmt
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pmt
);
if
(
dir
!=
PINDIR_INPUT
)
return
S_OK
;
/* Check root (GUID w/o FOURCC) */
/* Check root (GUID w/o FOURCC) */
if
((
IsEqualIID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Video
))
&&
if
((
IsEqualIID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Video
))
&&
(
!
memcmp
(((
const
char
*
)
&
pmt
->
subtype
)
+
4
,
((
const
char
*
)
&
MEDIATYPE_Video
)
+
4
,
sizeof
(
GUID
)
-
4
)))
(
!
memcmp
(((
const
char
*
)
&
pmt
->
subtype
)
+
4
,
((
const
char
*
)
&
MEDIATYPE_Video
)
+
4
,
sizeof
(
GUID
)
-
4
)))
...
@@ -269,9 +261,6 @@ static HRESULT AVIDec_ConnectInput(BaseInputPin *pin, const AM_MEDIA_TYPE * pmt)
...
@@ -269,9 +261,6 @@ static HRESULT AVIDec_ConnectInput(BaseInputPin *pin, const AM_MEDIA_TYPE * pmt)
else
else
assert
(
0
);
assert
(
0
);
/* Update buffer size of media samples in output */
((
BaseOutputPin
*
)
This
->
tf
.
ppPins
[
1
])
->
allocProps
.
cbBuffer
=
This
->
pBihOut
->
biSizeImage
;
TRACE
(
"Connection accepted
\n
"
);
TRACE
(
"Connection accepted
\n
"
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -284,12 +273,28 @@ failed:
...
@@ -284,12 +273,28 @@ failed:
return
hr
;
return
hr
;
}
}
static
HRESULT
AVIDec_Cleanup
(
BaseInputPin
*
pin
)
static
HRESULT
WINAPI
AVIDec_CompleteConnect
(
TransformFilter
*
tf
,
PIN_DIRECTION
dir
,
IPin
*
pin
)
{
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
tf
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
dir
==
PINDIR_INPUT
)
{
/* Update buffer size of media samples in output */
((
BaseOutputPin
*
)
This
->
tf
.
ppPins
[
1
])
->
allocProps
.
cbBuffer
=
This
->
pBihOut
->
biSizeImage
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
AVIDec_BreakConnect
(
TransformFilter
*
tf
,
PIN_DIRECTION
dir
)
{
{
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
pin
->
pin
.
pinInfo
.
pFilter
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
tf
;
TRACE
(
"(%p)->()
\n
"
,
This
);
TRACE
(
"(%p)->()
\n
"
,
This
);
if
(
dir
==
PINDIR_INPUT
)
{
if
(
This
->
hvid
)
if
(
This
->
hvid
)
ICClose
(
This
->
hvid
);
ICClose
(
This
->
hvid
);
if
(
This
->
pBihIn
)
if
(
This
->
pBihIn
)
...
@@ -300,17 +305,23 @@ static HRESULT AVIDec_Cleanup(BaseInputPin *pin)
...
@@ -300,17 +305,23 @@ static HRESULT AVIDec_Cleanup(BaseInputPin *pin)
This
->
hvid
=
NULL
;
This
->
hvid
=
NULL
;
This
->
pBihIn
=
NULL
;
This
->
pBihIn
=
NULL
;
This
->
pBihOut
=
NULL
;
This
->
pBihOut
=
NULL
;
}
return
S_OK
;
return
S_OK
;
}
}
static
const
TransformFuncsTable
AVIDec_FuncsTable
=
{
static
const
TransformFilterFuncTable
AVIDec_FuncsTable
=
{
AVIDec_ProcessBegin
,
AVIDec_StartStreaming
,
AVIDec_ProcessSampleData
,
AVIDec_Receive
,
AVIDec_ProcessEnd
,
AVIDec_StopStreaming
,
NULL
,
AVIDec_SetMediaType
,
AVIDec_CompleteConnect
,
AVIDec_BreakConnect
,
NULL
,
NULL
,
NULL
,
AVIDec_ConnectInput
,
NULL
,
AVIDec_Cleanup
NULL
};
};
HRESULT
AVIDec_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppv
)
HRESULT
AVIDec_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppv
)
...
@@ -325,19 +336,57 @@ HRESULT AVIDec_create(IUnknown * pUnkOuter, LPVOID * ppv)
...
@@ -325,19 +336,57 @@ HRESULT AVIDec_create(IUnknown * pUnkOuter, LPVOID * ppv)
if
(
pUnkOuter
)
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
return
CLASS_E_NOAGGREGATION
;
/* Note: This memory is managed by the transform filter once created */
hr
=
TransformFilter_Construct
(
&
AVIDec_Vtbl
,
sizeof
(
AVIDecImpl
),
&
CLSID_AVIDec
,
&
AVIDec_FuncsTable
,
(
IBaseFilter
**
)
&
This
);
This
=
CoTaskMemAlloc
(
sizeof
(
AVIDecImpl
));
if
(
FAILED
(
hr
))
return
hr
;
else
{
ISeekingPassThru
*
passthru
;
hr
=
CoCreateInstance
(
&
CLSID_SeekingPassThru
,
(
IUnknown
*
)
This
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
This
->
seekthru_unk
);
IUnknown_QueryInterface
(
This
->
seekthru_unk
,
&
IID_ISeekingPassThru
,
(
void
**
)
&
passthru
);
ISeekingPassThru_Init
(
passthru
,
FALSE
,
(
IPin
*
)
This
->
tf
.
ppPins
[
0
]);
ISeekingPassThru_Release
(
passthru
);
}
This
->
hvid
=
NULL
;
This
->
hvid
=
NULL
;
This
->
pBihIn
=
NULL
;
This
->
pBihIn
=
NULL
;
This
->
pBihOut
=
NULL
;
This
->
pBihOut
=
NULL
;
hr
=
TransformFilter_Create
(
&
(
This
->
tf
),
&
CLSID_AVIDec
,
&
AVIDec_FuncsTable
)
;
*
ppv
=
This
;
if
(
FAILED
(
hr
))
return
hr
;
return
hr
;
}
*
ppv
=
This
;
HRESULT
WINAPI
AVIDec_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
HRESULT
hr
;
AVIDecImpl
*
This
=
(
AVIDecImpl
*
)
iface
;
TRACE
(
"(%p/%p)->(%s, %p)
\n
"
,
This
,
iface
,
qzdebugstr_guid
(
riid
),
ppv
);
if
(
IsEqualIID
(
riid
,
&
IID_IMediaSeeking
))
return
IUnknown_QueryInterface
(
This
->
seekthru_unk
,
riid
,
ppv
);
hr
=
TransformFilterImpl_QueryInterface
(
iface
,
riid
,
ppv
);
return
hr
;
return
hr
;
}
}
static
const
IBaseFilterVtbl
AVIDec_Vtbl
=
{
AVIDec_QueryInterface
,
BaseFilterImpl_AddRef
,
TransformFilterImpl_Release
,
BaseFilterImpl_GetClassID
,
TransformFilterImpl_Stop
,
TransformFilterImpl_Pause
,
TransformFilterImpl_Run
,
BaseFilterImpl_GetState
,
BaseFilterImpl_SetSyncSource
,
BaseFilterImpl_GetSyncSource
,
BaseFilterImpl_EnumPins
,
TransformFilterImpl_FindPin
,
BaseFilterImpl_QueryFilterInfo
,
BaseFilterImpl_JoinFilterGraph
,
BaseFilterImpl_QueryVendorInfo
};
dlls/quartz/transform.h
deleted
100644 → 0
View file @
79108708
/*
* Transform Filter declarations
*
* Copyright 2005 Christian Costa
*
* 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
*/
#include "control_private.h"
typedef
struct
TransformFilterImpl
TransformFilterImpl
;
typedef
struct
TransformFuncsTable
{
HRESULT
(
*
pfnProcessBegin
)
(
TransformFilterImpl
*
This
);
BaseInputPin_Receive
pfnProcessSampleData
;
HRESULT
(
*
pfnProcessEnd
)
(
TransformFilterImpl
*
This
);
HRESULT
(
*
pfnQueryConnect
)
(
TransformFilterImpl
*
This
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
(
*
pfnConnectInput
)
(
BaseInputPin
*
pin
,
const
AM_MEDIA_TYPE
*
pmt
);
HRESULT
(
*
pfnCleanup
)
(
BaseInputPin
*
pin
);
HRESULT
(
*
pfnEndOfStream
)
(
BaseInputPin
*
pin
);
HRESULT
(
*
pfnBeginFlush
)
(
BaseInputPin
*
pin
);
HRESULT
(
*
pfnEndFlush
)
(
BaseInputPin
*
pin
);
HRESULT
(
*
pfnNewSegment
)
(
BaseInputPin
*
pin
,
REFERENCE_TIME
tStart
,
REFERENCE_TIME
tStop
,
double
dRate
);
}
TransformFuncsTable
;
struct
TransformFilterImpl
{
BaseFilter
filter
;
IUnknown
*
seekthru_unk
;
IPin
**
ppPins
;
ULONG
npins
;
AM_MEDIA_TYPE
pmt
;
const
TransformFuncsTable
*
pFuncsTable
;
};
HRESULT
TransformFilter_Create
(
TransformFilterImpl
*
,
const
CLSID
*
,
const
TransformFuncsTable
*
pFuncsTable
);
dlls/strmbase/Makefile.in
View file @
34f3f7ca
...
@@ -4,6 +4,7 @@ C_SRCS = \
...
@@ -4,6 +4,7 @@ C_SRCS = \
enumpins.c
\
enumpins.c
\
filter.c
\
filter.c
\
mediatype.c
\
mediatype.c
\
pin.c
pin.c
\
transform.c
@MAKE_IMPLIB_RULES@
@MAKE_IMPLIB_RULES@
dlls/
quartz
/transform.c
→
dlls/
strmbase
/transform.c
View file @
34f3f7ca
This diff is collapsed.
Click to expand it.
include/wine/strmbase.h
View file @
34f3f7ca
...
@@ -158,3 +158,51 @@ LONG WINAPI BaseFilterImpl_GetPinVersion(IBaseFilter* This);
...
@@ -158,3 +158,51 @@ LONG WINAPI BaseFilterImpl_GetPinVersion(IBaseFilter* This);
VOID
WINAPI
BaseFilterImpl_IncrementPinVersion
(
IBaseFilter
*
This
);
VOID
WINAPI
BaseFilterImpl_IncrementPinVersion
(
IBaseFilter
*
This
);
HRESULT
WINAPI
BaseFilter_Init
(
BaseFilter
*
This
,
const
IBaseFilterVtbl
*
Vtbl
,
const
CLSID
*
pClsid
,
DWORD_PTR
DebugInfo
,
BaseFilter_GetPin
pfGetPin
,
BaseFilter_GetPinCount
pfGetPinCount
);
HRESULT
WINAPI
BaseFilter_Init
(
BaseFilter
*
This
,
const
IBaseFilterVtbl
*
Vtbl
,
const
CLSID
*
pClsid
,
DWORD_PTR
DebugInfo
,
BaseFilter_GetPin
pfGetPin
,
BaseFilter_GetPinCount
pfGetPinCount
);
/* Transform Filter */
typedef
struct
TransformFilter
{
BaseFilter
filter
;
IPin
**
ppPins
;
ULONG
npins
;
AM_MEDIA_TYPE
pmt
;
const
struct
TransformFilterFuncTable
*
pFuncsTable
;
}
TransformFilter
;
typedef
HRESULT
(
WINAPI
*
TransformFilter_StartStreaming
)
(
TransformFilter
*
iface
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_StopStreaming
)
(
TransformFilter
*
iface
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_Receive
)
(
TransformFilter
*
iface
,
IMediaSample
*
pIn
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_CompleteConnect
)
(
TransformFilter
*
iface
,
PIN_DIRECTION
dir
,
IPin
*
pPin
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_BreakConnect
)
(
TransformFilter
*
iface
,
PIN_DIRECTION
dir
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_SetMediaType
)
(
TransformFilter
*
iface
,
PIN_DIRECTION
dir
,
const
AM_MEDIA_TYPE
*
pMediaType
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_CheckInputType
)
(
TransformFilter
*
iface
,
const
AM_MEDIA_TYPE
*
pMediaType
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_EndOfStream
)
(
TransformFilter
*
iface
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_BeginFlush
)
(
TransformFilter
*
iface
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_EndFlush
)
(
TransformFilter
*
iface
);
typedef
HRESULT
(
WINAPI
*
TransformFilter_NewSegment
)
(
TransformFilter
*
iface
,
REFERENCE_TIME
tStart
,
REFERENCE_TIME
tStop
,
double
dRate
);
typedef
struct
TransformFilterFuncTable
{
TransformFilter_StartStreaming
pfnStartStreaming
;
TransformFilter_Receive
pfnReceive
;
TransformFilter_StopStreaming
pfnStopStreaming
;
TransformFilter_CheckInputType
pfnCheckInputType
;
TransformFilter_SetMediaType
pfnSetMediaType
;
TransformFilter_CompleteConnect
pfnCompleteConnect
;
TransformFilter_BreakConnect
pfnBreakConnect
;
TransformFilter_EndOfStream
pfnEndOfStream
;
TransformFilter_BeginFlush
pfnBeginFlush
;
TransformFilter_EndFlush
pfnEndFlush
;
TransformFilter_NewSegment
pfnNewSegment
;
}
TransformFilterFuncTable
;
HRESULT
WINAPI
TransformFilterImpl_QueryInterface
(
IBaseFilter
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
);
ULONG
WINAPI
TransformFilterImpl_Release
(
IBaseFilter
*
iface
);
HRESULT
WINAPI
TransformFilterImpl_Stop
(
IBaseFilter
*
iface
);
HRESULT
WINAPI
TransformFilterImpl_Pause
(
IBaseFilter
*
iface
);
HRESULT
WINAPI
TransformFilterImpl_Run
(
IBaseFilter
*
iface
,
REFERENCE_TIME
tStart
);
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
);
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