Implement ResetDC and PHYSICALOFFSET[X|Y] devcaps.
[wine] / dlls / quartz / seekpass.c
1 /*
2  *      Implementation of CLSID_SeekingPassThru
3  *
4  *      FIXME - not tested yet.
5  *
6  * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "config.h"
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "winuser.h"
29 #include "winerror.h"
30 #include "strmif.h"
31 #include "control.h"
32 #include "uuids.h"
33
34 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
36
37 #include "quartz_private.h"
38 #include "seekpass.h"
39
40
41 /***************************************************************************
42  *
43  *      CSeekingPassThru::ISeekingPassThru
44  *
45  */
46
47 static HRESULT WINAPI
48 ISeekingPassThru_fnQueryInterface(ISeekingPassThru* iface,REFIID riid,void** ppobj)
49 {
50         CSeekingPassThru_THIS(iface,seekpass);
51
52         TRACE("(%p)->()\n",This);
53
54         return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
55 }
56
57 static ULONG WINAPI
58 ISeekingPassThru_fnAddRef(ISeekingPassThru* iface)
59 {
60         CSeekingPassThru_THIS(iface,seekpass);
61
62         TRACE("(%p)->()\n",This);
63
64         return IUnknown_AddRef(This->unk.punkControl);
65 }
66
67 static ULONG WINAPI
68 ISeekingPassThru_fnRelease(ISeekingPassThru* iface)
69 {
70         CSeekingPassThru_THIS(iface,seekpass);
71
72         TRACE("(%p)->()\n",This);
73
74         return IUnknown_Release(This->unk.punkControl);
75 }
76
77 static HRESULT WINAPI
78 ISeekingPassThru_fnInit(ISeekingPassThru* iface,BOOL bRendering,IPin* pPin)
79 {
80         CSeekingPassThru_THIS(iface,seekpass);
81
82         FIXME("(%p)->(%d,%p) not tested!\n",This,bRendering,pPin);
83
84         if ( pPin == NULL )
85                 return E_POINTER;
86
87         /* Why is 'bRendering' given as an argument?? */
88         EnterCriticalSection( &This->cs );
89
90         if ( This->passthru.pPin != NULL )
91                 IPin_Release( This->passthru.pPin );
92         This->passthru.pPin = pPin; IPin_AddRef( pPin );
93
94         LeaveCriticalSection( &This->cs );
95
96         return NOERROR;
97 }
98
99
100 static ICOM_VTABLE(ISeekingPassThru) iseekingpassthru =
101 {
102         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
103         /* IUnknown fields */
104         ISeekingPassThru_fnQueryInterface,
105         ISeekingPassThru_fnAddRef,
106         ISeekingPassThru_fnRelease,
107         /* ISeekingPassThru fields */
108         ISeekingPassThru_fnInit,
109 };
110
111 static
112 HRESULT CSeekingPassThru_InitISeekingPassThru(CSeekingPassThru* This)
113 {
114         TRACE("(%p)\n",This);
115         ICOM_VTBL(&This->seekpass) = &iseekingpassthru;
116         This->passthru.punk = This->unk.punkControl;
117         This->passthru.pPin = NULL;
118         InitializeCriticalSection( &This->cs );
119
120         return NOERROR;
121 }
122
123 static
124 void CSeekingPassThru_UninitISeekingPassThru(CSeekingPassThru* This)
125 {
126         TRACE("(%p)\n",This);
127         if ( This->passthru.pPin != NULL )
128         {
129                 IPin_Release( This->passthru.pPin );
130                 This->passthru.pPin = NULL;
131         }
132         DeleteCriticalSection( &This->cs );
133 }
134
135 /***************************************************************************
136  *
137  *      new/delete for CLSID_SeekingPassThru.
138  *
139  */
140
141 /* can I use offsetof safely? - FIXME? */
142 static QUARTZ_IFEntry IFEntries[] =
143 {
144   { &IID_ISeekingPassThru, offsetof(CSeekingPassThru,seekpass)-offsetof(CSeekingPassThru,unk) },
145   { &IID_IMediaPosition, offsetof(CSeekingPassThru,passthru.mpos)-offsetof(CSeekingPassThru,unk) },
146   { &IID_IMediaSeeking, offsetof(CSeekingPassThru,passthru.mseek)-offsetof(CSeekingPassThru,unk) },
147 };
148
149
150 static void QUARTZ_DestroySeekingPassThru(IUnknown* punk)
151 {
152         CSeekingPassThru_THIS(punk,unk);
153
154         TRACE("(%p)\n",This);
155
156         CPassThruImpl_UninitIMediaSeeking( &This->passthru );
157         CPassThruImpl_UninitIMediaPosition( &This->passthru );
158         CSeekingPassThru_UninitISeekingPassThru(This);
159 }
160
161 HRESULT QUARTZ_CreateSeekingPassThru(IUnknown* punkOuter,void** ppobj)
162 {
163         HRESULT hr;
164         CSeekingPassThru*       This;
165
166         TRACE("(%p,%p)\n",punkOuter,ppobj);
167
168         hr = QUARTZ_CreateSeekingPassThruInternal(punkOuter,&This,FALSE,NULL);
169         if ( hr != S_OK )
170                 return hr;
171
172         ppobj = (void*)(&This->unk);
173
174         return NOERROR;
175 }
176
177 HRESULT QUARTZ_CreateSeekingPassThruInternal(IUnknown* punkOuter,CSeekingPassThru** ppobj,BOOL bRendering,IPin* pPin)
178 {
179         CSeekingPassThru*       This;
180         HRESULT hr;
181
182         TRACE("(%p,%p,%d,%p)\n",punkOuter,ppobj,(int)bRendering,pPin);
183
184         This = (CSeekingPassThru*)QUARTZ_AllocObj( sizeof(CSeekingPassThru) );
185         if ( This == NULL )
186                 return E_OUTOFMEMORY;
187
188         QUARTZ_IUnkInit( &This->unk, punkOuter );
189         hr = CSeekingPassThru_InitISeekingPassThru(This);
190         if ( SUCCEEDED(hr) )
191         {
192                 hr = CPassThruImpl_InitIMediaPosition( &This->passthru );
193                 if ( SUCCEEDED(hr) )
194                 {
195                         hr = CPassThruImpl_InitIMediaSeeking( &This->passthru );
196                         if ( FAILED(hr) )
197                         {
198                                 CPassThruImpl_UninitIMediaPosition( &This->passthru );
199                         }
200                 }
201                 else
202                 {
203                         CSeekingPassThru_UninitISeekingPassThru(This);
204                 }
205         }
206
207         if ( FAILED(hr) )
208         {
209                 QUARTZ_FreeObj( This );
210                 return hr;
211         }
212
213         This->unk.pEntries = IFEntries;
214         This->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
215         This->unk.pOnFinalRelease = QUARTZ_DestroySeekingPassThru;
216
217         *ppobj = This;
218
219         if ( pPin != NULL )
220         {
221                 hr = ISeekingPassThru_Init((ISeekingPassThru*)(&This->seekpass),bRendering,pPin);
222                 if ( FAILED(hr) )
223                 {
224                         IUnknown_Release(This->unk.punkControl);
225                         return hr;
226                 }
227         }
228
229         return S_OK;
230 }
231
232
233
234
235 /***************************************************************************
236  *
237  *      CPassThruImpl Helper methods.
238  *
239  */
240
241 static
242 HRESULT CPassThruImpl_GetConnected( CPassThruImpl* pImpl, IPin** ppPin )
243 {
244         return IPin_ConnectedTo( pImpl->pPin, ppPin );
245 }
246
247 HRESULT CPassThruImpl_QueryPosPass(
248         CPassThruImpl* pImpl, IMediaPosition** ppPosition )
249 {
250         IPin*   pPin;
251         HRESULT hr;
252
253         hr = CPassThruImpl_GetConnected( pImpl, &pPin );
254         if ( FAILED(hr) )
255                 return hr;
256         hr = IPin_QueryInterface(pPin,&IID_IMediaPosition,(void**)ppPosition);
257         IPin_Release(pPin);
258
259         return hr;
260 }
261
262 HRESULT CPassThruImpl_QuerySeekPass(
263         CPassThruImpl* pImpl, IMediaSeeking** ppSeeking )
264 {
265         IPin*   pPin;
266         HRESULT hr;
267
268         hr = CPassThruImpl_GetConnected( pImpl, &pPin );
269         if ( FAILED(hr) )
270                 return hr;
271         hr = IPin_QueryInterface(pPin,&IID_IMediaSeeking,(void**)ppSeeking);
272         IPin_Release(pPin);
273
274         return hr;
275 }
276
277 /***************************************************************************
278  *
279  *      An implementation for CPassThruImpl::IMediaPosition.
280  *
281  */
282
283
284 #define QUERYPOSPASS \
285         IMediaPosition* pPos = NULL; \
286         HRESULT hr; \
287         hr = CPassThruImpl_QueryPosPass( This, &pPos ); \
288         if ( FAILED(hr) ) return hr;
289
290 static HRESULT WINAPI
291 IMediaPosition_fnQueryInterface(IMediaPosition* iface,REFIID riid,void** ppobj)
292 {
293         CPassThruImpl_THIS(iface,mpos);
294
295         TRACE("(%p)->()\n",This);
296
297         return IUnknown_QueryInterface(This->punk,riid,ppobj);
298 }
299
300 static ULONG WINAPI
301 IMediaPosition_fnAddRef(IMediaPosition* iface)
302 {
303         CPassThruImpl_THIS(iface,mpos);
304
305         TRACE("(%p)->()\n",This);
306
307         return IUnknown_AddRef(This->punk);
308 }
309
310 static ULONG WINAPI
311 IMediaPosition_fnRelease(IMediaPosition* iface)
312 {
313         CPassThruImpl_THIS(iface,mpos);
314
315         TRACE("(%p)->()\n",This);
316
317         return IUnknown_Release(This->punk);
318 }
319
320 static HRESULT WINAPI
321 IMediaPosition_fnGetTypeInfoCount(IMediaPosition* iface,UINT* pcTypeInfo)
322 {
323         CPassThruImpl_THIS(iface,mpos);
324
325         FIXME("(%p)->() stub!\n",This);
326
327         return E_NOTIMPL;
328 }
329
330 static HRESULT WINAPI
331 IMediaPosition_fnGetTypeInfo(IMediaPosition* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
332 {
333         CPassThruImpl_THIS(iface,mpos);
334
335         FIXME("(%p)->() stub!\n",This);
336
337         return E_NOTIMPL;
338 }
339
340 static HRESULT WINAPI
341 IMediaPosition_fnGetIDsOfNames(IMediaPosition* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
342 {
343         CPassThruImpl_THIS(iface,mpos);
344
345         FIXME("(%p)->() stub!\n",This);
346
347         return E_NOTIMPL;
348 }
349
350 static HRESULT WINAPI
351 IMediaPosition_fnInvoke(IMediaPosition* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
352 {
353         CPassThruImpl_THIS(iface,mpos);
354
355         FIXME("(%p)->() stub!\n",This);
356
357         return E_NOTIMPL;
358 }
359
360
361 static HRESULT WINAPI
362 IMediaPosition_fnget_Duration(IMediaPosition* iface,REFTIME* prefTime)
363 {
364         CPassThruImpl_THIS(iface,mpos);
365         QUERYPOSPASS
366
367         TRACE("(%p)->()\n",This);
368
369         hr = IMediaPosition_get_Duration(pPos,prefTime);
370         IMediaPosition_Release(pPos);
371         return hr;
372 }
373
374 static HRESULT WINAPI
375 IMediaPosition_fnput_CurrentPosition(IMediaPosition* iface,REFTIME refTime)
376 {
377         CPassThruImpl_THIS(iface,mpos);
378         QUERYPOSPASS
379
380         TRACE("(%p)->()\n",This);
381
382         hr = IMediaPosition_put_CurrentPosition(pPos,refTime);
383         IMediaPosition_Release(pPos);
384         return hr;
385 }
386
387 static HRESULT WINAPI
388 IMediaPosition_fnget_CurrentPosition(IMediaPosition* iface,REFTIME* prefTime)
389 {
390         CPassThruImpl_THIS(iface,mpos);
391         QUERYPOSPASS
392
393         TRACE("(%p)->()\n",This);
394
395         hr = IMediaPosition_get_CurrentPosition(pPos,prefTime);
396         IMediaPosition_Release(pPos);
397         return hr;
398 }
399
400 static HRESULT WINAPI
401 IMediaPosition_fnget_StopTime(IMediaPosition* iface,REFTIME* prefTime)
402 {
403         CPassThruImpl_THIS(iface,mpos);
404         QUERYPOSPASS
405
406         TRACE("(%p)->()\n",This);
407
408         hr = IMediaPosition_get_StopTime(pPos,prefTime);
409         IMediaPosition_Release(pPos);
410         return hr;
411 }
412
413 static HRESULT WINAPI
414 IMediaPosition_fnput_StopTime(IMediaPosition* iface,REFTIME refTime)
415 {
416         CPassThruImpl_THIS(iface,mpos);
417         QUERYPOSPASS
418
419         TRACE("(%p)->()\n",This);
420
421         hr = IMediaPosition_put_StopTime(pPos,refTime);
422         IMediaPosition_Release(pPos);
423         return hr;
424 }
425
426 static HRESULT WINAPI
427 IMediaPosition_fnget_PrerollTime(IMediaPosition* iface,REFTIME* prefTime)
428 {
429         CPassThruImpl_THIS(iface,mpos);
430         QUERYPOSPASS
431
432         TRACE("(%p)->()\n",This);
433
434         hr = IMediaPosition_get_PrerollTime(pPos,prefTime);
435         IMediaPosition_Release(pPos);
436         return hr;
437 }
438
439 static HRESULT WINAPI
440 IMediaPosition_fnput_PrerollTime(IMediaPosition* iface,REFTIME refTime)
441 {
442         CPassThruImpl_THIS(iface,mpos);
443         QUERYPOSPASS
444
445         TRACE("(%p)->()\n",This);
446
447         hr = IMediaPosition_put_PrerollTime(pPos,refTime);
448         IMediaPosition_Release(pPos);
449         return hr;
450 }
451
452 static HRESULT WINAPI
453 IMediaPosition_fnput_Rate(IMediaPosition* iface,double dblRate)
454 {
455         CPassThruImpl_THIS(iface,mpos);
456         QUERYPOSPASS
457
458         TRACE("(%p)->()\n",This);
459
460         hr = IMediaPosition_put_Rate(pPos,dblRate);
461         IMediaPosition_Release(pPos);
462         return hr;
463 }
464
465 static HRESULT WINAPI
466 IMediaPosition_fnget_Rate(IMediaPosition* iface,double* pdblRate)
467 {
468         CPassThruImpl_THIS(iface,mpos);
469         QUERYPOSPASS
470
471         TRACE("(%p)->()\n",This);
472
473         hr = IMediaPosition_get_Rate(pPos,pdblRate);
474         IMediaPosition_Release(pPos);
475         return hr;
476 }
477
478 static HRESULT WINAPI
479 IMediaPosition_fnCanSeekForward(IMediaPosition* iface,LONG* pCanSeek)
480 {
481         CPassThruImpl_THIS(iface,mpos);
482         QUERYPOSPASS
483
484         TRACE("(%p)->()\n",This);
485
486         hr = IMediaPosition_CanSeekForward(pPos,pCanSeek);
487         IMediaPosition_Release(pPos);
488         return hr;
489 }
490
491 static HRESULT WINAPI
492 IMediaPosition_fnCanSeekBackward(IMediaPosition* iface,LONG* pCanSeek)
493 {
494         CPassThruImpl_THIS(iface,mpos);
495         QUERYPOSPASS
496
497         TRACE("(%p)->()\n",This);
498
499         hr = IMediaPosition_CanSeekBackward(pPos,pCanSeek);
500         IMediaPosition_Release(pPos);
501         return hr;
502 }
503
504
505 static ICOM_VTABLE(IMediaPosition) impos =
506 {
507         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
508         /* IUnknown fields */
509         IMediaPosition_fnQueryInterface,
510         IMediaPosition_fnAddRef,
511         IMediaPosition_fnRelease,
512         /* IDispatch fields */
513         IMediaPosition_fnGetTypeInfoCount,
514         IMediaPosition_fnGetTypeInfo,
515         IMediaPosition_fnGetIDsOfNames,
516         IMediaPosition_fnInvoke,
517         /* IMediaPosition fields */
518         IMediaPosition_fnget_Duration,
519         IMediaPosition_fnput_CurrentPosition,
520         IMediaPosition_fnget_CurrentPosition,
521         IMediaPosition_fnget_StopTime,
522         IMediaPosition_fnput_StopTime,
523         IMediaPosition_fnget_PrerollTime,
524         IMediaPosition_fnput_PrerollTime,
525         IMediaPosition_fnput_Rate,
526         IMediaPosition_fnget_Rate,
527         IMediaPosition_fnCanSeekForward,
528         IMediaPosition_fnCanSeekBackward,
529 };
530
531
532 HRESULT CPassThruImpl_InitIMediaPosition( CPassThruImpl* pImpl )
533 {
534         TRACE("(%p)\n",pImpl);
535         ICOM_VTBL(&pImpl->mpos) = &impos;
536
537         return NOERROR;
538 }
539
540 void CPassThruImpl_UninitIMediaPosition( CPassThruImpl* pImpl )
541 {
542         TRACE("(%p)\n",pImpl);
543 }
544
545 #undef QUERYPOSPASS
546
547
548 /***************************************************************************
549  *
550  *      An implementation for CPassThruImpl::IMediaSeeking.
551  *
552  */
553
554 #define QUERYSEEKPASS \
555         IMediaSeeking* pSeek = NULL; \
556         HRESULT hr; \
557         hr = CPassThruImpl_QuerySeekPass( This, &pSeek ); \
558         if ( FAILED(hr) ) return hr;
559
560
561 static HRESULT WINAPI
562 IMediaSeeking_fnQueryInterface(IMediaSeeking* iface,REFIID riid,void** ppobj)
563 {
564         CPassThruImpl_THIS(iface,mseek);
565
566         TRACE("(%p)->()\n",This);
567
568         return IUnknown_QueryInterface(This->punk,riid,ppobj);
569 }
570
571 static ULONG WINAPI
572 IMediaSeeking_fnAddRef(IMediaSeeking* iface)
573 {
574         CPassThruImpl_THIS(iface,mseek);
575
576         TRACE("(%p)->()\n",This);
577
578         return IUnknown_AddRef(This->punk);
579 }
580
581 static ULONG WINAPI
582 IMediaSeeking_fnRelease(IMediaSeeking* iface)
583 {
584         CPassThruImpl_THIS(iface,mseek);
585
586         TRACE("(%p)->()\n",This);
587
588         return IUnknown_Release(This->punk);
589 }
590
591
592 static HRESULT WINAPI
593 IMediaSeeking_fnGetCapabilities(IMediaSeeking* iface,DWORD* pdwCaps)
594 {
595         CPassThruImpl_THIS(iface,mseek);
596         QUERYSEEKPASS
597
598         TRACE("(%p)->()\n",This);
599
600         hr = IMediaSeeking_GetCapabilities(pSeek,pdwCaps);
601         IMediaSeeking_Release(pSeek);
602         return hr;
603 }
604
605 static HRESULT WINAPI
606 IMediaSeeking_fnCheckCapabilities(IMediaSeeking* iface,DWORD* pdwCaps)
607 {
608         CPassThruImpl_THIS(iface,mseek);
609         QUERYSEEKPASS
610
611         TRACE("(%p)->()\n",This);
612
613         hr = IMediaSeeking_CheckCapabilities(pSeek,pdwCaps);
614         IMediaSeeking_Release(pSeek);
615         return hr;
616 }
617
618 static HRESULT WINAPI
619 IMediaSeeking_fnIsFormatSupported(IMediaSeeking* iface,const GUID* pidFormat)
620 {
621         CPassThruImpl_THIS(iface,mseek);
622         QUERYSEEKPASS
623
624         TRACE("(%p)->()\n",This);
625
626         hr = IMediaSeeking_IsFormatSupported(pSeek,pidFormat);
627         IMediaSeeking_Release(pSeek);
628         return hr;
629 }
630
631 static HRESULT WINAPI
632 IMediaSeeking_fnQueryPreferredFormat(IMediaSeeking* iface,GUID* pidFormat)
633 {
634         CPassThruImpl_THIS(iface,mseek);
635         QUERYSEEKPASS
636
637         TRACE("(%p)->()\n",This);
638
639         hr = IMediaSeeking_QueryPreferredFormat(pSeek,pidFormat);
640         IMediaSeeking_Release(pSeek);
641         return hr;
642 }
643
644 static HRESULT WINAPI
645 IMediaSeeking_fnGetTimeFormat(IMediaSeeking* iface,GUID* pidFormat)
646 {
647         CPassThruImpl_THIS(iface,mseek);
648         QUERYSEEKPASS
649
650         TRACE("(%p)->()\n",This);
651
652         hr = IMediaSeeking_GetTimeFormat(pSeek,pidFormat);
653         IMediaSeeking_Release(pSeek);
654         return hr;
655 }
656
657 static HRESULT WINAPI
658 IMediaSeeking_fnIsUsingTimeFormat(IMediaSeeking* iface,const GUID* pidFormat)
659 {
660         CPassThruImpl_THIS(iface,mseek);
661         QUERYSEEKPASS
662
663         TRACE("(%p)->()\n",This);
664
665         hr = IMediaSeeking_IsUsingTimeFormat(pSeek,pidFormat);
666         IMediaSeeking_Release(pSeek);
667         return hr;
668 }
669
670 static HRESULT WINAPI
671 IMediaSeeking_fnSetTimeFormat(IMediaSeeking* iface,const GUID* pidFormat)
672 {
673         CPassThruImpl_THIS(iface,mseek);
674         QUERYSEEKPASS
675
676         TRACE("(%p)->()\n",This);
677
678         hr = IMediaSeeking_SetTimeFormat(pSeek,pidFormat);
679         IMediaSeeking_Release(pSeek);
680         return hr;
681 }
682
683 static HRESULT WINAPI
684 IMediaSeeking_fnGetDuration(IMediaSeeking* iface,LONGLONG* pllDuration)
685 {
686         CPassThruImpl_THIS(iface,mseek);
687         QUERYSEEKPASS
688
689         TRACE("(%p)->()\n",This);
690
691         hr = IMediaSeeking_GetDuration(pSeek,pllDuration);
692         IMediaSeeking_Release(pSeek);
693         return hr;
694 }
695
696 static HRESULT WINAPI
697 IMediaSeeking_fnGetStopPosition(IMediaSeeking* iface,LONGLONG* pllPos)
698 {
699         CPassThruImpl_THIS(iface,mseek);
700         QUERYSEEKPASS
701
702         TRACE("(%p)->()\n",This);
703
704         hr = IMediaSeeking_GetStopPosition(pSeek,pllPos);
705         IMediaSeeking_Release(pSeek);
706         return hr;
707 }
708
709 static HRESULT WINAPI
710 IMediaSeeking_fnGetCurrentPosition(IMediaSeeking* iface,LONGLONG* pllPos)
711 {
712         CPassThruImpl_THIS(iface,mseek);
713         QUERYSEEKPASS
714
715         TRACE("(%p)->()\n",This);
716
717         hr = IMediaSeeking_GetCurrentPosition(pSeek,pllPos);
718         IMediaSeeking_Release(pSeek);
719         return hr;
720 }
721
722 static HRESULT WINAPI
723 IMediaSeeking_fnConvertTimeFormat(IMediaSeeking* iface,LONGLONG* pllOut,const GUID* pidFmtOut,LONGLONG llIn,const GUID* pidFmtIn)
724 {
725         CPassThruImpl_THIS(iface,mseek);
726         QUERYSEEKPASS
727
728         TRACE("(%p)->()\n",This);
729
730         hr = IMediaSeeking_ConvertTimeFormat(pSeek,pllOut,pidFmtOut,llIn,pidFmtIn);
731         IMediaSeeking_Release(pSeek);
732         return hr;
733 }
734
735 static HRESULT WINAPI
736 IMediaSeeking_fnSetPositions(IMediaSeeking* iface,LONGLONG* pllCur,DWORD dwCurFlags,LONGLONG* pllStop,DWORD dwStopFlags)
737 {
738         CPassThruImpl_THIS(iface,mseek);
739         QUERYSEEKPASS
740
741         TRACE("(%p)->()\n",This);
742
743         hr = IMediaSeeking_SetPositions(pSeek,pllCur,dwCurFlags,pllStop,dwStopFlags);
744         IMediaSeeking_Release(pSeek);
745         return hr;
746 }
747
748 static HRESULT WINAPI
749 IMediaSeeking_fnGetPositions(IMediaSeeking* iface,LONGLONG* pllCur,LONGLONG* pllStop)
750 {
751         CPassThruImpl_THIS(iface,mseek);
752         QUERYSEEKPASS
753
754         TRACE("(%p)->()\n",This);
755
756         hr = IMediaSeeking_GetPositions(pSeek,pllCur,pllStop);
757         IMediaSeeking_Release(pSeek);
758         return hr;
759 }
760
761 static HRESULT WINAPI
762 IMediaSeeking_fnGetAvailable(IMediaSeeking* iface,LONGLONG* pllFirst,LONGLONG* pllLast)
763 {
764         CPassThruImpl_THIS(iface,mseek);
765         QUERYSEEKPASS
766
767         TRACE("(%p)->()\n",This);
768
769         hr = IMediaSeeking_GetAvailable(pSeek,pllFirst,pllLast);
770         IMediaSeeking_Release(pSeek);
771         return hr;
772 }
773
774 static HRESULT WINAPI
775 IMediaSeeking_fnSetRate(IMediaSeeking* iface,double dblRate)
776 {
777         CPassThruImpl_THIS(iface,mseek);
778         QUERYSEEKPASS
779
780         TRACE("(%p)->()\n",This);
781
782         hr = IMediaSeeking_SetRate(pSeek,dblRate);
783         IMediaSeeking_Release(pSeek);
784         return hr;
785 }
786
787 static HRESULT WINAPI
788 IMediaSeeking_fnGetRate(IMediaSeeking* iface,double* pdblRate)
789 {
790         CPassThruImpl_THIS(iface,mseek);
791         QUERYSEEKPASS
792
793         TRACE("(%p)->()\n",This);
794
795         hr = IMediaSeeking_GetRate(pSeek,pdblRate);
796         IMediaSeeking_Release(pSeek);
797         return hr;
798 }
799
800 static HRESULT WINAPI
801 IMediaSeeking_fnGetPreroll(IMediaSeeking* iface,LONGLONG* pllPreroll)
802 {
803         CPassThruImpl_THIS(iface,mseek);
804         QUERYSEEKPASS
805
806         TRACE("(%p)->()\n",This);
807
808         hr = IMediaSeeking_GetPreroll(pSeek,pllPreroll);
809         IMediaSeeking_Release(pSeek);
810         return hr;
811 }
812
813
814
815
816 static ICOM_VTABLE(IMediaSeeking) imseek =
817 {
818         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
819         /* IUnknown fields */
820         IMediaSeeking_fnQueryInterface,
821         IMediaSeeking_fnAddRef,
822         IMediaSeeking_fnRelease,
823         /* IMediaSeeking fields */
824         IMediaSeeking_fnGetCapabilities,
825         IMediaSeeking_fnCheckCapabilities,
826         IMediaSeeking_fnIsFormatSupported,
827         IMediaSeeking_fnQueryPreferredFormat,
828         IMediaSeeking_fnGetTimeFormat,
829         IMediaSeeking_fnIsUsingTimeFormat,
830         IMediaSeeking_fnSetTimeFormat,
831         IMediaSeeking_fnGetDuration,
832         IMediaSeeking_fnGetStopPosition,
833         IMediaSeeking_fnGetCurrentPosition,
834         IMediaSeeking_fnConvertTimeFormat,
835         IMediaSeeking_fnSetPositions,
836         IMediaSeeking_fnGetPositions,
837         IMediaSeeking_fnGetAvailable,
838         IMediaSeeking_fnSetRate,
839         IMediaSeeking_fnGetRate,
840         IMediaSeeking_fnGetPreroll,
841 };
842
843
844
845 HRESULT CPassThruImpl_InitIMediaSeeking( CPassThruImpl* pImpl )
846 {
847         TRACE("(%p)\n",pImpl);
848         ICOM_VTBL(&pImpl->mseek) = &imseek;
849
850         return NOERROR;
851 }
852
853 void CPassThruImpl_UninitIMediaSeeking( CPassThruImpl* pImpl )
854 {
855         TRACE("(%p)\n",pImpl);
856 }
857
858 #undef QUERYSEEKPASS