Maarten Lankhorst : quartz: Implement IBasicVideo get_AvgTimePerFrame.

Alexandre Julliard julliard at winehq.org
Tue May 18 12:32:56 CDT 2010


Module: wine
Branch: master
Commit: 44827a0336af4838940a81362c7918dfd8e68d0e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=44827a0336af4838940a81362c7918dfd8e68d0e

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Mon May 17 21:32:32 2010 +0200

quartz: Implement IBasicVideo get_AvgTimePerFrame.

---

 dlls/quartz/videorenderer.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index b31959e..ed8f24e 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -1176,10 +1176,25 @@ static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
 /*** IBasicVideo methods ***/
 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
 						     REFTIME *pAvgTimePerFrame) {
+    AM_MEDIA_TYPE *pmt;
     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
 
-    FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
+    if (!This->pInputPin->pin.pConnectedTo)
+        return VFW_E_NOT_CONNECTED;
 
+    TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame);
+
+    pmt = &This->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;
 }
 




More information about the wine-cvs mailing list