本文整理汇总了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;
}
示例2: sourceIsCompatibleWithUs
Boolean AMRAudioFileSink::sourceIsCompatibleWithUs(MediaSource& source) {
// The input source must be a AMR Audio source:
return source.isAMRAudioSource();
}