ReactOS 0.4.15-dev-7788-g1ad9096
video.c File Reference
#include <assert.h>
#include "dshow.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/strmbase.h"
Include dependency graph for video.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (strmbase)
 
static BaseControlVideo * impl_from_IBasicVideo (IBasicVideo *iface)
 
HRESULT WINAPI BaseControlVideo_Init (BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseControlVideoFuncTable *pFuncsTable)
 
HRESULT WINAPI BaseControlVideo_Destroy (BaseControlVideo *pControlVideo)
 
static HRESULT BaseControlVideoImpl_CheckSourceRect (BaseControlVideo *This, RECT *pSourceRect)
 
static HRESULT BaseControlVideoImpl_CheckTargetRect (BaseControlVideo *This, RECT *pTargetRect)
 
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount (IBasicVideo *iface, UINT *pctinfo)
 
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo (IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames (IBasicVideo *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
HRESULT WINAPI BaseControlVideoImpl_Invoke (IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
 
HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame (IBasicVideo *iface, REFTIME *pAvgTimePerFrame)
 
HRESULT WINAPI BaseControlVideoImpl_get_BitRate (IBasicVideo *iface, LONG *pBitRate)
 
HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate (IBasicVideo *iface, LONG *pBitErrorRate)
 
HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth (IBasicVideo *iface, LONG *pVideoWidth)
 
HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight (IBasicVideo *iface, LONG *pVideoHeight)
 
HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft (IBasicVideo *iface, LONG SourceLeft)
 
HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft (IBasicVideo *iface, LONG *pSourceLeft)
 
HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth (IBasicVideo *iface, LONG SourceWidth)
 
HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth (IBasicVideo *iface, LONG *pSourceWidth)
 
HRESULT WINAPI BaseControlVideoImpl_put_SourceTop (IBasicVideo *iface, LONG SourceTop)
 
HRESULT WINAPI BaseControlVideoImpl_get_SourceTop (IBasicVideo *iface, LONG *pSourceTop)
 
HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight (IBasicVideo *iface, LONG SourceHeight)
 
HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight (IBasicVideo *iface, LONG *pSourceHeight)
 
HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft (IBasicVideo *iface, LONG DestinationLeft)
 
HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft (IBasicVideo *iface, LONG *pDestinationLeft)
 
HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth (IBasicVideo *iface, LONG DestinationWidth)
 
HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth (IBasicVideo *iface, LONG *pDestinationWidth)
 
HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop (IBasicVideo *iface, LONG DestinationTop)
 
HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop (IBasicVideo *iface, LONG *pDestinationTop)
 
HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight (IBasicVideo *iface, LONG DestinationHeight)
 
HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight (IBasicVideo *iface, LONG *pDestinationHeight)
 
HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition (IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
 
HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition (IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
 
HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition (IBasicVideo *iface)
 
HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition (IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
 
HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition (IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
 
HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition (IBasicVideo *iface)
 
HRESULT WINAPI BaseControlVideoImpl_GetVideoSize (IBasicVideo *iface, LONG *pWidth, LONG *pHeight)
 
HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries (IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette)
 
HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage (IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
 
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource (IBasicVideo *iface)
 
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination (IBasicVideo *iface)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file video.c.

Function Documentation

◆ BaseControlVideo_Destroy()

HRESULT WINAPI BaseControlVideo_Destroy ( BaseControlVideo *  pControlVideo)

Definition at line 51 of file video.c.

52{
53 return BaseDispatch_Destroy(&pControlVideo->baseDispatch);
54}
HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This)
Definition: dispatch.c:45

Referenced by VideoRendererInner_Release().

◆ BaseControlVideo_Init()

HRESULT WINAPI BaseControlVideo_Init ( BaseControlVideo *  pControlVideo,
const IBasicVideoVtbl *  lpVtbl,
BaseFilter owner,
CRITICAL_SECTION lock,
BasePin pPin,
const BaseControlVideoFuncTable *  pFuncsTable 
)

Definition at line 38 of file video.c.

39{
40 pControlVideo->IBasicVideo_iface.lpVtbl = lpVtbl;
41 pControlVideo->pFilter = owner;
42 pControlVideo->pInterfaceLock = lock;
43 pControlVideo->pPin = pPin;
44 pControlVideo->pFuncsTable = pFuncsTable;
45
46 BaseDispatch_Init(&pControlVideo->baseDispatch, &IID_IBasicVideo);
47
48 return S_OK;
49}
#define S_OK
Definition: intsafe.h:52
HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid)
Definition: dispatch.c:30
const struct BasePinFuncTable * pFuncsTable
Definition: strmbase.h:45
rwlock_t lock
Definition: tcpcore.h:0

Referenced by VideoRenderer_create(), and vmr_create().

◆ BaseControlVideoImpl_CheckSourceRect()

static HRESULT BaseControlVideoImpl_CheckSourceRect ( BaseControlVideo *  This,
RECT pSourceRect 
)
static

Definition at line 56 of file video.c.

57{
58 LONG VideoWidth, VideoHeight;
59 HRESULT hr;
60
61 if (IsRectEmpty(pSourceRect))
62 return E_INVALIDARG;
63
64 hr = BaseControlVideoImpl_GetVideoSize((IBasicVideo *)This, &VideoWidth, &VideoHeight);
65 if (FAILED(hr))
66 return hr;
67
68 if (pSourceRect->top < 0 || pSourceRect->left < 0 ||
69 pSourceRect->bottom > VideoHeight || pSourceRect->right > VideoWidth)
70 return E_INVALIDARG;
71
72 return S_OK;
73}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define FAILED(hr)
Definition: intsafe.h:51
long LONG
Definition: pedump.c:60
HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight)
Definition: video.c:548
HRESULT hr
Definition: shlfolder.c:183
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)

Referenced by BaseControlVideoImpl_put_SourceHeight(), BaseControlVideoImpl_put_SourceLeft(), BaseControlVideoImpl_put_SourceTop(), BaseControlVideoImpl_put_SourceWidth(), and BaseControlVideoImpl_SetSourcePosition().

◆ BaseControlVideoImpl_CheckTargetRect()

static HRESULT BaseControlVideoImpl_CheckTargetRect ( BaseControlVideo *  This,
RECT pTargetRect 
)
static

◆ BaseControlVideoImpl_get_AvgTimePerFrame()

HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame ( IBasicVideo *  iface,
REFTIME pAvgTimePerFrame 
)

Definition at line 120 of file video.c.

121{
122 VIDEOINFOHEADER *vih;
123 BaseControlVideo *This = impl_from_IBasicVideo(iface);
124
125 if (!pAvgTimePerFrame)
126 return E_POINTER;
127 if (!This->pPin->pConnectedTo)
128 return VFW_E_NOT_CONNECTED;
129
130 TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame);
131
132 vih = This->pFuncsTable->pfnGetVideoFormat(This);
133 *pAvgTimePerFrame = vih->AvgTimePerFrame;
134 return S_OK;
135}
static BaseControlVideo * impl_from_IBasicVideo(IBasicVideo *iface)
Definition: video.c:33
#define TRACE(s)
Definition: solgame.cpp:4
REFERENCE_TIME AvgTimePerFrame
Definition: amvideo.idl:187
#define VFW_E_NOT_CONNECTED
Definition: vfwmsgs.h:48
#define E_POINTER
Definition: winerror.h:2365

◆ BaseControlVideoImpl_get_BitErrorRate()

HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate ( IBasicVideo *  iface,
LONG pBitErrorRate 
)

Definition at line 154 of file video.c.

155{
156 VIDEOINFOHEADER *vih;
157 BaseControlVideo *This = impl_from_IBasicVideo(iface);
158
159 TRACE("(%p/%p)->(%p)\n", This, iface, pBitErrorRate);
160
161 if (!pBitErrorRate)
162 return E_POINTER;
163 if (!This->pPin->pConnectedTo)
164 return VFW_E_NOT_CONNECTED;
165
166 vih = This->pFuncsTable->pfnGetVideoFormat(This);
167 *pBitErrorRate = vih->dwBitErrorRate;
168 return S_OK;
169}

◆ BaseControlVideoImpl_get_BitRate()

HRESULT WINAPI BaseControlVideoImpl_get_BitRate ( IBasicVideo *  iface,
LONG pBitRate 
)

Definition at line 137 of file video.c.

138{
139 VIDEOINFOHEADER *vih;
140 BaseControlVideo *This = impl_from_IBasicVideo(iface);
141
142 TRACE("(%p/%p)->(%p)\n", This, iface, pBitRate);
143
144 if (!pBitRate)
145 return E_POINTER;
146 if (!This->pPin->pConnectedTo)
147 return VFW_E_NOT_CONNECTED;
148
149 vih = This->pFuncsTable->pfnGetVideoFormat(This);
150 *pBitRate = vih->dwBitRate;
151 return S_OK;
152}

◆ BaseControlVideoImpl_get_DestinationHeight()

HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight ( IBasicVideo *  iface,
LONG pDestinationHeight 
)

Definition at line 456 of file video.c.

457{
458 RECT DestRect;
459 BaseControlVideo *This = impl_from_IBasicVideo(iface);
460
461 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight);
462 if (!pDestinationHeight)
463 return E_POINTER;
464 This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
465 *pDestinationHeight = DestRect.bottom - DestRect.top;
466
467 return S_OK;
468}

◆ BaseControlVideoImpl_get_DestinationLeft()

HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft ( IBasicVideo *  iface,
LONG pDestinationLeft 
)

Definition at line 356 of file video.c.

357{
358 RECT DestRect;
359 BaseControlVideo *This = impl_from_IBasicVideo(iface);
360
361 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft);
362 if (!pDestinationLeft)
363 return E_POINTER;
364 This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
365 *pDestinationLeft = DestRect.left;
366
367 return S_OK;
368}

◆ BaseControlVideoImpl_get_DestinationTop()

HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop ( IBasicVideo *  iface,
LONG pDestinationTop 
)

Definition at line 423 of file video.c.

424{
425 RECT DestRect;
426 BaseControlVideo *This = impl_from_IBasicVideo(iface);
427
428 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop);
429 if (!pDestinationTop)
430 return E_POINTER;
431 This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
432 *pDestinationTop = DestRect.top;
433
434 return S_OK;
435}

