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
14a51f57
Commit
14a51f57
authored
Dec 10, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/avimux: Use strmbase sink connection methods.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
88898cf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
46 deletions
+25
-46
avimux.c
dlls/qcap/avimux.c
+25
-46
No files found.
dlls/qcap/avimux.c
View file @
14a51f57
...
...
@@ -1410,41 +1410,15 @@ static HRESULT WINAPI AviMuxIn_Receive(struct strmbase_sink *base, IMediaSample
return
hr
;
}
static
const
struct
strmbase_sink_ops
sink_ops
=
{
.
base
.
pin_query_interface
=
sink_query_interface
,
.
base
.
pin_query_accept
=
sink_query_accept
,
.
base
.
pin_get_media_type
=
strmbase_pin_get_media_type
,
.
pfnReceive
=
AviMuxIn_Receive
,
};
static
inline
AviMux
*
impl_from_in_IPin
(
IPin
*
iface
)
static
HRESULT
avi_mux_sink_connect
(
struct
strmbase_sink
*
iface
,
IPin
*
peer
,
const
AM_MEDIA_TYPE
*
pmt
)
{
struct
strmbase_pin
*
pin
=
CONTAINING_RECORD
(
iface
,
struct
strmbase_pin
,
IPin_iface
);
return
impl_from_strmbase_filter
(
pin
->
filter
);
}
static
inline
AviMuxIn
*
AviMuxIn_from_IPin
(
IPin
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
AviMuxIn
,
pin
.
pin
.
IPin_iface
);
}
static
HRESULT
WINAPI
AviMuxIn_ReceiveConnection
(
IPin
*
iface
,
IPin
*
pConnector
,
const
AM_MEDIA_TYPE
*
pmt
)
{
AviMux
*
This
=
impl_from_in_IPin
(
iface
);
AviMuxIn
*
avimuxin
=
AviMuxIn_from_IPin
(
iface
);
AviMuxIn
*
avimuxin
=
impl_sink_from_strmbase_pin
(
&
iface
->
pin
);
AviMux
*
This
=
impl_from_strmbase_filter
(
iface
->
pin
.
filter
);
HRESULT
hr
;
TRACE
(
"pin %p, pConnector %p, pmt %p.
\n
"
,
avimuxin
,
pConnector
,
pmt
);
if
(
!
pmt
)
return
E_POINTER
;
hr
=
BaseInputPinImpl_ReceiveConnection
(
iface
,
pConnector
,
pmt
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
IsEqualIID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Video
)
&&
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo
))
{
ALLOCATOR_PROPERTIES
req
,
act
;
...
...
@@ -1468,10 +1442,8 @@ static HRESULT WINAPI AviMuxIn_ReceiveConnection(IPin *iface,
hr
=
IMemAllocator_SetProperties
(
avimuxin
->
samples_allocator
,
&
req
,
&
act
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_Commit
(
avimuxin
->
samples_allocator
);
if
(
FAILED
(
hr
))
{
BaseInputPinImpl_Disconnect
(
iface
);
if
(
FAILED
(
hr
))
return
hr
;
}
size
=
pmt
->
cbFormat
-
FIELD_OFFSET
(
VIDEOINFOHEADER
,
bmiHeader
);
avimuxin
->
strf
=
CoTaskMemAlloc
(
sizeof
(
RIFFCHUNK
)
+
ALIGN
(
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
vih
->
bmiHeader
.
biClrUsed
])));
...
...
@@ -1489,23 +1461,15 @@ static HRESULT WINAPI AviMuxIn_ReceiveConnection(IPin *iface,
return
create_input_pin
(
This
);
}
static
HRESULT
WINAPI
AviMuxIn_Disconnect
(
IPin
*
iface
)
static
void
avi_mux_sink_disconnect
(
struct
strmbase_sink
*
iface
)
{
AviMuxIn
*
avimuxin
=
AviMuxIn_from_IPin
(
iface
);
AviMuxIn
*
avimuxin
=
impl_sink_from_strmbase_pin
(
&
iface
->
pin
);
IMediaSample
**
prev
,
*
cur
;
HRESULT
hr
;
TRACE
(
"pin %p.
\n
"
,
avimuxin
);
hr
=
BaseInputPinImpl_Disconnect
(
iface
);
if
(
FAILED
(
hr
))
return
hr
;
IMemAllocator_Decommit
(
avimuxin
->
samples_allocator
);
while
(
avimuxin
->
samples_head
)
{
cur
=
avimuxin
->
samples_head
;
hr
=
IMediaSample_GetPointer
(
cur
,
(
BYTE
**
)
&
prev
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
IMediaSample_GetPointer
(
cur
,
(
BYTE
**
)
&
prev
)))
break
;
prev
--
;
...
...
@@ -1518,7 +1482,22 @@ static HRESULT WINAPI AviMuxIn_Disconnect(IPin *iface)
}
CoTaskMemFree
(
avimuxin
->
strf
);
avimuxin
->
strf
=
NULL
;
return
hr
;
}
static
const
struct
strmbase_sink_ops
sink_ops
=
{
.
base
.
pin_query_interface
=
sink_query_interface
,
.
base
.
pin_query_accept
=
sink_query_accept
,
.
base
.
pin_get_media_type
=
strmbase_pin_get_media_type
,
.
pfnReceive
=
AviMuxIn_Receive
,
.
sink_connect
=
avi_mux_sink_connect
,
.
sink_disconnect
=
avi_mux_sink_disconnect
,
};
static
inline
AviMux
*
impl_from_in_IPin
(
IPin
*
iface
)
{
struct
strmbase_pin
*
pin
=
CONTAINING_RECORD
(
iface
,
struct
strmbase_pin
,
IPin_iface
);
return
impl_from_strmbase_filter
(
pin
->
filter
);
}
static
const
IPinVtbl
AviMuxIn_PinVtbl
=
{
...
...
@@ -1526,8 +1505,8 @@ static const IPinVtbl AviMuxIn_PinVtbl = {
BasePinImpl_AddRef
,
BasePinImpl_Release
,
BaseInputPinImpl_Connect
,
AviMuxIn
_ReceiveConnection
,
AviMuxIn
_Disconnect
,
BaseInputPinImpl
_ReceiveConnection
,
BaseInputPinImpl
_Disconnect
,
BasePinImpl_ConnectedTo
,
BasePinImpl_ConnectionMediaType
,
BasePinImpl_QueryPinInfo
,
...
...
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