webrtc音视频

std::vector<WebRtcVideoChannel::VideoCodecSettings>
WebRtcVideoChannel::SelectSendVideoCodecs(
    const std::vector<VideoCodecSettings>& remote_mapped_codecs) const {
  std::vector<webrtc::SdpVideoFormat> sdp_formats =
      encoder_factory_ ? encoder_factory_->GetImplementations()
                       : std::vector<webrtc::SdpVideoFormat>();

  // The returned vector holds the VideoCodecSettings in term of preference.
  // They are orderd by receive codec preference first and local implementation
  // preference second.
  std::vector<VideoCodecSettings> encoders;
  for (const VideoCodecSettings& remote_codec : remote_mapped_codecs) {//遍历远端的codec
    for (auto format_it = sdp_formats.begin();
         format_it != sdp_formats.end();) {//遍历本地的codec
      // For H264, we will limit the encode level to the remote offered level
      // regardless if level asymmetry is allowed or not. This is strictly not
      // following the spec in https://tools.ietf.org/html/rfc6184#section-8.2.2
      // since we should limit the encode level to the lower of local and remote
      // level when level asymmetry is not allowed.
      if (IsSameCodec(format_it->name, format_it->parameters,
                      remote_codec.codec.name, remote_codec.codec.params)) {//本地与远端的codec是否相同
        encoders.push_back(remote_codec);

        // To allow the VideoEncoderFactory to keep information about which
        // implementation to instantitate when CreateEncoder is called the two
        // parmeter sets are merged.
        encoders.back().codec.params.insert(format_it->parameters.begin(),
                                            format_it->parameters.end());

        format_it = sdp_formats.erase(format_it);
      } else {
        ++format_it;
      }
    }
  }

  return encoders;//本地与远端都支持的codecs
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
webrtc是一种开源的实时通信技术,可以直接在网页浏览器中进行音视频通话和数据传输。它使用了现代Web浏览器中的原生API,包括音视频采集和编码、网络传输和协议、解码和渲染等功能,实现了实时的音视频互动。 这本PDF《webrtc音视频实时互动技术》详细介绍了webrtc的原理、技术栈和应用场景。首先,它介绍了webrtc的基本原理,包括媒体捕获和处理、流媒体媒体传输和网络连接、媒体处理和渲染等核心模块的工作流程。通过深入理解这些原理,读者可以更好地掌握webrtc实时通信的底层机制。 其次,这本PDF还详细介绍了webrtc的技术栈,包括音视频采集和编码、实时流传输和协议、网络传输和连接、解码和渲染等几个关键方面。它提供了详细的代码示例和实际应用案例,帮助读者更好地理解和应用这些技术。 最后,这本PDF还探讨了webrtc在实际应用中的场景和挑战。它介绍了webrtc在视频会议、在线教育、远程医疗等领域的应用,并提供了相应的解决方案和优化技巧。同时,它还讨论了webrtc在网络环境、设备兼容性和安全性方面的挑战,为读者提供了解决这些问题的方法和建议。 总之,《webrtc音视频实时互动技术》这本PDF提供了全面而深入的webrtc实时通信技术知识,帮助读者理解webrtc的原理和技术,并能够应用于实际场景中。无论是对webrtc技术感兴趣的开发者,还是希望在实时音视频通信领域应用webrtc的用户,都会从这本PDF中获得丰富的知识和实用的经验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值