◆ BaseControlVideoImpl_get_DestinationWidth()

HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth ( IBasicVideo *  iface,
LONG pDestinationWidth 
)

Definition at line 389 of file video.c.

390{
391 RECT DestRect;
392 BaseControlVideo *This = impl_from_IBasicVideo(iface);
393
394 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth);
395 if (!pDestinationWidth)
396 return E_POINTER;
397 This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
398 *pDestinationWidth = DestRect.right - DestRect.left;
399
400 return S_OK;
401}

◆ BaseControlVideoImpl_get_SourceHeight()

HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight ( IBasicVideo *  iface,
LONG pSourceHeight 
)

Definition at line 321 of file video.c.

322{
323 RECT SourceRect;
324 BaseControlVideo *This = impl_from_IBasicVideo(iface);
325
326 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight);
327 if (!pSourceHeight)
328 return E_POINTER;
329 This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
330
331 *pSourceHeight = SourceRect.bottom - SourceRect.top;
332
333 return S_OK;
334}

◆ BaseControlVideoImpl_get_SourceLeft()

HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft ( IBasicVideo *  iface,
LONG pSourceLeft 
)

Definition at line 221 of file video.c.

222{
223 RECT SourceRect;
224 BaseControlVideo *This = impl_from_IBasicVideo(iface);
225
226 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft);
227 if (!pSourceLeft)
228 return E_POINTER;
229 This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
230 *pSourceLeft = SourceRect.left;
231
232 return S_OK;
233}

