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
b0b56001
Commit
b0b56001
authored
Nov 22, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Simplify SendFurther().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd83b11a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
75 deletions
+12
-75
pin.c
dlls/strmbase/pin.c
+12
-75
No files found.
dlls/strmbase/pin.c
View file @
b0b56001
...
@@ -56,82 +56,18 @@ static HRESULT updatehres( HRESULT original, HRESULT new )
...
@@ -56,82 +56,18 @@ static HRESULT updatehres( HRESULT original, HRESULT new )
* If the pin given is an input pin, the message will be sent downstream to other input pins
* If the pin given is an input pin, the message will be sent downstream to other input pins
* If the pin given is an output pin, the message will be sent upstream to other output pins
* If the pin given is an output pin, the message will be sent upstream to other output pins
*/
*/
static
HRESULT
SendFurther
(
IPin
*
from
,
SendPinFunc
fnMiddle
,
LPVOID
arg
,
SendPinFunc
fnEnd
)
static
HRESULT
SendFurther
(
struct
strmbase_sink
*
sink
,
SendPinFunc
func
,
void
*
arg
)
{
{
PIN_INFO
pin_info
;
struct
strmbase_pin
*
pin
;
ULONG
amount
=
0
;
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
HRESULT
hr_return
=
S_OK
;
unsigned
int
i
;
IEnumPins
*
enumpins
=
NULL
;
BOOL
foundend
=
TRUE
;
PIN_DIRECTION
from_dir
;
IPin_QueryDirection
(
from
,
&
from_dir
);
for
(
i
=
0
;
(
pin
=
sink
->
pin
.
filter
->
ops
->
filter_get_pin
(
sink
->
pin
.
filter
,
i
));
++
i
)
{
hr
=
IPin_QueryInternalConnections
(
from
,
NULL
,
&
amount
);
if
(
pin
->
dir
==
PINDIR_OUTPUT
&&
pin
->
peer
)
if
(
hr
!=
E_NOTIMPL
&&
amount
)
hr
=
updatehres
(
hr
,
func
(
pin
->
peer
,
arg
));
FIXME
(
"Use QueryInternalConnections!
\n
"
);
pin_info
.
pFilter
=
NULL
;
hr
=
IPin_QueryPinInfo
(
from
,
&
pin_info
);
if
(
FAILED
(
hr
))
goto
out
;
hr
=
IBaseFilter_EnumPins
(
pin_info
.
pFilter
,
&
enumpins
);
if
(
FAILED
(
hr
))
goto
out
;
hr
=
IEnumPins_Reset
(
enumpins
);
while
(
hr
==
S_OK
)
{
IPin
*
pin
=
NULL
;
hr
=
IEnumPins_Next
(
enumpins
,
1
,
&
pin
,
NULL
);
if
(
hr
==
VFW_E_ENUM_OUT_OF_SYNC
)
{
hr
=
IEnumPins_Reset
(
enumpins
);
continue
;
}
if
(
pin
)
{
PIN_DIRECTION
dir
;
IPin_QueryDirection
(
pin
,
&
dir
);
if
(
dir
!=
from_dir
)
{
IPin
*
connected
=
NULL
;
foundend
=
FALSE
;
IPin_ConnectedTo
(
pin
,
&
connected
);
if
(
connected
)
{
HRESULT
hr_local
;
hr_local
=
fnMiddle
(
connected
,
arg
);
hr_return
=
updatehres
(
hr_return
,
hr_local
);
IPin_Release
(
connected
);
}
}
IPin_Release
(
pin
);
}
else
{
hr
=
S_OK
;
break
;
}
}
if
(
!
foundend
)
hr
=
hr_return
;
else
if
(
fnEnd
)
{
HRESULT
hr_local
;
hr_local
=
fnEnd
(
from
,
arg
);
hr_return
=
updatehres
(
hr_return
,
hr_local
);
}
}
IEnumPins_Release
(
enumpins
);
out:
if
(
pin_info
.
pFilter
)
IBaseFilter_Release
(
pin_info
.
pFilter
);
return
hr
;
return
hr
;
}
}
...
@@ -799,7 +735,7 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
...
@@ -799,7 +735,7 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
LeaveCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
LeaveCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
hr
=
SendFurther
(
iface
,
deliver_endofstream
,
NULL
,
NULL
);
hr
=
SendFurther
(
This
,
deliver_endofstream
,
NULL
);
return
hr
;
return
hr
;
}
}
...
@@ -817,7 +753,7 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
...
@@ -817,7 +753,7 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
EnterCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
EnterCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
This
->
flushing
=
TRUE
;
This
->
flushing
=
TRUE
;
hr
=
SendFurther
(
iface
,
deliver_beginflush
,
NULL
,
NULL
);
hr
=
SendFurther
(
This
,
deliver_beginflush
,
NULL
);
LeaveCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
LeaveCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
return
hr
;
return
hr
;
...
@@ -837,7 +773,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
...
@@ -837,7 +773,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
EnterCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
EnterCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
This
->
flushing
=
This
->
end_of_stream
=
FALSE
;
This
->
flushing
=
This
->
end_of_stream
=
FALSE
;
hr
=
SendFurther
(
iface
,
deliver_endflush
,
NULL
,
NULL
);
hr
=
SendFurther
(
This
,
deliver_endflush
,
NULL
);
LeaveCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
LeaveCriticalSection
(
&
This
->
pin
.
filter
->
csFilter
);
return
hr
;
return
hr
;
...
@@ -857,6 +793,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data)
...
@@ -857,6 +793,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data)
HRESULT
WINAPI
BaseInputPinImpl_NewSegment
(
IPin
*
iface
,
REFERENCE_TIME
start
,
REFERENCE_TIME
stop
,
double
rate
)
HRESULT
WINAPI
BaseInputPinImpl_NewSegment
(
IPin
*
iface
,
REFERENCE_TIME
start
,
REFERENCE_TIME
stop
,
double
rate
)
{
{
struct
strmbase_sink
*
pin
=
impl_sink_from_IPin
(
iface
);
newsegmentargs
args
;
newsegmentargs
args
;
TRACE
(
"iface %p, start %s, stop %s, rate %.16e.
\n
"
,
TRACE
(
"iface %p, start %s, stop %s, rate %.16e.
\n
"
,
...
@@ -866,7 +803,7 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
...
@@ -866,7 +803,7 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
args
.
tStop
=
stop
;
args
.
tStop
=
stop
;
args
.
rate
=
rate
;
args
.
rate
=
rate
;
return
SendFurther
(
iface
,
deliver_newsegment
,
&
args
,
NULL
);
return
SendFurther
(
pin
,
deliver_newsegment
,
&
args
);
}
}
/*** IMemInputPin implementation ***/
/*** IMemInputPin implementation ***/
...
...
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