Revision: 310
http://artoolkit.svn.sourceforge.net/artoolkit/?rev=310&view=rev
Author: julianlooser
Date: 2009-04-30 22:44:08 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
- Changed the way MatchMediaTypes operates. Rather than trying to find a media type with the requested FPS, it will match the resolution, and then set the AvgTimePerFrame field to suit the requested rate. DirectShow will then try to provide that rate if it can.
Modified Paths:
--------------
branches/hartmut-pre-2_8/artoolkit/lib/SRC/VideoWin32DirectShow/_ext/dsvl-0.0.8h/src/DSVL_GraphManager.cpp
Modified: branches/hartmut-pre-2_8/artoolkit/lib/SRC/VideoWin32DirectShow/_ext/dsvl-0.0.8h/src/DSVL_GraphManager.cpp
===================================================================
--- branches/hartmut-pre-2_8/artoolkit/lib/SRC/VideoWin32DirectShow/_ext/dsvl-0.0.8h/src/DSVL_GraphManager.cpp 2008-12-12 01:19:15 UTC (rev 309)
+++ branches/hartmut-pre-2_8/artoolkit/lib/SRC/VideoWin32DirectShow/_ext/dsvl-0.0.8h/src/DSVL_GraphManager.cpp 2009-04-30 22:44:08 UTC (rev 310)
@@ -99,12 +99,22 @@
VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER *) p_mt->pbFormat;
if( ((p_mt->subtype == mf->subtype) || (mf->subtype == GUID_NULL)) &&
((pvi->bmiHeader.biHeight == mf->biHeight) || (mf->biHeight == 0)) &&
- ((pvi->bmiHeader.biWidth == mf->biWidth) || (mf->biWidth == 0)) &&
- ((avg2fps(pvi->AvgTimePerFrame,3) == RoundDouble(mf->frameRate,3)) || (mf->frameRate == 0.0))
+ ((pvi->bmiHeader.biWidth == mf->biWidth) || (mf->biWidth == 0)) /*&&
+ // jcl64: Don't try to match frame rate. Set it explicitly (see below)
+ ((avg2fps(pvi->AvgTimePerFrame,3) == RoundDouble(mf->frameRate,3)) || (mf->frameRate == 0.0))*/
)
{
// found a match!
CopyMediaType(req_mt,p_mt);
+
+ // ------------------
+ // jcl64: Set the frame rate we want
+ if (VIDEOINFOHEADER *pvi_req = (VIDEOINFOHEADER *) req_mt->pbFormat) {
+ pvi_req->AvgTimePerFrame = fps2avg(RoundDouble(mf->frameRate,3));
+ }
+ // jcl64
+ // ------------------
+
DeleteMediaType(p_mt);
return(S_OK);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|