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
f595d9bd
Commit
f595d9bd
authored
Dec 10, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Pass an AM_MEDIA_TYPE pointer to CompleteConnect().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
264c539e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
46 deletions
+39
-46
dsoundrender.c
dlls/quartz/dsoundrender.c
+4
-9
vmr9.c
dlls/quartz/vmr9.c
+32
-33
renderer.c
dlls/strmbase/renderer.c
+2
-2
strmbase.h
include/wine/strmbase.h
+1
-2
No files found.
dlls/quartz/dsoundrender.c
View file @
f595d9bd
...
@@ -413,18 +413,13 @@ static void dsound_render_start_stream(struct strmbase_renderer *iface)
...
@@ -413,18 +413,13 @@ static void dsound_render_start_stream(struct strmbase_renderer *iface)
}
}
}
}
static
HRESULT
WINAPI
DSoundRender_CompleteConnect
(
struct
strmbase_renderer
*
iface
,
IPin
*
pReceivePin
)
static
HRESULT
dsound_render_connect
(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
{
{
DSoundRenderImpl
*
This
=
impl_from_strmbase_renderer
(
iface
);
DSoundRenderImpl
*
This
=
impl_from_strmbase_renderer
(
iface
);
const
AM_MEDIA_TYPE
*
pmt
=
&
This
->
renderer
.
sink
.
pin
.
m
t
;
const
WAVEFORMATEX
*
format
=
(
WAVEFORMATEX
*
)
mt
->
pbForma
t
;
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
WAVEFORMATEX
*
format
;
DSBUFFERDESC
buf_desc
;
DSBUFFERDESC
buf_desc
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pReceivePin
);
format
=
(
WAVEFORMATEX
*
)
pmt
->
pbFormat
;
This
->
buf_size
=
format
->
nAvgBytesPerSec
;
This
->
buf_size
=
format
->
nAvgBytesPerSec
;
memset
(
&
buf_desc
,
0
,
sizeof
(
DSBUFFERDESC
));
memset
(
&
buf_desc
,
0
,
sizeof
(
DSBUFFERDESC
));
...
@@ -433,7 +428,7 @@ static HRESULT WINAPI DSoundRender_CompleteConnect(struct strmbase_renderer *ifa
...
@@ -433,7 +428,7 @@ static HRESULT WINAPI DSoundRender_CompleteConnect(struct strmbase_renderer *ifa
DSBCAPS_CTRLFREQUENCY
|
DSBCAPS_GLOBALFOCUS
|
DSBCAPS_CTRLFREQUENCY
|
DSBCAPS_GLOBALFOCUS
|
DSBCAPS_GETCURRENTPOSITION2
;
DSBCAPS_GETCURRENTPOSITION2
;
buf_desc
.
dwBufferBytes
=
This
->
buf_size
;
buf_desc
.
dwBufferBytes
=
This
->
buf_size
;
buf_desc
.
lpwfxFormat
=
format
;
buf_desc
.
lpwfxFormat
=
(
WAVEFORMATEX
*
)
format
;
hr
=
IDirectSound8_CreateSoundBuffer
(
This
->
dsound
,
&
buf_desc
,
&
This
->
dsbuffer
,
NULL
);
hr
=
IDirectSound8_CreateSoundBuffer
(
This
->
dsound
,
&
buf_desc
,
&
This
->
dsbuffer
,
NULL
);
This
->
writepos
=
This
->
buf_size
;
This
->
writepos
=
This
->
buf_size
;
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
...
@@ -539,7 +534,7 @@ static const struct strmbase_renderer_ops renderer_ops =
...
@@ -539,7 +534,7 @@ static const struct strmbase_renderer_ops renderer_ops =
.
renderer_stop_stream
=
dsound_render_stop_stream
,
.
renderer_stop_stream
=
dsound_render_stop_stream
,
.
pfnShouldDrawSampleNow
=
DSoundRender_ShouldDrawSampleNow
,
.
pfnShouldDrawSampleNow
=
DSoundRender_ShouldDrawSampleNow
,
.
pfnPrepareReceive
=
DSoundRender_PrepareReceive
,
.
pfnPrepareReceive
=
DSoundRender_PrepareReceive
,
.
pfnCompleteConnect
=
DSoundRender_CompleteC
onnect
,
.
renderer_connect
=
dsound_render_c
onnect
,
.
pfnBreakConnect
=
DSoundRender_BreakConnect
,
.
pfnBreakConnect
=
DSoundRender_BreakConnect
,
.
pfnEndOfStream
=
DSoundRender_EndOfStream
,
.
pfnEndOfStream
=
DSoundRender_EndOfStream
,
.
pfnEndFlush
=
DSoundRender_EndFlush
,
.
pfnEndFlush
=
DSoundRender_EndFlush
,
...
...
dlls/quartz/vmr9.c
View file @
f595d9bd
...
@@ -331,38 +331,20 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi
...
@@ -331,38 +331,20 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi
return
hr
;
return
hr
;
}
}
static
HRESULT
WINAPI
VMR9_CheckMediaType
(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
p
mt
)
static
HRESULT
WINAPI
VMR9_CheckMediaType
(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
{
{
struct
quartz_vmr
*
This
=
impl_from_IBaseFilter
(
&
iface
->
filter
.
IBaseFilter_iface
)
;
const
VIDEOINFOHEADER
*
vih
;
if
(
!
IsEqualIID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Video
)
||
!
p
mt
->
pbFormat
)
if
(
!
IsEqualIID
(
&
mt
->
majortype
,
&
MEDIATYPE_Video
)
||
!
mt
->
pbFormat
)
return
S_FALSE
;
return
S_FALSE
;
/* Ignore subtype, test for bicompression instead */
if
(
!
IsEqualGUID
(
&
mt
->
formattype
,
&
FORMAT_VideoInfo
)
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo
))
&&
!
IsEqualGUID
(
&
mt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
return
S_FALSE
;
VIDEOINFOHEADER
*
format
=
(
VIDEOINFOHEADER
*
)
pmt
->
pbFormat
;
This
->
bmiheader
=
format
->
bmiHeader
;
vih
=
(
VIDEOINFOHEADER
*
)
mt
->
pbFormat
;
This
->
VideoWidth
=
format
->
bmiHeader
.
biWidth
;
This
->
VideoHeight
=
format
->
bmiHeader
.
biHeight
;
SetRect
(
&
This
->
source_rect
,
0
,
0
,
This
->
VideoWidth
,
This
->
VideoHeight
);
}
else
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
VIDEOINFOHEADER2
*
format
=
(
VIDEOINFOHEADER2
*
)
pmt
->
pbFormat
;
This
->
bmiheader
=
format
->
bmiHeader
;
if
(
vih
->
bmiHeader
.
biCompression
!=
BI_RGB
)
This
->
VideoWidth
=
format
->
bmiHeader
.
biWidth
;
This
->
VideoHeight
=
format
->
bmiHeader
.
biHeight
;
SetRect
(
&
This
->
source_rect
,
0
,
0
,
This
->
VideoWidth
,
This
->
VideoHeight
);
}
else
{
ERR
(
"Format type %s not supported
\n
"
,
debugstr_guid
(
&
pmt
->
formattype
));
return
S_FALSE
;
}
if
(
This
->
bmiheader
.
biCompression
!=
BI_RGB
)
return
S_FALSE
;
return
S_FALSE
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -461,16 +443,33 @@ static HRESULT WINAPI VMR9_ShouldDrawSampleNow(struct strmbase_renderer *iface,
...
@@ -461,16 +443,33 @@ static HRESULT WINAPI VMR9_ShouldDrawSampleNow(struct strmbase_renderer *iface,
return
S_FALSE
;
return
S_FALSE
;
}
}
static
HRESULT
WINAPI
VMR9_CompleteConnect
(
struct
strmbase_renderer
*
This
,
IPin
*
pReceivePin
)
static
HRESULT
vmr_connect
(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
{
{
struct
quartz_vmr
*
pVMR9
=
impl_from_IBaseFilter
(
&
This
->
filter
.
IBaseFilter_iface
);
struct
quartz_vmr
*
filter
=
impl_from_IBaseFilter
(
&
iface
->
filter
.
IBaseFilter_iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
IsEqualGUID
(
&
mt
->
formattype
,
&
FORMAT_VideoInfo
))
{
VIDEOINFOHEADER
*
format
=
(
VIDEOINFOHEADER
*
)
mt
->
pbFormat
;
filter
->
bmiheader
=
format
->
bmiHeader
;
filter
->
VideoWidth
=
format
->
bmiHeader
.
biWidth
;
filter
->
VideoHeight
=
format
->
bmiHeader
.
biHeight
;
SetRect
(
&
filter
->
source_rect
,
0
,
0
,
filter
->
VideoWidth
,
filter
->
VideoHeight
);
}
else
if
(
IsEqualIID
(
&
mt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
VIDEOINFOHEADER2
*
format
=
(
VIDEOINFOHEADER2
*
)
mt
->
pbFormat
;
filter
->
bmiheader
=
format
->
bmiHeader
;
filter
->
VideoWidth
=
format
->
bmiHeader
.
biWidth
;
filter
->
VideoHeight
=
format
->
bmiHeader
.
biHeight
;
SetRect
(
&
filter
->
source_rect
,
0
,
0
,
filter
->
VideoWidth
,
filter
->
VideoHeight
);
}
if
(
pVMR9
->
mode
||
if
(
filter
->
mode
SUCCEEDED
(
hr
=
IVMRFilterConfig9_SetRenderingMode
(
&
pVMR9
->
IVMRFilterConfig9_iface
,
VMR9Mode_Windowed
)))
||
SUCCEEDED
(
hr
=
IVMRFilterConfig9_SetRenderingMode
(
&
filter
->
IVMRFilterConfig9_iface
,
VMR9Mode_Windowed
)))
hr
=
VMR9_maybe_init
(
pVMR9
,
FALSE
);
hr
=
VMR9_maybe_init
(
filter
,
FALSE
);
return
hr
;
return
hr
;
}
}
...
@@ -576,7 +575,7 @@ static const struct strmbase_renderer_ops renderer_ops =
...
@@ -576,7 +575,7 @@ static const struct strmbase_renderer_ops renderer_ops =
.
renderer_start_stream
=
vmr_start_stream
,
.
renderer_start_stream
=
vmr_start_stream
,
.
renderer_stop_stream
=
vmr_stop_stream
,
.
renderer_stop_stream
=
vmr_stop_stream
,
.
pfnShouldDrawSampleNow
=
VMR9_ShouldDrawSampleNow
,
.
pfnShouldDrawSampleNow
=
VMR9_ShouldDrawSampleNow
,
.
pfnCompleteConnect
=
VMR9_CompleteC
onnect
,
.
renderer_connect
=
vmr_c
onnect
,
.
pfnBreakConnect
=
VMR9_BreakConnect
,
.
pfnBreakConnect
=
VMR9_BreakConnect
,
.
renderer_destroy
=
vmr_destroy
,
.
renderer_destroy
=
vmr_destroy
,
.
renderer_query_interface
=
vmr_query_interface
,
.
renderer_query_interface
=
vmr_query_interface
,
...
...
dlls/strmbase/renderer.c
View file @
f595d9bd
...
@@ -52,8 +52,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin
...
@@ -52,8 +52,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin
hr
=
BaseInputPinImpl_ReceiveConnection
(
iface
,
peer
,
mt
);
hr
=
BaseInputPinImpl_ReceiveConnection
(
iface
,
peer
,
mt
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
if
(
filter
->
pFuncsTable
->
pfnCompleteC
onnect
)
if
(
filter
->
pFuncsTable
->
renderer_c
onnect
)
hr
=
filter
->
pFuncsTable
->
pfnCompleteConnect
(
filter
,
peer
);
hr
=
filter
->
pFuncsTable
->
renderer_connect
(
filter
,
mt
);
}
}
LeaveCriticalSection
(
&
filter
->
filter
.
csFilter
);
LeaveCriticalSection
(
&
filter
->
filter
.
csFilter
);
...
...
include/wine/strmbase.h
View file @
f595d9bd
...
@@ -523,7 +523,6 @@ typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(struct strmbase_renderer *ifa
...
@@ -523,7 +523,6 @@ typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(struct strmbase_renderer *ifa
typedef
HRESULT
(
WINAPI
*
BaseRenderer_BeginFlush
)
(
struct
strmbase_renderer
*
iface
);
typedef
HRESULT
(
WINAPI
*
BaseRenderer_BeginFlush
)
(
struct
strmbase_renderer
*
iface
);
typedef
HRESULT
(
WINAPI
*
BaseRenderer_EndFlush
)
(
struct
strmbase_renderer
*
iface
);
typedef
HRESULT
(
WINAPI
*
BaseRenderer_EndFlush
)
(
struct
strmbase_renderer
*
iface
);
typedef
HRESULT
(
WINAPI
*
BaseRenderer_BreakConnect
)
(
struct
strmbase_renderer
*
iface
);
typedef
HRESULT
(
WINAPI
*
BaseRenderer_BreakConnect
)
(
struct
strmbase_renderer
*
iface
);
typedef
HRESULT
(
WINAPI
*
BaseRenderer_CompleteConnect
)
(
struct
strmbase_renderer
*
iface
,
IPin
*
peer
);
struct
strmbase_renderer_ops
struct
strmbase_renderer_ops
{
{
...
@@ -534,7 +533,7 @@ struct strmbase_renderer_ops
...
@@ -534,7 +533,7 @@ struct strmbase_renderer_ops
void
(
*
renderer_stop_stream
)(
struct
strmbase_renderer
*
iface
);
void
(
*
renderer_stop_stream
)(
struct
strmbase_renderer
*
iface
);
BaseRenderer_ShouldDrawSampleNow
pfnShouldDrawSampleNow
;
BaseRenderer_ShouldDrawSampleNow
pfnShouldDrawSampleNow
;
BaseRenderer_PrepareReceive
pfnPrepareReceive
;
BaseRenderer_PrepareReceive
pfnPrepareReceive
;
BaseRenderer_CompleteConnect
pfnCompleteConnect
;
HRESULT
(
*
renderer_connect
)(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
;
BaseRenderer_BreakConnect
pfnBreakConnect
;
BaseRenderer_BreakConnect
pfnBreakConnect
;
BaseRenderer_EndOfStream
pfnEndOfStream
;
BaseRenderer_EndOfStream
pfnEndOfStream
;
BaseRenderer_EndFlush
pfnEndFlush
;
BaseRenderer_EndFlush
pfnEndFlush
;
...
...
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