Solved

TestCap based virtual video driver problems with Windows 8.1

Posted on 2014-04-07
1
653 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
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 the basics of creating custom device Racks in Ableton Live. Place instrument(s) and effects onto a track, and select them all by holding the Shift key and clicking on the device title bars: Group them by typing Command-G (Ctrl-G…

631 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