directshow快进问题

singleVC 2003-08-19 05:34:36
LONGLONG current,cur,t;
pims->GetCurrentPosition(¤t);
pims->GetDuration(&cur);
t=current + 1000000000;
if(t>=cur) t=cur;
pims->SetPositions(¤t,AM_SEEKING_AbsolutePositioning,NULL,0);

我的快进总是运行的时候就停止不动了。而且再RUN也没有用了。我用了很多的跳进方法都一样,高手指教!
...全文
96 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
singleVC 2003-08-20
  • 打赏
  • 举报
回复
to duwenyong(啸海) :
感谢你对我的支持!!
我知道你的那两种方法都是可以快进的。特别第二种跳进是我需要的。
下面是我的代码。一样不可跳进:
pigb->QueryInterface(IID_IMediaControl, (void **) &pimc);
pigb->QueryInterface(__uuidof(IVideoFrameStep), (void **) &pfs);
………………
if(pfs)
{
if ((hr = pfs->CanStep(20,NULL)) == S_OK)
{
::MessageBox(NULL,"www",NULL,MB_OK);
pimc->Pause();
hr = pfs->Step(200,NULL);
if(hr == S_OK)
{
::MessageBox(NULL,"www",NULL,MB_OK);
}
pimc->Run();
}
}
测试总没有对话框出现。
请再指点。
duwenyong 2003-08-19
  • 打赏
  • 举报
回复
HRESULT CPlayInterface::StepFrames(DWORD dwFrames)
{
HRESULT hr=S_OK;

// If the Frame Stepping interface exists, use it to step frames
if (pFS)
{
// The renderer may not support frame stepping for more than one
// frame at a time, so check for support. S_OK indicates that the
// renderer can step nFramesToStep successfully.
if ((hr = pFS->CanStep(dwFrames, NULL)) == S_OK)
{
// The graph must be paused for frame stepping to work
if (g_psCurrent != Paused)
Pause();

// Step the requested number of frames, if supported
hr = pFS->Step(dwFrames, NULL);
}
}
return hr;
}
请安装DXSDK8.1
duwenyong 2003-08-19
  • 打赏
  • 举报
回复
HRESULT CPlayInterface::SetPlayRate(double dRate)
{
HRESULT hr=S_OK;
if(dRate==0) return S_OK;
// If the IMediaPosition interface exists, use it to set rate
IMediaPosition *pMP;
JIF(pGB->QueryInterface(IID_IMediaPosition, (void **)&pMP));
if (pMP)
{
JIF(pMP->put_Rate(dRate));
}
SAFE_RELEASE(pMP);

/* if(pMS)
{
JIF(pMS->SetRate(dRate));
}
*/ return S_OK;
}

2,543

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