Solved

TestCap based virtual video driver problems with Windows 8.1

Posted on 2014-04-07
1
633 Views
Last Modified: 2014-04-08
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
0
Comment
Question by:MrCookJr2011
1 Comment
 

Accepted Solution

by:
MrCookJr2011 earned 0 total points
ID: 39987881
Finally, I have figured out the reason of this problem. It's not about timestamps.

With Windows 8.1 release Microsoft has introduced New AVStream Interfaces for Windows 8.1 There is a small but very important change in KS_FRAME_INFO structure - the new FrameCompletionNumber member.

An identifying sequence number for the frame in the completed queue. This number is used to verify proper frame order. When this value is 0, the frame was cancelled. This member is available starting with Windows 8.1.

DirectShow doesn't care about this number. And MediaFoundation cares.

So, you cannot just fix that on your user-mode side (many MF developers complain about not getting the OnReadSample callback). The manufacture developers must release an update. Btw, I have two webcams - Logitech C270 and Creative Live Socialize HD. Logitech supports Metro while Creative does not.

I have successfully updated my driver with only a few lines of code (to set up FrameCompletionNumber properly).

UPD. similar thread http://www.osronline.com/showthread.cfm?link=255004
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 104
8 partitions?!  Really? 8 136
HP Laser Jet Errors 10 101
Problems with Microsoft.DHCP.PowerShell.Admin Module 4 72
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
The advancements in today's technology are unparalleled. Much of the technology that we have could not have been imagined twenty years ago. One of the latest additions to the list of technological advances is virtual reality. Virtual reality has an …
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to include realistic velocity sensitivity to their Sampler instruments. Set the Vol<Vel parameter in the Filter/Global tab to your desired setting: Gather samples of hits of various intensity, and drag/drop into Velocity zon…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question