Solved

TestCap based virtual video driver problems with Windows 8.1

Posted on 2014-04-07
1
625 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DVD to view Home Pics on a TV - Just a DVD 4 85
Test movie names in Kodi / Openelec 6 81
Detect file exist or not 3 130
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 242
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Viewers will learn how to use Macros for greater control over Rack parameters in Ableton Live. Group devices into a Rack by selecting them and pressing Command-G (Ctrl-G on PC): Control-click (Right Click on PC) a parameter to access pop-up menu, …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now