1

で行うべきだと思いますがIMediaSeeking SetPositions、内部でパラメーターを定義する方法がわかりません。

4

2 に答える 2

0
IBasicVideo                 *pBasicVideo=NULL;//Interface to the Ibasic Video
HRESULT                     hr;
REFTIME                     pavgfrt=0;//Get the reftime variable
REFERENCE_TIME      pnowrt=0;//Get the reference time variable
pBasicVideo->get_AvgTimePerFrame(&pavgfrt);
pBasicVideo->get_AvgTimePerFrame(&pavgfrt);//Get the avg time per frame in seconds

pSeek->GetCurrentPosition(&pnowrt);//Get the current time in the unit of 100 nanoseconds
REFERENCE_TIME temp=pnowrt;//store it in a temp variable
REFERENCE_TIME temp1=(REFERENCE_TIME)(pavgfrt*10000000);//convert avg time into the format of current time
pnowrt=temp+temp1;//Add to framestep forward and subtract to framestep backward
pSeek->SetPositions(&pnowrt,AM_SEEKING_AbsolutePositioning, NULL,AM_SEEKING_NoPositioning);//Set the seeking position to the new time
pnowrt=0;//Reset the time variable

これはC ++で機能します。このコードを C# でラップすることは難しくないかもしれません。お役に立てれば。

于 2012-02-21T15:03:16.277 に答える