◆ BaseControlVideoImpl_get_SourceTop()

HRESULT WINAPI BaseControlVideoImpl_get_SourceTop ( IBasicVideo *  iface,
LONG pSourceTop 
)

Definition at line 288 of file video.c.

289{
290 RECT SourceRect;
291 BaseControlVideo *This = impl_from_IBasicVideo(iface);
292
293 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop);
294 if (!pSourceTop)
295 return E_POINTER;
296 This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
297 *pSourceTop = SourceRect.top;
298
299 return S_OK;
300}

◆ BaseControlVideoImpl_get_SourceWidth()

HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth ( IBasicVideo *  iface,
LONG pSourceWidth 
)

Definition at line 254 of file video.c.

255{
256 RECT SourceRect;
257 BaseControlVideo *This = impl_from_IBasicVideo(iface);
258
259 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth);
260 if (!pSourceWidth)
261 return E_POINTER;
262 This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
263 *pSourceWidth = SourceRect.right - SourceRect.left;
264
265 return S_OK;
266}

◆ BaseControlVideoImpl_get_VideoHeight()

HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight ( IBasicVideo *  iface,
LONG pVideoHeight 
)

Definition at line 186 of file video.c.

187{
188 VIDEOINFOHEADER *vih;
189 BaseControlVideo *This = impl_from_IBasicVideo(iface);
190
191 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight);
192 if (!pVideoHeight)
193 return E_POINTER;
194
195 vih = This->pFuncsTable->pfnGetVideoFormat(This);
196 *pVideoHeight = abs(vih->bmiHeader.biHeight);
197
198 return S_OK;
199}
#define abs(i)
Definition: fconv.c:206
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189

