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


C++ MediaSource::isAMRAudioSource方法代码示例

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


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

示例1: sourceIsCompatibleWithUs

Boolean LiveAMRAudioRTPSink::sourceIsCompatibleWithUs( MediaSource& source )
{
  // Our source must be an AMR audio source:
  if (!source.isAMRAudioSource()) return False;

  // Also, the source must be wideband iff we asked for this:
  LiveAMRAudioDeviceSource& amrSource = (LiveAMRAudioDeviceSource&)source;
  if ((amrSource.isWideband()^sourceIsWideband()) != 0) return False;

  // Also, the source must have the same number of channels that we
  // specified.  (It could, in principle, have more, but we don't
  // support that.)
  if (amrSource.numChannels() != numChannels()) return False;

  // Also, because in our current implementation we output only one
  // frame in each RTP packet, this means that for multi-channel audio,
  // each 'frame-block' will be split over multiple RTP packets, which
  // may violate the spec.  Warn about this:
  if (amrSource.numChannels() > 1) {
    envir() << "AMRAudioRTPSink: Warning: Input source has " << amrSource.numChannels()
      << " audio channels.  In the current implementation, the multi-frame frame-block will be split over multiple RTP packets\n";
  }

  return True;
}
开发者ID:duongbaoduy,项目名称:LiveMediaExt,代码行数:25,代码来源:LiveAMRAudioRTPSink.cpp

示例2: sourceIsCompatibleWithUs

Boolean AMRAudioFileSink::sourceIsCompatibleWithUs(MediaSource& source) {
  // The input source must be a AMR Audio source:
  return source.isAMRAudioSource();
}
开发者ID:dongkc,项目名称:live,代码行数:4,代码来源:AMRAudioFileSink.cpp


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