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
dbf910b0
Commit
dbf910b0
authored
Mar 30, 2012
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Change VideoRenderer to use strmbase's BaseControlVideo.
parent
75300a7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
221 additions
and
536 deletions
+221
-536
videorenderer.c
dlls/quartz/videorenderer.c
+221
-536
No files found.
dlls/quartz/videorenderer.c
View file @
dbf910b0
...
...
@@ -52,8 +52,8 @@ typedef struct VideoRendererImpl
{
BaseRenderer
renderer
;
BaseControlWindow
baseControlWindow
;
BaseControlVideo
baseControlVideo
;
const
IBasicVideoVtbl
*
IBasicVideo_vtbl
;
const
IUnknownVtbl
*
IInner_vtbl
;
const
IAMFilterMiscFlagsVtbl
*
IAMFilterMiscFlags_vtbl
;
...
...
@@ -95,6 +95,16 @@ static inline VideoRendererImpl *impl_from_IVideoWindow(IVideoWindow *iface)
return
CONTAINING_RECORD
(
iface
,
VideoRendererImpl
,
baseControlWindow
.
IVideoWindow_iface
);
}
static
inline
VideoRendererImpl
*
impl_from_BaseControlVideo
(
BaseControlVideo
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
VideoRendererImpl
,
baseControlVideo
);
}
static
inline
VideoRendererImpl
*
impl_from_IBasicVideo
(
IBasicVideo
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
VideoRendererImpl
,
baseControlVideo
.
IBasicVideo_iface
);
}
static
DWORD
WINAPI
MessageLoop
(
LPVOID
lpParameter
)
{
VideoRendererImpl
*
This
=
lpParameter
;
...
...
@@ -467,6 +477,172 @@ static const BaseWindowFuncTable renderer_BaseWindowFuncTable = {
VideoRenderer_OnSize
};
HRESULT
WINAPI
VideoRenderer_GetSourceRect
(
BaseControlVideo
*
iface
,
RECT
*
pSourceRect
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
CopyRect
(
pSourceRect
,
&
This
->
SourceRect
);
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_GetStaticImage
(
BaseControlVideo
*
iface
,
LONG
*
pBufferSize
,
LONG
*
pDIBImage
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
BITMAPINFOHEADER
*
bmiHeader
;
LONG
needed_size
;
AM_MEDIA_TYPE
*
amt
=
&
This
->
renderer
.
pInputPin
->
pin
.
mtCurrent
;
char
*
ptr
;
FIXME
(
"(%p/%p)->(%p, %p): partial stub
\n
"
,
This
,
iface
,
pBufferSize
,
pDIBImage
);
EnterCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
if
(
!
This
->
renderer
.
pMediaSample
)
{
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
(
This
->
renderer
.
filter
.
state
==
State_Paused
?
E_UNEXPECTED
:
VFW_E_NOT_PAUSED
);
}
if
(
IsEqualIID
(
&
amt
->
formattype
,
&
FORMAT_VideoInfo
))
{
bmiHeader
=
&
((
VIDEOINFOHEADER
*
)
amt
->
pbFormat
)
->
bmiHeader
;
}
else
if
(
IsEqualIID
(
&
amt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
bmiHeader
=
&
((
VIDEOINFOHEADER2
*
)
amt
->
pbFormat
)
->
bmiHeader
;
}
else
{
FIXME
(
"Unknown type %s
\n
"
,
debugstr_guid
(
&
amt
->
subtype
));
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
VFW_E_RUNTIME_ERROR
;
}
needed_size
=
bmiHeader
->
biSize
;
needed_size
+=
IMediaSample_GetActualDataLength
(
This
->
renderer
.
pMediaSample
);
if
(
!
pDIBImage
)
{
*
pBufferSize
=
needed_size
;
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
S_OK
;
}
if
(
needed_size
<
*
pBufferSize
)
{
ERR
(
"Buffer too small %u/%u
\n
"
,
needed_size
,
*
pBufferSize
);
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
E_FAIL
;
}
*
pBufferSize
=
needed_size
;
memcpy
(
pDIBImage
,
bmiHeader
,
bmiHeader
->
biSize
);
IMediaSample_GetPointer
(
This
->
renderer
.
pMediaSample
,
(
BYTE
**
)
&
ptr
);
memcpy
((
char
*
)
pDIBImage
+
bmiHeader
->
biSize
,
ptr
,
IMediaSample_GetActualDataLength
(
This
->
renderer
.
pMediaSample
));
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_GetTargetRect
(
BaseControlVideo
*
iface
,
RECT
*
pTargetRect
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
CopyRect
(
pTargetRect
,
&
This
->
DestRect
);
return
S_OK
;
}
VIDEOINFOHEADER
*
WINAPI
VideoRenderer_GetVideoFormat
(
BaseControlVideo
*
iface
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
AM_MEDIA_TYPE
*
pmt
;
TRACE
(
"(%p/%p)
\n
"
,
This
,
iface
);
pmt
=
&
This
->
renderer
.
pInputPin
->
pin
.
mtCurrent
;
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo
))
{
return
(
VIDEOINFOHEADER
*
)
pmt
->
pbFormat
;
}
else
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
static
VIDEOINFOHEADER
vih
;
VIDEOINFOHEADER2
*
vih2
=
(
VIDEOINFOHEADER2
*
)
pmt
->
pbFormat
;
memcpy
(
&
vih
,
vih2
,
sizeof
(
VIDEOINFOHEADER
));
memcpy
(
&
vih
.
bmiHeader
,
&
vih2
->
bmiHeader
,
sizeof
(
BITMAPINFOHEADER
));
return
&
vih
;
}
else
{
ERR
(
"Unknown format type %s
\n
"
,
qzdebugstr_guid
(
&
pmt
->
formattype
));
return
NULL
;
}
}
HRESULT
WINAPI
VideoRenderer_IsDefaultSourceRect
(
BaseControlVideo
*
iface
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
FIXME
(
"(%p/%p)->(): stub !!!
\n
"
,
This
,
iface
);
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_IsDefaultTargetRect
(
BaseControlVideo
*
iface
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
FIXME
(
"(%p/%p)->(): stub !!!
\n
"
,
This
,
iface
);
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_SetDefaultSourceRect
(
BaseControlVideo
*
iface
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
This
->
SourceRect
.
left
=
0
;
This
->
SourceRect
.
top
=
0
;
This
->
SourceRect
.
right
=
This
->
VideoWidth
;
This
->
SourceRect
.
bottom
=
This
->
VideoHeight
;
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_SetDefaultTargetRect
(
BaseControlVideo
*
iface
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
RECT
rect
;
if
(
!
GetClientRect
(
This
->
baseControlWindow
.
baseWindow
.
hWnd
,
&
rect
))
return
E_FAIL
;
This
->
SourceRect
.
left
=
0
;
This
->
SourceRect
.
top
=
0
;
This
->
SourceRect
.
right
=
rect
.
right
;
This
->
SourceRect
.
bottom
=
rect
.
bottom
;
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_SetSourceRect
(
BaseControlVideo
*
iface
,
RECT
*
pSourceRect
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
CopyRect
(
&
This
->
SourceRect
,
pSourceRect
);
return
S_OK
;
}
HRESULT
WINAPI
VideoRenderer_SetTargetRect
(
BaseControlVideo
*
iface
,
RECT
*
pTargetRect
)
{
VideoRendererImpl
*
This
=
impl_from_BaseControlVideo
(
iface
);
CopyRect
(
&
This
->
DestRect
,
pTargetRect
);
return
S_OK
;
}
static
const
BaseControlVideoFuncTable
renderer_BaseControlVideoFuncTable
=
{
VideoRenderer_GetSourceRect
,
VideoRenderer_GetStaticImage
,
VideoRenderer_GetTargetRect
,
VideoRenderer_GetVideoFormat
,
VideoRenderer_IsDefaultSourceRect
,
VideoRenderer_IsDefaultTargetRect
,
VideoRenderer_SetDefaultSourceRect
,
VideoRenderer_SetDefaultTargetRect
,
VideoRenderer_SetSourceRect
,
VideoRenderer_SetTargetRect
};
HRESULT
VideoRenderer_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppv
)
{
HRESULT
hr
;
...
...
@@ -482,7 +658,6 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
pVideoRenderer
->
bAggregatable
=
FALSE
;
pVideoRenderer
->
IInner_vtbl
=
&
IInner_VTable
;
pVideoRenderer
->
IAMFilterMiscFlags_vtbl
=
&
IAMFilterMiscFlags_Vtbl
;
pVideoRenderer
->
IBasicVideo_vtbl
=
&
IBasicVideo_VTable
;
pVideoRenderer
->
init
=
0
;
ZeroMemory
(
&
pVideoRenderer
->
SourceRect
,
sizeof
(
RECT
));
...
...
@@ -500,6 +675,10 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
if
(
FAILED
(
hr
))
goto
fail
;
hr
=
BaseControlVideo_Init
(
&
pVideoRenderer
->
baseControlVideo
,
&
IBasicVideo_VTable
,
&
pVideoRenderer
->
renderer
.
filter
,
&
pVideoRenderer
->
renderer
.
filter
.
csFilter
,
&
pVideoRenderer
->
renderer
.
pInputPin
->
pin
,
&
renderer_BaseControlVideoFuncTable
);
if
(
FAILED
(
hr
))
goto
fail
;
if
(
!
CreateRenderingSubsystem
(
pVideoRenderer
))
return
E_FAIL
;
...
...
@@ -529,7 +708,7 @@ static HRESULT WINAPI VideoRendererInner_QueryInterface(IUnknown * iface, REFIID
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ppv
=
&
This
->
IInner_vtbl
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IBasicVideo
))
*
ppv
=
&
This
->
IBasicVideo_vtbl
;
*
ppv
=
&
This
->
baseControlVideo
.
IBasicVideo_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IVideoWindow
))
*
ppv
=
&
This
->
baseControlWindow
.
IVideoWindow_iface
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IAMFilterMiscFlags
))
...
...
@@ -692,7 +871,7 @@ static const IBaseFilterVtbl VideoRenderer_Vtbl =
static
HRESULT
WINAPI
Basicvideo_QueryInterface
(
IBasicVideo
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
VideoRendererImpl
*
This
=
impl_from_IBasicVideo
(
iface
);
TRACE
(
"(%p/%p)->(%s (%p), %p)
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
riid
,
ppvObj
);
...
...
@@ -700,7 +879,7 @@ static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
}
static
ULONG
WINAPI
Basicvideo_AddRef
(
IBasicVideo
*
iface
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
VideoRendererImpl
*
This
=
impl_from_IBasicVideo
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
...
...
@@ -708,548 +887,54 @@ static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
}
static
ULONG
WINAPI
Basicvideo_Release
(
IBasicVideo
*
iface
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
VideoRendererImpl
*
This
=
impl_from_IBasicVideo
(
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
return
VideoRenderer_Release
(
&
This
->
renderer
.
filter
.
IBaseFilter_iface
);
}
/*** IDispatch methods ***/
static
HRESULT
WINAPI
Basicvideo_GetTypeInfoCount
(
IBasicVideo
*
iface
,
UINT
*
pctinfo
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(%p): stub !!!
\n
"
,
This
,
iface
,
pctinfo
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_GetTypeInfo
(
IBasicVideo
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(%d, %d, %p): stub !!!
\n
"
,
This
,
iface
,
iTInfo
,
lcid
,
ppTInfo
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_GetIDsOfNames
(
IBasicVideo
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
riid
,
rgszNames
,
cNames
,
lcid
,
rgDispId
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_Invoke
(
IBasicVideo
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExepInfo
,
UINT
*
puArgErr
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!
\n
"
,
This
,
iface
,
dispIdMember
,
debugstr_guid
(
riid
),
riid
,
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExepInfo
,
puArgErr
);
return
S_OK
;
}
/*** IBasicVideo methods ***/
static
HRESULT
WINAPI
Basicvideo_get_AvgTimePerFrame
(
IBasicVideo
*
iface
,
REFTIME
*
pAvgTimePerFrame
)
{
AM_MEDIA_TYPE
*
pmt
;
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
if
(
!
This
->
renderer
.
pInputPin
->
pin
.
pConnectedTo
)
return
VFW_E_NOT_CONNECTED
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pAvgTimePerFrame
);
pmt
=
&
This
->
renderer
.
pInputPin
->
pin
.
mtCurrent
;
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo
))
{
VIDEOINFOHEADER
*
vih
=
(
VIDEOINFOHEADER
*
)
pmt
->
pbFormat
;
*
pAvgTimePerFrame
=
vih
->
AvgTimePerFrame
;
}
else
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
VIDEOINFOHEADER2
*
vih
=
(
VIDEOINFOHEADER2
*
)
pmt
->
pbFormat
;
*
pAvgTimePerFrame
=
vih
->
AvgTimePerFrame
;
}
else
{
ERR
(
"Unknown format type %s
\n
"
,
qzdebugstr_guid
(
&
pmt
->
formattype
));
*
pAvgTimePerFrame
=
0
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_BitRate
(
IBasicVideo
*
iface
,
LONG
*
pBitRate
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(%p): stub !!!
\n
"
,
This
,
iface
,
pBitRate
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_BitErrorRate
(
IBasicVideo
*
iface
,
LONG
*
pBitErrorRate
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(%p): stub !!!
\n
"
,
This
,
iface
,
pBitErrorRate
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_VideoWidth
(
IBasicVideo
*
iface
,
LONG
*
pVideoWidth
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pVideoWidth
);
*
pVideoWidth
=
This
->
VideoWidth
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_VideoHeight
(
IBasicVideo
*
iface
,
LONG
*
pVideoHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pVideoHeight
);
*
pVideoHeight
=
This
->
VideoHeight
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_SourceLeft
(
IBasicVideo
*
iface
,
LONG
SourceLeft
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
SourceLeft
);
This
->
SourceRect
.
left
=
SourceLeft
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_SourceLeft
(
IBasicVideo
*
iface
,
LONG
*
pSourceLeft
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pSourceLeft
);
*
pSourceLeft
=
This
->
SourceRect
.
left
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_SourceWidth
(
IBasicVideo
*
iface
,
LONG
SourceWidth
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
SourceWidth
);
This
->
SourceRect
.
right
=
This
->
SourceRect
.
left
+
SourceWidth
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_SourceWidth
(
IBasicVideo
*
iface
,
LONG
*
pSourceWidth
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pSourceWidth
);
*
pSourceWidth
=
This
->
SourceRect
.
right
-
This
->
SourceRect
.
left
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_SourceTop
(
IBasicVideo
*
iface
,
LONG
SourceTop
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
SourceTop
);
This
->
SourceRect
.
top
=
SourceTop
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_SourceTop
(
IBasicVideo
*
iface
,
LONG
*
pSourceTop
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pSourceTop
);
*
pSourceTop
=
This
->
SourceRect
.
top
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_SourceHeight
(
IBasicVideo
*
iface
,
LONG
SourceHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
SourceHeight
);
This
->
SourceRect
.
bottom
=
This
->
SourceRect
.
top
+
SourceHeight
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_SourceHeight
(
IBasicVideo
*
iface
,
LONG
*
pSourceHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pSourceHeight
);
*
pSourceHeight
=
This
->
SourceRect
.
bottom
-
This
->
SourceRect
.
top
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_DestinationLeft
(
IBasicVideo
*
iface
,
LONG
DestinationLeft
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
DestinationLeft
);
This
->
DestRect
.
left
=
DestinationLeft
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_DestinationLeft
(
IBasicVideo
*
iface
,
LONG
*
pDestinationLeft
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pDestinationLeft
);
*
pDestinationLeft
=
This
->
DestRect
.
left
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_DestinationWidth
(
IBasicVideo
*
iface
,
LONG
DestinationWidth
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
DestinationWidth
);
This
->
DestRect
.
right
=
This
->
DestRect
.
left
+
DestinationWidth
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_DestinationWidth
(
IBasicVideo
*
iface
,
LONG
*
pDestinationWidth
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pDestinationWidth
);
*
pDestinationWidth
=
This
->
DestRect
.
right
-
This
->
DestRect
.
left
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_DestinationTop
(
IBasicVideo
*
iface
,
LONG
DestinationTop
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
DestinationTop
);
This
->
DestRect
.
top
=
DestinationTop
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_DestinationTop
(
IBasicVideo
*
iface
,
LONG
*
pDestinationTop
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pDestinationTop
);
*
pDestinationTop
=
This
->
DestRect
.
top
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_put_DestinationHeight
(
IBasicVideo
*
iface
,
LONG
DestinationHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d)
\n
"
,
This
,
iface
,
DestinationHeight
);
This
->
DestRect
.
right
=
This
->
DestRect
.
left
+
DestinationHeight
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_get_DestinationHeight
(
IBasicVideo
*
iface
,
LONG
*
pDestinationHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
pDestinationHeight
);
*
pDestinationHeight
=
This
->
DestRect
.
right
-
This
->
DestRect
.
left
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_SetSourcePosition
(
IBasicVideo
*
iface
,
LONG
Left
,
LONG
Top
,
LONG
Width
,
LONG
Height
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d, %d, %d, %d)
\n
"
,
This
,
iface
,
Left
,
Top
,
Width
,
Height
);
This
->
SourceRect
.
left
=
Left
;
This
->
SourceRect
.
top
=
Top
;
This
->
SourceRect
.
right
=
Left
+
Width
;
This
->
SourceRect
.
bottom
=
Top
+
Height
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_GetSourcePosition
(
IBasicVideo
*
iface
,
LONG
*
pLeft
,
LONG
*
pTop
,
LONG
*
pWidth
,
LONG
*
pHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p, %p, %p, %p)
\n
"
,
This
,
iface
,
pLeft
,
pTop
,
pWidth
,
pHeight
);
*
pLeft
=
This
->
SourceRect
.
left
;
*
pTop
=
This
->
SourceRect
.
top
;
*
pWidth
=
This
->
SourceRect
.
right
-
This
->
SourceRect
.
left
;
*
pHeight
=
This
->
SourceRect
.
bottom
-
This
->
SourceRect
.
top
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_SetDefaultSourcePosition
(
IBasicVideo
*
iface
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
This
->
SourceRect
.
left
=
0
;
This
->
SourceRect
.
top
=
0
;
This
->
SourceRect
.
right
=
This
->
VideoWidth
;
This
->
SourceRect
.
bottom
=
This
->
VideoHeight
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_SetDestinationPosition
(
IBasicVideo
*
iface
,
LONG
Left
,
LONG
Top
,
LONG
Width
,
LONG
Height
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d, %d, %d, %d)
\n
"
,
This
,
iface
,
Left
,
Top
,
Width
,
Height
);
This
->
DestRect
.
left
=
Left
;
This
->
DestRect
.
top
=
Top
;
This
->
DestRect
.
right
=
Left
+
Width
;
This
->
DestRect
.
bottom
=
Top
+
Height
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_GetDestinationPosition
(
IBasicVideo
*
iface
,
LONG
*
pLeft
,
LONG
*
pTop
,
LONG
*
pWidth
,
LONG
*
pHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p, %p, %p, %p)
\n
"
,
This
,
iface
,
pLeft
,
pTop
,
pWidth
,
pHeight
);
*
pLeft
=
This
->
DestRect
.
left
;
*
pTop
=
This
->
DestRect
.
top
;
*
pWidth
=
This
->
DestRect
.
right
-
This
->
DestRect
.
left
;
*
pHeight
=
This
->
DestRect
.
bottom
-
This
->
DestRect
.
top
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_SetDefaultDestinationPosition
(
IBasicVideo
*
iface
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
RECT
rect
;
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
if
(
!
GetClientRect
(
This
->
baseControlWindow
.
baseWindow
.
hWnd
,
&
rect
))
return
E_FAIL
;
This
->
SourceRect
.
left
=
0
;
This
->
SourceRect
.
top
=
0
;
This
->
SourceRect
.
right
=
rect
.
right
;
This
->
SourceRect
.
bottom
=
rect
.
bottom
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_GetVideoSize
(
IBasicVideo
*
iface
,
LONG
*
pWidth
,
LONG
*
pHeight
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%p, %p)
\n
"
,
This
,
iface
,
pWidth
,
pHeight
);
*
pWidth
=
This
->
VideoWidth
;
*
pHeight
=
This
->
VideoHeight
;
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_GetVideoPaletteEntries
(
IBasicVideo
*
iface
,
LONG
StartIndex
,
LONG
Entries
,
LONG
*
pRetrieved
,
LONG
*
pPalette
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
TRACE
(
"(%p/%p)->(%d, %d, %p, %p)
\n
"
,
This
,
iface
,
StartIndex
,
Entries
,
pRetrieved
,
pPalette
);
if
(
pRetrieved
)
*
pRetrieved
=
0
;
return
VFW_E_NO_PALETTE_AVAILABLE
;
}
static
HRESULT
WINAPI
Basicvideo_GetCurrentImage
(
IBasicVideo
*
iface
,
LONG
*
pBufferSize
,
LONG
*
pDIBImage
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
BITMAPINFOHEADER
*
bmiHeader
;
LONG
needed_size
;
AM_MEDIA_TYPE
*
amt
=
&
This
->
renderer
.
pInputPin
->
pin
.
mtCurrent
;
char
*
ptr
;
FIXME
(
"(%p/%p)->(%p, %p): partial stub
\n
"
,
This
,
iface
,
pBufferSize
,
pDIBImage
);
EnterCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
if
(
!
This
->
renderer
.
pMediaSample
)
{
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
(
This
->
renderer
.
filter
.
state
==
State_Paused
?
E_UNEXPECTED
:
VFW_E_NOT_PAUSED
);
}
if
(
IsEqualIID
(
&
amt
->
formattype
,
&
FORMAT_VideoInfo
))
{
bmiHeader
=
&
((
VIDEOINFOHEADER
*
)
amt
->
pbFormat
)
->
bmiHeader
;
}
else
if
(
IsEqualIID
(
&
amt
->
formattype
,
&
FORMAT_VideoInfo2
))
{
bmiHeader
=
&
((
VIDEOINFOHEADER2
*
)
amt
->
pbFormat
)
->
bmiHeader
;
}
else
{
FIXME
(
"Unknown type %s
\n
"
,
debugstr_guid
(
&
amt
->
subtype
));
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
VFW_E_RUNTIME_ERROR
;
}
needed_size
=
bmiHeader
->
biSize
;
needed_size
+=
IMediaSample_GetActualDataLength
(
This
->
renderer
.
pMediaSample
);
if
(
!
pDIBImage
)
{
*
pBufferSize
=
needed_size
;
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
S_OK
;
}
if
(
needed_size
<
*
pBufferSize
)
{
ERR
(
"Buffer too small %u/%u
\n
"
,
needed_size
,
*
pBufferSize
);
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
E_FAIL
;
}
*
pBufferSize
=
needed_size
;
memcpy
(
pDIBImage
,
bmiHeader
,
bmiHeader
->
biSize
);
IMediaSample_GetPointer
(
This
->
renderer
.
pMediaSample
,
(
BYTE
**
)
&
ptr
);
memcpy
((
char
*
)
pDIBImage
+
bmiHeader
->
biSize
,
ptr
,
IMediaSample_GetActualDataLength
(
This
->
renderer
.
pMediaSample
));
LeaveCriticalSection
(
&
This
->
renderer
.
filter
.
csFilter
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_IsUsingDefaultSource
(
IBasicVideo
*
iface
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(): stub !!!
\n
"
,
This
,
iface
);
return
S_OK
;
}
static
HRESULT
WINAPI
Basicvideo_IsUsingDefaultDestination
(
IBasicVideo
*
iface
)
{
ICOM_THIS_MULTI
(
VideoRendererImpl
,
IBasicVideo_vtbl
,
iface
);
FIXME
(
"(%p/%p)->(): stub !!!
\n
"
,
This
,
iface
);
return
S_OK
;
}
static
const
IBasicVideoVtbl
IBasicVideo_VTable
=
{
Basicvideo_QueryInterface
,
Basicvideo_AddRef
,
Basicvideo_Release
,
Bas
icvideo
_GetTypeInfoCount
,
Bas
icvideo
_GetTypeInfo
,
Bas
icvideo
_GetIDsOfNames
,
Bas
icvideo
_Invoke
,
Bas
icvideo
_get_AvgTimePerFrame
,
Bas
icvideo
_get_BitRate
,
Bas
icvideo
_get_BitErrorRate
,
Bas
icvideo
_get_VideoWidth
,
Bas
icvideo
_get_VideoHeight
,
Bas
icvideo
_put_SourceLeft
,
Bas
icvideo
_get_SourceLeft
,
Bas
icvideo
_put_SourceWidth
,
Bas
icvideo
_get_SourceWidth
,
Bas
icvideo
_put_SourceTop
,
Bas
icvideo
_get_SourceTop
,
Bas
icvideo
_put_SourceHeight
,
Bas
icvideo
_get_SourceHeight
,
Bas
icvideo
_put_DestinationLeft
,
Bas
icvideo
_get_DestinationLeft
,
Bas
icvideo
_put_DestinationWidth
,
Bas
icvideo
_get_DestinationWidth
,
Bas
icvideo
_put_DestinationTop
,
Bas
icvideo
_get_DestinationTop
,
Bas
icvideo
_put_DestinationHeight
,
Bas
icvideo
_get_DestinationHeight
,
Bas
icvideo
_SetSourcePosition
,
Bas
icvideo
_GetSourcePosition
,
Bas
icvideo
_SetDefaultSourcePosition
,
Bas
icvideo
_SetDestinationPosition
,
Bas
icvideo
_GetDestinationPosition
,
Bas
icvideo
_SetDefaultDestinationPosition
,
Bas
icvideo
_GetVideoSize
,
Bas
icvideo
_GetVideoPaletteEntries
,
Bas
icvideo
_GetCurrentImage
,
Bas
icvideo
_IsUsingDefaultSource
,
Bas
icvideo
_IsUsingDefaultDestination
Bas
eControlVideoImpl
_GetTypeInfoCount
,
Bas
eControlVideoImpl
_GetTypeInfo
,
Bas
eControlVideoImpl
_GetIDsOfNames
,
Bas
eControlVideoImpl
_Invoke
,
Bas
eControlVideoImpl
_get_AvgTimePerFrame
,
Bas
eControlVideoImpl
_get_BitRate
,
Bas
eControlVideoImpl
_get_BitErrorRate
,
Bas
eControlVideoImpl
_get_VideoWidth
,
Bas
eControlVideoImpl
_get_VideoHeight
,
Bas
eControlVideoImpl
_put_SourceLeft
,
Bas
eControlVideoImpl
_get_SourceLeft
,
Bas
eControlVideoImpl
_put_SourceWidth
,
Bas
eControlVideoImpl
_get_SourceWidth
,
Bas
eControlVideoImpl
_put_SourceTop
,
Bas
eControlVideoImpl
_get_SourceTop
,
Bas
eControlVideoImpl
_put_SourceHeight
,
Bas
eControlVideoImpl
_get_SourceHeight
,
Bas
eControlVideoImpl
_put_DestinationLeft
,
Bas
eControlVideoImpl
_get_DestinationLeft
,
Bas
eControlVideoImpl
_put_DestinationWidth
,
Bas
eControlVideoImpl
_get_DestinationWidth
,
Bas
eControlVideoImpl
_put_DestinationTop
,
Bas
eControlVideoImpl
_get_DestinationTop
,
Bas
eControlVideoImpl
_put_DestinationHeight
,
Bas
eControlVideoImpl
_get_DestinationHeight
,
Bas
eControlVideoImpl
_SetSourcePosition
,
Bas
eControlVideoImpl
_GetSourcePosition
,
Bas
eControlVideoImpl
_SetDefaultSourcePosition
,
Bas
eControlVideoImpl
_SetDestinationPosition
,
Bas
eControlVideoImpl
_GetDestinationPosition
,
Bas
eControlVideoImpl
_SetDefaultDestinationPosition
,
Bas
eControlVideoImpl
_GetVideoSize
,
Bas
eControlVideoImpl
_GetVideoPaletteEntries
,
Bas
eControlVideoImpl
_GetCurrentImage
,
Bas
eControlVideoImpl
_IsUsingDefaultSource
,
Bas
eControlVideoImpl
_IsUsingDefaultDestination
};
...
...
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