◆ BaseControlVideoImpl_get_VideoWidth()

HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth ( IBasicVideo *  iface,
LONG pVideoWidth 
)

Definition at line 171 of file video.c.

172{
173 VIDEOINFOHEADER *vih;
174 BaseControlVideo *This = impl_from_IBasicVideo(iface);
175
176 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth);
177 if (!pVideoWidth)
178 return E_POINTER;
179
180 vih = This->pFuncsTable->pfnGetVideoFormat(This);
181 *pVideoWidth = vih->bmiHeader.biWidth;
182
183 return S_OK;
184}

◆ BaseControlVideoImpl_GetCurrentImage()

HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage ( IBasicVideo *  iface,
LONG pBufferSize,
LONG pDIBImage 
)

Definition at line 576 of file video.c.

577{
578 BaseControlVideo *This = impl_from_IBasicVideo(iface);
579 if (!pBufferSize || !pDIBImage)
580 return E_POINTER;
581
582 return This->pFuncsTable->pfnGetStaticImage(This, pBufferSize, pDIBImage);
583}
_Must_inspect_result_ _In_ ULONG _Out_writes_bytes_ pBufferSize PVOID _Inout_ PULONG pBufferSize
Definition: fsrtlfuncs.h:1165

◆ BaseControlVideoImpl_GetDestinationPosition()

HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition ( IBasicVideo *  iface,
LONG pLeft,
LONG pTop,
LONG pWidth,
LONG pHeight 
)

Definition at line 522 of file video.c.

523{
524 RECT DestRect;
525 BaseControlVideo *This = impl_from_IBasicVideo(iface);
526
527 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
528 if (!pLeft || !pTop || !pWidth || !pHeight)
529 return E_POINTER;
530 This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
531
532 *pLeft = DestRect.left;
533 *pTop = DestRect.top;
534 *pWidth = DestRect.right - DestRect.left;
535 *pHeight = DestRect.bottom - DestRect.top;
536
537 return S_OK;
538}

◆ BaseControlVideoImpl_GetIDsOfNames()

HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames ( IBasicVideo *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)

Definition at line 97 of file video.c.

98{
99 BaseControlVideo *This = impl_from_IBasicVideo(iface);
100
101 return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId);
102}
REFIID riid
Definition: atlbase.h:39
HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
Definition: dispatch.c:52

◆ BaseControlVideoImpl_GetSourcePosition()

HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition ( IBasicVideo *  iface,
LONG pLeft,
LONG pTop,
LONG pWidth,
LONG pHeight 
)

Definition at line 483 of file video.c.

484{
485 RECT SourceRect;
486 BaseControlVideo *This = impl_from_IBasicVideo(iface);
487
488 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
489 if (!pLeft || !pTop || !pWidth || !pHeight)
490 return E_POINTER;
491 This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
492
493 *pLeft = SourceRect.left;
494 *pTop = SourceRect.top;
495 *pWidth = SourceRect.right - SourceRect.left;
496 *pHeight = SourceRect.bottom - SourceRect.top;
497
498 return S_OK;
499}

◆ BaseControlVideoImpl_GetTypeInfo()

HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo ( IBasicVideo *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)

Definition at line 90 of file video.c.

91{
92 BaseControlVideo *This = impl_from_IBasicVideo(iface);
93
94 return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo);
95}
#define IID_NULL
Definition: guiddef.h:98
HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
Definition: dispatch.c:59

