[Wine] Question about wine qcap v4l's MediaSampleTime

babykarma wineforum-user at winehq.org
Mon Jun 21 05:53:47 CDT 2010

in wine/dlls/qcap/v4l.c: 
--> OutputPin_GetDeliveryBuffer((OutputPin *)capBox->pOut, &pSample, NULL, NULL, 0); 
      --> IMediaSample_SetTime(*ppSample, tStart, tStop);

in wine/dlls/quartz/memallocator.c:
StdMediaSample2_GetTime(IMediaSample2 * iface, REFERENCE_TIME * pStart, REFERENCE_TIME * pEnd)
--> if tstart/stop is NULL, leave pStart/pEnd not setted.

in wine/dlls/quartz/videorenderer.c:
VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
--> IMediaSample_GetTime(pSample, &tStart, &tStop)
--> use tStart/tStop and current time to judge when to show the sample
--> VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);

why does OutputPin_GetDeliveryBuffer() set the MediaSample's start and stop reference time both to NULL? Consider this situation, we build a filter graph, use vfwcapture as capture filter, then connect it to any video renderer, of course video render will try to get MediaSample's start and stop reference time to decide when to show this media sample, but since both start and stop time is NULL, so when VideoRenderer_Sample call IMediaSample_GetTime(pSample, &tStart, &tStop), tStart/tStop's value is not set, it can be any initial value. Thus video render cannot get correct result from synchronisation,  maybe no media sample can be  VideoRenderer_SendSampleData().

I've checked wine-1.2-rc2's source code. Very strange, so it seems that whenever qcap's video capture + quartz's video render and use clock, no video will be displayed correctly.

Anyone can give me some guide?

More information about the wine-users mailing list