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
7f767bb1
Commit
7f767bb1
authored
Jan 15, 2013
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Store and use the chosen IMemAllocator instead of getting it from the input pin.
parent
c0d43fb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
41 deletions
+12
-41
pin.c
dlls/strmbase/pin.c
+11
-41
strmbase.h
include/wine/strmbase.h
+1
-0
No files found.
dlls/strmbase/pin.c
View file @
7f767bb1
...
...
@@ -402,6 +402,9 @@ ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface)
if
(
!
refCount
)
{
FreeMediaType
(
&
This
->
pin
.
mtCurrent
);
if
(
This
->
pAllocator
)
IMemAllocator_Release
(
This
->
pAllocator
);
This
->
pAllocator
=
NULL
;
CoTaskMemFree
(
This
);
return
0
;
}
...
...
@@ -584,18 +587,10 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSa
hr
=
VFW_E_NOT_CONNECTED
;
else
{
IMemAllocator
*
pAlloc
=
NULL
;
hr
=
IMemInputPin_GetAllocator
(
This
->
pMemInputPin
,
&
pAlloc
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_GetBuffer
(
pAlloc
,
ppSample
,
tStart
,
tStop
,
dwFlags
);
hr
=
IMemAllocator_GetBuffer
(
This
->
pAllocator
,
ppSample
,
tStart
,
tStop
,
dwFlags
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMediaSample_SetTime
(
*
ppSample
,
tStart
,
tStop
);
if
(
pAlloc
)
IMemAllocator_Release
(
pAlloc
);
}
return
hr
;
...
...
@@ -653,17 +648,7 @@ HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This)
if
(
!
This
->
pin
.
pConnectedTo
||
!
This
->
pMemInputPin
)
hr
=
VFW_E_NOT_CONNECTED
;
else
{
IMemAllocator
*
pAlloc
=
NULL
;
hr
=
IMemInputPin_GetAllocator
(
This
->
pMemInputPin
,
&
pAlloc
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_Commit
(
pAlloc
);
if
(
pAlloc
)
IMemAllocator_Release
(
pAlloc
);
}
hr
=
IMemAllocator_Commit
(
This
->
pAllocator
);
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
...
...
@@ -683,17 +668,7 @@ HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This)
if
(
!
This
->
pin
.
pConnectedTo
||
!
This
->
pMemInputPin
)
hr
=
VFW_E_NOT_CONNECTED
;
else
{
IMemAllocator
*
pAlloc
=
NULL
;
hr
=
IMemInputPin_GetAllocator
(
This
->
pMemInputPin
,
&
pAlloc
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_Decommit
(
pAlloc
);
if
(
pAlloc
)
IMemAllocator_Release
(
pAlloc
);
}
hr
=
IMemAllocator_Decommit
(
This
->
pAllocator
);
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
...
...
@@ -714,15 +689,7 @@ HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This)
hr
=
VFW_E_NOT_CONNECTED
;
else
{
IMemAllocator
*
pAlloc
=
NULL
;
hr
=
IMemInputPin_GetAllocator
(
This
->
pMemInputPin
,
&
pAlloc
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_Decommit
(
pAlloc
);
if
(
pAlloc
)
IMemAllocator_Release
(
pAlloc
);
hr
=
IMemAllocator_Decommit
(
This
->
pAllocator
);
if
(
SUCCEEDED
(
hr
))
hr
=
IPin_Disconnect
(
This
->
pin
.
pConnectedTo
);
...
...
@@ -795,7 +762,9 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin* iface, IPin * pRecei
if
(
SUCCEEDED
(
hr
))
{
hr
=
This
->
pFuncsTable
->
pfnDecideAllocator
(
This
,
This
->
pMemInputPin
,
&
pMemAlloc
);
if
(
pMemAlloc
)
if
(
SUCCEEDED
(
hr
))
This
->
pAllocator
=
pMemAlloc
;
else
if
(
pMemAlloc
)
IMemAllocator_Release
(
pMemAlloc
);
}
...
...
@@ -839,6 +808,7 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p
/* Output pin attributes */
pPinImpl
->
pMemInputPin
=
NULL
;
pPinImpl
->
pAllocator
=
NULL
;
pPinImpl
->
pFuncsTable
=
pBaseOutputFuncsTable
;
return
S_OK
;
...
...
include/wine/strmbase.h
View file @
7f767bb1
...
...
@@ -61,6 +61,7 @@ typedef struct BaseOutputPin
/* inheritance C style! */
BasePin
pin
;
IMemInputPin
*
pMemInputPin
;
IMemAllocator
*
pAllocator
;
const
struct
BaseOutputPinFuncTable
*
pFuncsTable
;
}
BaseOutputPin
;
...
...
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