◆ BaseControlVideoImpl_GetTypeInfoCount()

HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount ( IBasicVideo *  iface,
UINT pctinfo 
)

Definition at line 83 of file video.c.

84{
85 BaseControlVideo *This = impl_from_IBasicVideo(iface);
86
87 return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo);
88}
HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo)
Definition: dispatch.c:70

◆ BaseControlVideoImpl_GetVideoPaletteEntries()

HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries ( IBasicVideo *  iface,
LONG  StartIndex,
LONG  Entries,
LONG pRetrieved,
LONG pPalette 
)

Definition at line 564 of file video.c.

565{
566 BaseControlVideo *This = impl_from_IBasicVideo(iface);
567
568 TRACE("(%p/%p)->(%d, %d, %p, %p)\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
569 if (!pRetrieved || !pPalette)
570 return E_POINTER;
571
572 *pRetrieved = 0;
574}
static const ENTRY Entries[]
#define VFW_E_NO_PALETTE_AVAILABLE
Definition: vfwmsgs.h:71

◆ BaseControlVideoImpl_GetVideoSize()

HRESULT WINAPI BaseControlVideoImpl_GetVideoSize ( IBasicVideo *  iface,
LONG pWidth,
LONG pHeight 
)

Definition at line 548 of file video.c.

549{
550 VIDEOINFOHEADER *vih;
551 BaseControlVideo *This = impl_from_IBasicVideo(iface);
552
553 TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
554 if (!pWidth || !pHeight)
555 return E_POINTER;
556
557 vih = This->pFuncsTable->pfnGetVideoFormat(This);
558 *pHeight = vih->bmiHeader.biHeight;
559 *pWidth = vih->bmiHeader.biWidth;
560
561 return S_OK;
562}

Referenced by BaseControlVideoImpl_CheckSourceRect().

◆ BaseControlVideoImpl_Invoke()

HRESULT WINAPI BaseControlVideoImpl_Invoke ( IBasicVideo *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExepInfo,
UINT puArgErr 
)

Definition at line 104 of file video.c.

105{
106 BaseControlVideo *This = impl_from_IBasicVideo(iface);
107 ITypeInfo *pTypeInfo;
108 HRESULT hr;
109
110 hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo);
111 if (SUCCEEDED(hr))
112 {
113 hr = ITypeInfo_Invoke(pTypeInfo, &This->IBasicVideo_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
114 ITypeInfo_Release(pTypeInfo);
115 }
116
117 return hr;
118}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ BaseControlVideoImpl_IsUsingDefaultDestination()

HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination ( IBasicVideo *  iface)

Definition at line 592 of file video.c.

593{
594 BaseControlVideo *This = impl_from_IBasicVideo(iface);
595
596 return This->pFuncsTable->pfnIsDefaultTargetRect(This);
597}

◆ BaseControlVideoImpl_IsUsingDefaultSource()

HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource ( IBasicVideo *  iface)

Definition at line 585 of file video.c.

586{
587 BaseControlVideo *This = impl_from_IBasicVideo(iface);
588
589 return This->pFuncsTable->pfnIsDefaultSourceRect(This);
590}

◆ BaseControlVideoImpl_put_DestinationHeight()

HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight ( IBasicVideo *  iface,
LONG  DestinationHeight 
)

Definition at line 437 of file video.c.

438{
439 RECT DestRect;
440 BaseControlVideo *This = impl_from_IBasicVideo(iface);
441 HRESULT hr;
442
443 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationHeight);
444 hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
445 if (SUCCEEDED(hr))
446 {
447 DestRect.bottom = DestRect.top + DestinationHeight;
449 }
450 if (SUCCEEDED(hr))
451 hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
452
453 return hr;
454}
static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT *pTargetRect)
Definition: video.c:75

◆ BaseControlVideoImpl_put_DestinationLeft()

HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft ( IBasicVideo *  iface,
LONG  DestinationLeft 
)

Definition at line 336 of file video.c.

