Link to home
Start Free TrialLog in
Avatar of MrCookJr2011
MrCookJr2011Flag for United States of America

asked on

TestCap based virtual video driver problems with Windows 8.1

Hello everyone.

Our driver is based on a pretty old Microsoft sample driver named TestCap.
However, it has been working great for years (since 2006).
But the latest Windows 8.1 has changed something and our driver does not work
properly with Metro apps (e.g. Skype for Metro, Camera app). In desktop mode it
still works great with most applications.

It seems to me that I found the reason of the problem.
In my driver, I do not set correct presentation times for the stream.
With DirectShow client application, I receive the SRB_INDICATE_MASTER_CLOCK
event in HwReceiveControlPacket callback and therefore I am able to use this
clock to set timestamps.

case SRB_INDICATE_MASTER_CLOCK:
    PSTREAMEX pStrmEx = (PSTREAMEX)pSrb->StreamObject->HwStreamExtension;
    pStrmEx->hMasterClock = pSrb->CommandData.MasterClockHandle;
    break;


With MediaFoundation client application, I do not receive this event so I never
set correct timestamps.
Here's a piece of code:

if (pStrmEx->hMasterClock )
{             
    pDataPacket->PresentationTime.Time = pStrmEx->QST_StreamTime;
    pDataPacket->OptionsFlags |= KSSTREAM_HEADER_OPTIONSF_TIMEVALID |
KSSTREAM_HEADER_OPTIONSF_DURATIONVALID;
}
else
{
    // no clock or the preview stream, so just mark the time as unknown and
clear the timestamp valid flags
    pDataPacket->PresentationTime.Time = 0;
    pDataPacket->OptionsFlags &= ~(KSSTREAM_HEADER_OPTIONSF_TIMEVALID
|      KSSTREAM_HEADER_OPTIONSF_DURATIONVALID);
}

I'm not sure how to resolve this but I feel that this might be the reason of the
problem.
Should I create my own Clock in such case? Or maybe there is some other event
that MediaFoundation framework is signalling in order to set up master clock?

Your help is very appreciated.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of MrCookJr2011
MrCookJr2011
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial