当前位置: 首页>>代码示例>>C++>>正文


C++ IBaseFilter::SetSyncSource方法代码示例

本文整理汇总了C++中IBaseFilter::SetSyncSource方法的典型用法代码示例。如果您正苦于以下问题:C++ IBaseFilter::SetSyncSource方法的具体用法?C++ IBaseFilter::SetSyncSource怎么用?C++ IBaseFilter::SetSyncSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IBaseFilter的用法示例。


在下文中一共展示了IBaseFilter::SetSyncSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: open_and_find_parameters


//.........这里部分代码省略.........
    fprintf(stderr,"directx_videofile_server::open_and_find_parameters(): Can't create Null Renderer\n");
    return false;
  }
#ifdef DEBUG
  fprintf(stderr, "(renderer)...");
#endif

  // Connect the output of the video reader to the sample grabber input
  fprintf(stderr, "XXX DirectShow reading of video files fails on Windows 7\n");
  return false;

  // XXX The call below hangs on Windows 7 on Russ Taylor's laptop.
  ConnectTwoFilters(_pGraph, pSrc, _pSampleGrabberFilter);
#ifdef DEBUG
  fprintf(stderr, "(connected reader)...");
#endif

  // Connect the output of the sample grabber to the NULL renderer input
#ifdef DEBUG
  fprintf(stderr, "(connected grabber)...");
#endif
  ConnectTwoFilters(_pGraph, _pSampleGrabberFilter, pNull);
#ifdef DEBUG
  fprintf(stderr, "\n");
#endif

  //-------------------------------------------------------------------
  // We don't need a reference clock for playout because we're going
  // to limit playback rate by controlling how fast we pass frames through
  // the callback handler.  We can't set a playout rate anyway, because
  // the NULL renderer won't do this for us.  Recall that the frames come
  // out of the file reader as fast as it can process them, and only
  // block up if the downstream buffers all fill up.
  pNull->SetSyncSource(NULL); // Turn off the reference clock.
  
  //-------------------------------------------------------------------
  // Find the control that lets you seek in the media (rewind uses this
  // to restart at the beginning of the file).

#ifdef DEBUG
  fprintf(stderr, "directx_videofile_server::open_and_find_parameters(): Locating seek controls\n");
#endif
  if (FAILED(_pGraph->QueryInterface(IID_IMediaSeeking, (void **)&_pMediaSeeking))) {
    fprintf(stderr,"directx_videofile_server::open_and_find_parameters(): Can't create media seeker\n");
    pSrc->Release();
    pNull->Release();
    return false;
  }

  //-------------------------------------------------------------------
  // Find _num_rows and _num_columns, which is the maximum size.
#ifdef DEBUG
  fprintf(stderr, "directx_videofile_server::open_and_find_parameters(): Determining image size\n");
#endif
  _pGrabber->GetConnectedMediaType(&mt);
  VIDEOINFOHEADER *pVih;
  if (mt.formattype == FORMAT_VideoInfo) {
      pVih = reinterpret_cast<VIDEOINFOHEADER*>(mt.pbFormat);
  } else if (mt.formattype == FORMAT_VideoInfo2) {
      pVih = reinterpret_cast<VIDEOINFOHEADER*>(mt.pbFormat);
  } else {
    fprintf(stderr,"directx_videofile_server::open_and_find_parameters(): Can't get video header type\n");
	fprintf(stderr,"  (Expected %x or %x, got %x)\n", FORMAT_VideoInfo, FORMAT_VideoInfo2, mt.formattype);
	fprintf(stderr,"  (GetConnectedMediaType is not valid for DirectX headers later than version 7)\n");
	fprintf(stderr,"  (We need to re-implement reading video in some other interface)\n");
    return false;
开发者ID:CISMM,项目名称:video,代码行数:67,代码来源:directx_videofile_server.cpp


注:本文中的IBaseFilter::SetSyncSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。