337{
338 RECT DestRect;
339 BaseControlVideo *This = impl_from_IBasicVideo(iface);
340 HRESULT hr;
341
342 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft);
343 hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
344 if (SUCCEEDED(hr))
345 {
346 DestRect.right = (DestRect.right - DestRect.left) + DestinationLeft;
347 DestRect.left = DestinationLeft;
349 }
350 if (SUCCEEDED(hr))
351 hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
352
353 return hr;
354}

◆ BaseControlVideoImpl_put_DestinationTop()

HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop ( IBasicVideo *  iface,
LONG  DestinationTop 
)

Definition at line 403 of file video.c.

404{
405 RECT DestRect;
406 BaseControlVideo *This = impl_from_IBasicVideo(iface);
407 HRESULT hr;
408
409 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop);
410 hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
411 if (SUCCEEDED(hr))
412 {
413 DestRect.bottom = (DestRect.bottom - DestRect.top) + DestinationTop;
414 DestRect.top = DestinationTop;
416 }
417 if (SUCCEEDED(hr))
418 hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
419
420 return hr;
421}

◆ BaseControlVideoImpl_put_DestinationWidth()

HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth ( IBasicVideo *  iface,
LONG  DestinationWidth 
)

Definition at line 370 of file video.c.

371{
372 RECT DestRect;
373 BaseControlVideo *This = impl_from_IBasicVideo(iface);
374 HRESULT hr;
375
376 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationWidth);
377 hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
378 if (SUCCEEDED(hr))
379 {
380 DestRect.right = DestRect.left + DestinationWidth;
382 }
383 if (SUCCEEDED(hr))
384 hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
385
386 return hr;
387}

◆ BaseControlVideoImpl_put_SourceHeight()

HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight ( IBasicVideo *  iface,
LONG  SourceHeight 
)

Definition at line 302 of file video.c.

303{
304 RECT SourceRect;
305 BaseControlVideo *This = impl_from_IBasicVideo(iface);
306 HRESULT hr;
307
308 TRACE("(%p/%p)->(%d)\n", This, iface, SourceHeight);
309 hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
310 if (SUCCEEDED(hr))
311 {
312 SourceRect.bottom = SourceRect.top + SourceHeight;
314 }
315 if (SUCCEEDED(hr))
316 hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
317
318 return hr;
319}
static HRESULT BaseControlVideoImpl_CheckSourceRect(BaseControlVideo *This, RECT *pSourceRect)
Definition: video.c:56

◆ BaseControlVideoImpl_put_SourceLeft()

HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft ( IBasicVideo *  iface,
LONG  SourceLeft 
)

Definition at line 201 of file video.c.

202{
203 RECT SourceRect;
204 BaseControlVideo *This = impl_from_IBasicVideo(iface);
205 HRESULT hr;
206
207 TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft);
208 hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
209 if (SUCCEEDED(hr))
210 {
211 SourceRect.right = (SourceRect.right - SourceRect.left) + SourceLeft;
212 SourceRect.left = SourceLeft;
214 }
215 if (SUCCEEDED(hr))
216 hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
217
218 return hr;
219}

◆ BaseControlVideoImpl_put_SourceTop()

HRESULT WINAPI BaseControlVideoImpl_put_SourceTop ( IBasicVideo *  iface,
LONG  SourceTop 
)

Definition at line 268 of file video.c.

269{
270 RECT SourceRect;
271 BaseControlVideo *This = impl_from_IBasicVideo(iface);
272 HRESULT hr;
273
274 TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop);
275 hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
276 if (SUCCEEDED(hr))
277 {
278 SourceRect.bottom = (SourceRect.bottom - SourceRect.top) + SourceTop;
279 SourceRect.top = SourceTop;
281 }
282 if (SUCCEEDED(hr))
283 hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
284
285 return hr;
286}

◆ BaseControlVideoImpl_put_SourceWidth()

HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth ( IBasicVideo *  iface,
LONG  SourceWidth 
)

Definition at line 235 of file video.c.

236{
237 RECT SourceRect;
238 BaseControlVideo *This = impl_from_IBasicVideo(iface);
239 HRESULT hr;
240
241 TRACE("(%p/%p)->(%d)\n", This, iface, SourceWidth);
242 hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
243 if (SUCCEEDED(hr))
244 {
245 SourceRect.right = SourceRect.left + SourceWidth;
247 }
248 if (SUCCEEDED(hr))
249 hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
250
251 return hr;
252}

