Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8983528f
Commit
8983528f
authored
Jun 17, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Share source pin and filter reference counts.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d249e18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
55 deletions
+44
-55
gstdemux.c
dlls/winegstreamer/gstdemux.c
+44
-55
No files found.
dlls/winegstreamer/gstdemux.c
View file @
8983528f
...
...
@@ -1688,41 +1688,16 @@ static HRESULT WINAPI GSTOutPin_QueryInterface(IPin *iface, REFIID riid, void **
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
GSTOutPin_
Release
(
IPin
*
iface
)
static
ULONG
WINAPI
GSTOutPin_
AddRef
(
IPin
*
iface
)
{
GSTOutPin
*
This
=
impl_source_from_IPin
(
iface
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
pin
.
pin
.
refCount
);
TRACE
(
"(%p)->() Release from %d
\n
"
,
This
,
refCount
+
1
);
mark_wine_thread
();
GSTOutPin
*
pin
=
impl_source_from_IPin
(
iface
);
return
IBaseFilter_AddRef
(
pin
->
pin
.
pin
.
pinInfo
.
pFilter
);
}
if
(
!
refCount
)
{
if
(
This
->
their_src
)
{
if
(
This
->
flipfilter
)
{
gst_pad_unlink
(
This
->
their_src
,
This
->
flip_sink
);
gst_pad_unlink
(
This
->
flip_src
,
This
->
my_sink
);
gst_object_unref
(
This
->
flip_src
);
gst_object_unref
(
This
->
flip_sink
);
This
->
flipfilter
=
NULL
;
This
->
flip_src
=
This
->
flip_sink
=
NULL
;
}
else
gst_pad_unlink
(
This
->
their_src
,
This
->
my_sink
);
gst_object_unref
(
This
->
their_src
);
}
gst_object_unref
(
This
->
my_sink
);
CloseHandle
(
This
->
caps_event
);
DeleteMediaType
(
This
->
pmt
);
FreeMediaType
(
&
This
->
pin
.
pin
.
mtCurrent
);
gst_segment_free
(
This
->
segment
);
if
(
This
->
gstpool
)
gst_object_unref
(
This
->
gstpool
);
if
(
This
->
pin
.
pAllocator
)
IMemAllocator_Release
(
This
->
pin
.
pAllocator
);
CoTaskMemFree
(
This
);
return
0
;
}
return
refCount
;
static
ULONG
WINAPI
GSTOutPin_Release
(
IPin
*
iface
)
{
GSTOutPin
*
pin
=
impl_source_from_IPin
(
iface
);
return
IBaseFilter_Release
(
pin
->
pin
.
pin
.
pinInfo
.
pFilter
);
}
static
HRESULT
WINAPI
GSTOutPin_CheckMediaType
(
BasePin
*
base
,
const
AM_MEDIA_TYPE
*
amt
)
...
...
@@ -1780,30 +1755,47 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(BaseOutputPin *base, IMemInputPi
return
hr
;
}
static
HRESULT
break_source_connection
(
BaseOutputPin
*
This
)
static
void
free_source_pin
(
GSTOutPin
*
pin
)
{
HRESULT
hr
;
TRACE
(
"(%p)->()
\n
"
,
This
);
EnterCriticalSection
(
This
->
pin
.
pCritSec
);
if
(
!
This
->
pin
.
pConnectedTo
||
!
This
->
pMemInputPin
)
hr
=
VFW_E_NOT_CONNECTED
;
else
EnterCriticalSection
(
pin
->
pin
.
pin
.
pCritSec
);
if
(
pin
->
pin
.
pin
.
pConnectedTo
)
{
hr
=
IMemAllocator_Decommit
(
This
->
pAllocator
);
if
(
SUCCEEDED
(
hr
))
hr
=
IPin_Disconnect
(
This
->
pin
.
pConnectedTo
);
IPin_Disconnect
((
IPin
*
)
This
);
if
(
SUCCEEDED
(
IMemAllocator_Decommit
(
pin
->
pin
.
pAllocator
)))
IPin_Disconnect
(
pin
->
pin
.
pin
.
pConnectedTo
);
IPin_Disconnect
(
&
pin
->
pin
.
pin
.
IPin_iface
);
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
LeaveCriticalSection
(
pin
->
pin
.
pin
.
pCritSec
);
return
hr
;
if
(
pin
->
their_src
)
{
if
(
pin
->
flipfilter
)
{
gst_pad_unlink
(
pin
->
their_src
,
pin
->
flip_sink
);
gst_pad_unlink
(
pin
->
flip_src
,
pin
->
my_sink
);
gst_object_unref
(
pin
->
flip_src
);
gst_object_unref
(
pin
->
flip_sink
);
pin
->
flipfilter
=
NULL
;
pin
->
flip_src
=
pin
->
flip_sink
=
NULL
;
}
else
gst_pad_unlink
(
pin
->
their_src
,
pin
->
my_sink
);
gst_object_unref
(
pin
->
their_src
);
}
gst_object_unref
(
pin
->
my_sink
);
CloseHandle
(
pin
->
caps_event
);
DeleteMediaType
(
pin
->
pmt
);
FreeMediaType
(
&
pin
->
pin
.
pin
.
mtCurrent
);
gst_segment_free
(
pin
->
segment
);
if
(
pin
->
gstpool
)
gst_object_unref
(
pin
->
gstpool
);
if
(
pin
->
pin
.
pAllocator
)
IMemAllocator_Release
(
pin
->
pin
.
pAllocator
);
CoTaskMemFree
(
pin
);
}
static
const
IPinVtbl
GST_OutputPin_Vtbl
=
{
GSTOutPin_QueryInterface
,
BasePinImpl
_AddRef
,
GSTOutPin
_AddRef
,
GSTOutPin_Release
,
BaseOutputPinImpl_Connect
,
BaseOutputPinImpl_ReceiveConnection
,
...
...
@@ -1857,7 +1849,6 @@ static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDI
static
HRESULT
GST_RemoveOutputPins
(
GSTImpl
*
This
)
{
HRESULT
hr
;
ULONG
i
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1871,11 +1862,9 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This)
gst_object_unref
(
This
->
their_sink
);
This
->
my_src
=
This
->
their_sink
=
NULL
;
for
(
i
=
0
;
i
<
This
->
cStreams
;
i
++
)
{
hr
=
break_source_connection
(
&
This
->
ppPins
[
i
]
->
pin
);
TRACE
(
"Disconnect: %08x
\n
"
,
hr
);
IPin_Release
(
&
This
->
ppPins
[
i
]
->
pin
.
pin
.
IPin_iface
);
}
for
(
i
=
0
;
i
<
This
->
cStreams
;
++
i
)
free_source_pin
(
This
->
ppPins
[
i
]);
This
->
cStreams
=
0
;
CoTaskMemFree
(
This
->
ppPins
);
This
->
ppPins
=
NULL
;
...
...
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