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
60bf76db
Commit
60bf76db
authored
Oct 13, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Remove non-standard custom allocator logic from strmbase.
Implement function overrides for parser.c where a custom allocator was needed.
parent
7602829c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
49 deletions
+74
-49
vfwcapture.c
dlls/qcap/vfwcapture.c
+3
-1
filesource.c
dlls/quartz/filesource.c
+3
-1
parser.c
dlls/quartz/parser.c
+42
-4
parser.h
dlls/quartz/parser.h
+3
-0
pin.c
dlls/strmbase/pin.c
+14
-37
transform.c
dlls/strmbase/transform.c
+3
-1
strmbase.h
include/wine/strmbase.h
+6
-5
No files found.
dlls/qcap/vfwcapture.c
View file @
60bf76db
...
...
@@ -698,7 +698,9 @@ static const BasePinFuncTable output_BaseFuncTable = {
};
static
const
BaseOutputPinFuncTable
output_BaseOutputFuncTable
=
{
VfwPin_DecideBufferSize
VfwPin_DecideBufferSize
,
BaseOutputPinImpl_DecideAllocator
,
BaseOutputPinImpl_BreakConnect
};
static
HRESULT
...
...
dlls/quartz/filesource.c
View file @
60bf76db
...
...
@@ -838,7 +838,9 @@ static const BasePinFuncTable output_BaseFuncTable = {
};
static
const
BaseOutputPinFuncTable
output_BaseOutputFuncTable
=
{
FileAsyncReaderPin_DecideBufferSize
FileAsyncReaderPin_DecideBufferSize
,
BaseOutputPinImpl_DecideAllocator
,
BaseOutputPinImpl_BreakConnect
};
static
HRESULT
FileAsyncReader_Construct
(
HANDLE
hFile
,
IBaseFilter
*
pBaseFilter
,
LPCRITICAL_SECTION
pCritSec
,
IPin
**
ppPin
)
...
...
dlls/quartz/parser.c
View file @
60bf76db
...
...
@@ -45,6 +45,8 @@ static HRESULT WINAPI Parser_ChangeStop(IMediaSeeking *iface);
static
HRESULT
WINAPI
Parser_ChangeRate
(
IMediaSeeking
*
iface
);
static
HRESULT
WINAPI
Parser_OutputPin_DecideBufferSize
(
BaseOutputPin
*
iface
,
IMemAllocator
*
pAlloc
,
ALLOCATOR_PROPERTIES
*
ppropInputRequest
);
static
HRESULT
WINAPI
Parser_OutputPin_GetMediaType
(
BasePin
*
iface
,
int
iPosition
,
AM_MEDIA_TYPE
*
pmt
);
static
HRESULT
WINAPI
Parser_OutputPin_DecideAllocator
(
BaseOutputPin
*
This
,
IMemInputPin
*
pPin
,
IMemAllocator
**
pAlloc
);
static
HRESULT
WINAPI
Parser_OutputPin_BreakConnect
(
BaseOutputPin
*
This
);
static
inline
ParserImpl
*
impl_from_IMediaSeeking
(
IMediaSeeking
*
iface
)
{
...
...
@@ -416,7 +418,9 @@ static const BasePinFuncTable output_BaseFuncTable = {
};
static
const
BaseOutputPinFuncTable
output_BaseOutputFuncTable
=
{
Parser_OutputPin_DecideBufferSize
Parser_OutputPin_DecideBufferSize
,
Parser_OutputPin_DecideAllocator
,
Parser_OutputPin_BreakConnect
};
HRESULT
Parser_AddPin
(
ParserImpl
*
This
,
const
PIN_INFO
*
piOutput
,
ALLOCATOR_PROPERTIES
*
props
,
const
AM_MEDIA_TYPE
*
amt
)
...
...
@@ -440,7 +444,6 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR
pin
->
dwSamplesProcessed
=
0
;
pin
->
pin
.
pin
.
pinInfo
.
pFilter
=
(
LPVOID
)
This
;
pin
->
pin
.
custom_allocator
=
1
;
pin
->
allocProps
=
*
props
;
This
->
cStreams
++
;
BaseFilterImpl_IncrementPinVersion
((
BaseFilter
*
)
This
);
...
...
@@ -471,7 +474,7 @@ static HRESULT Parser_RemoveOutputPins(ParserImpl * This)
for
(
i
=
0
;
i
<
This
->
cStreams
;
i
++
)
{
hr
=
BaseOutputPinImpl_
BreakConnect
((
BaseOutputPin
*
)
ppOldPins
[
i
+
1
]);
hr
=
((
BaseOutputPin
*
)
ppOldPins
[
i
+
1
])
->
pFuncsTable
->
pfn
BreakConnect
((
BaseOutputPin
*
)
ppOldPins
[
i
+
1
]);
TRACE
(
"Disconnect: %08x
\n
"
,
hr
);
IPin_Release
(
ppOldPins
[
i
+
1
]);
}
...
...
@@ -575,6 +578,41 @@ static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPositio
return
S_OK
;
}
static
HRESULT
WINAPI
Parser_OutputPin_DecideAllocator
(
BaseOutputPin
*
iface
,
IMemInputPin
*
pPin
,
IMemAllocator
**
pAlloc
)
{
Parser_OutputPin
*
This
=
(
Parser_OutputPin
*
)
iface
;
HRESULT
hr
;
pAlloc
=
NULL
;
if
(
This
->
alloc
)
hr
=
IMemInputPin_NotifyAllocator
(
pPin
,
This
->
alloc
,
This
->
readonly
);
else
hr
=
VFW_E_NO_ALLOCATOR
;
return
hr
;
}
static
HRESULT
WINAPI
Parser_OutputPin_BreakConnect
(
BaseOutputPin
*
This
)
{
HRESULT
hr
;
TRACE
(
"(%p)->()
\n
"
,
This
);
EnterCriticalSection
(
This
->
pin
.
pCritSec
);
if
(
!
This
->
pin
.
pConnectedTo
||
!
This
->
pMemInputPin
)
hr
=
VFW_E_NOT_CONNECTED
;
else
{
hr
=
IPin_Disconnect
(
This
->
pin
.
pConnectedTo
);
IPin_Disconnect
((
IPin
*
)
This
);
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
return
hr
;
}
static
HRESULT
WINAPI
Parser_OutputPin_QueryInterface
(
IPin
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
Parser_OutputPin
*
This
=
(
Parser_OutputPin
*
)
iface
;
...
...
@@ -628,7 +666,7 @@ static HRESULT WINAPI Parser_OutputPin_Connect(IPin * iface, IPin * pReceivePin,
/* Set the allocator to our input pin's */
EnterCriticalSection
(
This
->
pin
.
pin
.
pCritSec
);
This
->
pin
.
alloc
=
parser
->
pInputPin
->
pAlloc
;
This
->
alloc
=
parser
->
pInputPin
->
pAlloc
;
LeaveCriticalSection
(
This
->
pin
.
pin
.
pCritSec
);
return
BaseOutputPinImpl_Connect
(
iface
,
pReceivePin
,
pmt
);
...
...
dlls/quartz/parser.h
View file @
60bf76db
...
...
@@ -46,6 +46,9 @@ typedef struct Parser_OutputPin
AM_MEDIA_TYPE
*
pmt
;
LONGLONG
dwSamplesProcessed
;
ALLOCATOR_PROPERTIES
allocProps
;
IMemAllocator
*
alloc
;
BOOL
readonly
;
}
Parser_OutputPin
;
extern
HRESULT
Parser_AddPin
(
ParserImpl
*
This
,
const
PIN_INFO
*
piOutput
,
ALLOCATOR_PROPERTIES
*
props
,
const
AM_MEDIA_TYPE
*
amt
);
...
...
dlls/strmbase/pin.c
View file @
60bf76db
...
...
@@ -695,7 +695,7 @@ HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This)
{
if
(
!
This
->
pin
.
pConnectedTo
||
!
This
->
pMemInputPin
)
hr
=
VFW_E_NOT_CONNECTED
;
else
if
(
!
This
->
custom_allocator
)
else
{
IMemAllocator
*
pAlloc
=
NULL
;
...
...
@@ -710,10 +710,6 @@ HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This)
if
(
SUCCEEDED
(
hr
))
hr
=
IPin_Disconnect
(
This
->
pin
.
pConnectedTo
);
}
else
/* Kill the allocator! */
{
hr
=
IPin_Disconnect
(
This
->
pin
.
pConnectedTo
);
}
IPin_Disconnect
((
IPin
*
)
This
);
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
...
...
@@ -730,36 +726,24 @@ HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputP
{
HRESULT
hr
;
if
(
!
This
->
custom_allocator
)
{
hr
=
IMemInputPin_GetAllocator
(
pPin
,
pAlloc
);
if
(
hr
==
VFW_E_NO_ALLOCATOR
)
/* Input pin provides no allocator, use standard memory allocator */
hr
=
BaseOutputPinImpl_InitAllocator
(
This
,
pAlloc
);
hr
=
IMemInputPin_GetAllocator
(
pPin
,
pAlloc
);
if
(
SUCCEEDED
(
hr
))
{
ALLOCATOR_PROPERTIES
rProps
;
ZeroMemory
(
&
rProps
,
sizeof
(
ALLOCATOR_PROPERTIES
));
IMemInputPin_GetAllocatorRequirements
(
pPin
,
&
rProps
);
hr
=
This
->
pFuncsTable
->
pfnDecideBufferSize
(
This
,
*
pAlloc
,
&
rProps
);
}
if
(
hr
==
VFW_E_NO_ALLOCATOR
)
/* Input pin provides no allocator, use standard memory allocator */
hr
=
BaseOutputPinImpl_InitAllocator
(
This
,
pAlloc
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemInputPin_NotifyAllocator
(
pPin
,
*
pAlloc
,
This
->
readonly
);
}
else
if
(
SUCCEEDED
(
hr
))
{
pAlloc
=
NULL
;
ALLOCATOR_PROPERTIES
rProps
;
ZeroMemory
(
&
rProps
,
sizeof
(
ALLOCATOR_PROPERTIES
));
if
(
This
->
alloc
)
hr
=
IMemInputPin_NotifyAllocator
(
pPin
,
This
->
alloc
,
This
->
readonly
);
else
hr
=
VFW_E_NO_ALLOCATOR
;
IMemInputPin_GetAllocatorRequirements
(
pPin
,
&
rProps
);
hr
=
This
->
pFuncsTable
->
pfnDecideBufferSize
(
This
,
*
pAlloc
,
&
rProps
);
}
if
(
SUCCEEDED
(
hr
))
hr
=
IMemInputPin_NotifyAllocator
(
pPin
,
*
pAlloc
,
FALSE
);
return
hr
;
}
...
...
@@ -793,7 +777,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin* iface, IPin * pRecei
if
(
SUCCEEDED
(
hr
))
{
hr
=
BaseOutputPinImpl_
DecideAllocator
(
This
,
This
->
pMemInputPin
,
&
pMemAlloc
);
hr
=
This
->
pFuncsTable
->
pfn
DecideAllocator
(
This
,
This
->
pMemInputPin
,
&
pMemAlloc
);
if
(
pMemAlloc
)
IMemAllocator_Release
(
pMemAlloc
);
}
...
...
@@ -837,13 +821,6 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p
pPinImpl
->
pMemInputPin
=
NULL
;
pPinImpl
->
pFuncsTable
=
pBaseOutputFuncsTable
;
/* If custom_allocator is set, you will need to specify an allocator
* in the alloc member of the struct before an output pin can connect
*/
pPinImpl
->
custom_allocator
=
0
;
pPinImpl
->
alloc
=
NULL
;
pPinImpl
->
readonly
=
FALSE
;
return
S_OK
;
}
...
...
dlls/strmbase/transform.c
View file @
60bf76db
...
...
@@ -162,7 +162,9 @@ static const BasePinFuncTable tf_output_BaseFuncTable = {
};
static
const
BaseOutputPinFuncTable
tf_output_BaseOutputFuncTable
=
{
TransformFilter_Output_DecideBufferSize
TransformFilter_Output_DecideBufferSize
,
BaseOutputPinImpl_DecideAllocator
,
BaseOutputPinImpl_BreakConnect
};
static
HRESULT
TransformFilter_Init
(
const
IBaseFilterVtbl
*
pVtbl
,
const
CLSID
*
pClsid
,
const
TransformFilterFuncTable
*
pFuncsTable
,
TransformFilter
*
pTransformFilter
)
...
...
include/wine/strmbase.h
View file @
60bf76db
...
...
@@ -57,20 +57,21 @@ typedef struct BaseOutputPin
{
/* inheritance C style! */
BasePin
pin
;
IMemInputPin
*
pMemInputPin
;
BOOL
custom_allocator
;
IMemAllocator
*
alloc
;
BOOL
readonly
;
const
struct
BaseOutputPinFuncTable
*
pFuncsTable
;
}
BaseOutputPin
;
typedef
HRESULT
(
WINAPI
*
BaseOutputPin_DecideBufferSize
)(
BaseOutputPin
*
This
,
IMemAllocator
*
pAlloc
,
ALLOCATOR_PROPERTIES
*
ppropInputRequest
);
typedef
HRESULT
(
WINAPI
*
BaseOutputPin_DecideAllocator
)(
BaseOutputPin
*
This
,
IMemInputPin
*
pPin
,
IMemAllocator
**
pAlloc
);
typedef
HRESULT
(
WINAPI
*
BaseOutputPin_BreakConnect
)(
BaseOutputPin
*
This
);
typedef
struct
BaseOutputPinFuncTable
{
/* Required */
/* Required
for BaseOutputPinImpl_DecideAllocator
*/
BaseOutputPin_DecideBufferSize
pfnDecideBufferSize
;
/* Required for BaseOutputPinImpl_AttemptConnection */
BaseOutputPin_DecideAllocator
pfnDecideAllocator
;
BaseOutputPin_BreakConnect
pfnBreakConnect
;
}
BaseOutputPinFuncTable
;
typedef
struct
BaseInputPin
...
...
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