◆ BaseControlVideoImpl_SetDefaultDestinationPosition()

HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition ( IBasicVideo *  iface)

Definition at line 540 of file video.c.

541{
542 BaseControlVideo *This = impl_from_IBasicVideo(iface);
543
544 TRACE("(%p/%p)->()\n", This, iface);
545 return This->pFuncsTable->pfnSetDefaultTargetRect(This);
546}

◆ BaseControlVideoImpl_SetDefaultSourcePosition()

HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition ( IBasicVideo *  iface)

Definition at line 501 of file video.c.

502{
503 BaseControlVideo *This = impl_from_IBasicVideo(iface);
504
505 TRACE("(%p/%p)->()\n", This, iface);
506 return This->pFuncsTable->pfnSetDefaultSourceRect(This);
507}

◆ BaseControlVideoImpl_SetDestinationPosition()

HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition ( IBasicVideo *  iface,
LONG  Left,
LONG  Top,
LONG  Width,
LONG  Height 
)

Definition at line 509 of file video.c.

510{
511 RECT DestRect;
512 BaseControlVideo *This = impl_from_IBasicVideo(iface);
513
514 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
515
516 SetRect(&DestRect, Left, Top, Left + Width, Top + Height);
518 return E_INVALIDARG;
519 return This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
520}
static LPHIST_ENTRY Top
Definition: history.c:53
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

◆ BaseControlVideoImpl_SetSourcePosition()

HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition ( IBasicVideo *  iface,
LONG  Left,
LONG  Top,
LONG  Width,
LONG  Height 
)

Definition at line 470 of file video.c.

471{
472 RECT SourceRect;
473 BaseControlVideo *This = impl_from_IBasicVideo(iface);
474
475 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
476
477 SetRect(&SourceRect, Left, Top, Left + Width, Top + Height);
479 return E_INVALIDARG;
480 return This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
481}

◆ impl_from_IBasicVideo()

static BaseControlVideo * impl_from_IBasicVideo ( IBasicVideo *  iface)
inlinestatic

Definition at line 33 of file video.c.

34{
35 return CONTAINING_RECORD(iface, BaseControlVideo, IBasicVideo_iface);
36}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by BaseControlVideoImpl_get_AvgTimePerFrame(), BaseControlVideoImpl_get_BitErrorRate(), BaseControlVideoImpl_get_BitRate(), BaseControlVideoImpl_get_DestinationHeight(), BaseControlVideoImpl_get_DestinationLeft(), BaseControlVideoImpl_get_DestinationTop(), BaseControlVideoImpl_get_DestinationWidth(), BaseControlVideoImpl_get_SourceHeight(), BaseControlVideoImpl_get_SourceLeft(), BaseControlVideoImpl_get_SourceTop(), BaseControlVideoImpl_get_SourceWidth(), BaseControlVideoImpl_get_VideoHeight(), BaseControlVideoImpl_get_VideoWidth(), BaseControlVideoImpl_GetCurrentImage(), BaseControlVideoImpl_GetDestinationPosition(), BaseControlVideoImpl_GetIDsOfNames(), BaseControlVideoImpl_GetSourcePosition(), BaseControlVideoImpl_GetTypeInfo(), BaseControlVideoImpl_GetTypeInfoCount(), BaseControlVideoImpl_GetVideoPaletteEntries(), BaseControlVideoImpl_GetVideoSize(), BaseControlVideoImpl_Invoke(), BaseControlVideoImpl_IsUsingDefaultDestination(), BaseControlVideoImpl_IsUsingDefaultSource(), BaseControlVideoImpl_put_DestinationHeight(), BaseControlVideoImpl_put_DestinationLeft(), BaseControlVideoImpl_put_DestinationTop(), BaseControlVideoImpl_put_DestinationWidth(), BaseControlVideoImpl_put_SourceHeight(), BaseControlVideoImpl_put_SourceLeft(), BaseControlVideoImpl_put_SourceTop(), BaseControlVideoImpl_put_SourceWidth(), BaseControlVideoImpl_SetDefaultDestinationPosition(), BaseControlVideoImpl_SetDefaultSourcePosition(), BaseControlVideoImpl_SetDestinationPosition(), and BaseControlVideoImpl_SetSourcePosition().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( strmbase  )