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


C++ JsepSession类代码示例

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


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

示例1: CSFLogDebug

nsresult
PeerConnectionMedia::ActivateOrRemoveTransports(const JsepSession& aSession,
                                                const bool forceIceTcp)
{
  for (const auto& transceiver : aSession.GetTransceivers()) {
    if (!transceiver->HasLevel()) {
      continue;
    }

    std::string ufrag;
    std::string pwd;
    std::vector<std::string> candidates;
    size_t components = 0;

    RefPtr<JsepTransport> transport = transceiver->mTransport;
    unsigned level = transceiver->GetLevel();

    if (transport->mComponents &&
        (!transceiver->HasBundleLevel() ||
         (transceiver->BundleLevel() == level))) {
      CSFLogDebug(LOGTAG, "ACTIVATING TRANSPORT! - PC %s: level=%u components=%u",
                  mParentHandle.c_str(), (unsigned)level,
                  (unsigned)transport->mComponents);

      ufrag = transport->mIce->GetUfrag();
      pwd = transport->mIce->GetPassword();
      candidates = transport->mIce->GetCandidates();
      components = transport->mComponents;
      if (forceIceTcp) {
        candidates.erase(std::remove_if(candidates.begin(),
                                        candidates.end(),
                                        [](const std::string & s) {
                                          return s.find(" UDP ") != std::string::npos ||
                                                 s.find(" udp ") != std::string::npos; }),
                         candidates.end());
      }
    }

    RUN_ON_THREAD(
        GetSTSThread(),
        WrapRunnable(RefPtr<PeerConnectionMedia>(this),
                     &PeerConnectionMedia::ActivateOrRemoveTransport_s,
                     transceiver->GetLevel(),
                     components,
                     ufrag,
                     pwd,
                     candidates),
        NS_DISPATCH_NORMAL);
  }

  // We can have more streams than m-lines due to rollback.
  RUN_ON_THREAD(
      GetSTSThread(),
      WrapRunnable(RefPtr<PeerConnectionMedia>(this),
                   &PeerConnectionMedia::RemoveTransportsAtOrAfter_s,
                   aSession.GetTransceivers().size()),
      NS_DISPATCH_NORMAL);

  return NS_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:60,代码来源:PeerConnectionMedia.cpp

示例2: CSFLogDebug

void
PeerConnectionMedia::StartIceChecks(const JsepSession& session) {

  std::vector<size_t> numComponentsByLevel;
  auto transports = session.GetTransports();
  for (size_t i = 0; i < transports.size(); ++i) {
    RefPtr<JsepTransport> transport = transports[i];
    if (transport->mState == JsepTransport::kJsepTransportClosed) {
      CSFLogDebug(logTag, "Transport %s is disabled",
                          transport->mTransportId.c_str());
      numComponentsByLevel.push_back(0);
      // Make sure the MediaPipelineFactory doesn't try to use these.
      RemoveTransportFlow(i, false);
      RemoveTransportFlow(i, true);
    } else {
      CSFLogDebug(logTag, "Transport %s has %u components",
                          transport->mTransportId.c_str(),
                          static_cast<unsigned>(transport->mComponents));
      numComponentsByLevel.push_back(transport->mComponents);
    }
  }

  nsCOMPtr<nsIRunnable> runnable(
      WrapRunnable(
        RefPtr<PeerConnectionMedia>(this),
        &PeerConnectionMedia::StartIceChecks_s,
        session.IsIceControlling(),
        session.RemoteIsIceLite(),
        // Copy, just in case API changes to return a ref
        std::vector<std::string>(session.GetIceOptions()),
        numComponentsByLevel));

  PerformOrEnqueueIceCtxOperation(runnable);
}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:34,代码来源:PeerConnectionMedia.cpp

示例3: runnable

void
PeerConnectionMedia::StartIceChecks(const JsepSession& aSession)
{
  nsCOMPtr<nsIRunnable> runnable(
      WrapRunnable(
        RefPtr<PeerConnectionMedia>(this),
        &PeerConnectionMedia::StartIceChecks_s,
        aSession.IsIceControlling(),
        aSession.RemoteIsIceLite(),
        // Copy, just in case API changes to return a ref
        std::vector<std::string>(aSession.GetIceOptions())));

  PerformOrEnqueueIceCtxOperation(runnable);
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:14,代码来源:PeerConnectionMedia.cpp

示例4: UpdateMediaPipelines

nsresult PeerConnectionMedia::UpdateMediaPipelines(
    const JsepSession& session) {
  auto trackPairs = session.GetNegotiatedTrackPairs();
  MediaPipelineFactory factory(this);
  nsresult rv;

  for (auto i = trackPairs.begin(); i != trackPairs.end(); ++i) {
    JsepTrackPair pair = *i;

    if (pair.mReceiving) {
      rv = factory.CreateOrUpdateMediaPipeline(pair, *pair.mReceiving);
      if (NS_FAILED(rv)) {
        return rv;
      }
    }

    if (pair.mSending) {
      rv = factory.CreateOrUpdateMediaPipeline(pair, *pair.mSending);
      if (NS_FAILED(rv)) {
        return rv;
      }
    }
  }

  for (auto& stream : mRemoteSourceStreams) {
    stream->StartReceiving();
  }

  return NS_OK;
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:30,代码来源:PeerConnectionMedia.cpp

示例5: UpdateTransportFlows

nsresult
PeerConnectionMedia::UpdateTransceiverTransports(const JsepSession& aSession)
{
  for (const auto& transceiver : aSession.GetTransceivers()) {
    nsresult rv = UpdateTransportFlows(*transceiver);
    if (NS_FAILED(rv)) {
      return rv;
    }
  }

  for (const auto& transceiverImpl : mTransceivers) {
    transceiverImpl->UpdateTransport(*this);
  }

  return NS_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:16,代码来源:PeerConnectionMedia.cpp

示例6: GetSTSThread

void
PeerConnectionMedia::EnsureTransports(const JsepSession& aSession)
{
  auto transports = aSession.GetTransports();
  for (size_t i = 0; i < transports.size(); ++i) {
    RefPtr<JsepTransport> transport = transports[i];
    RUN_ON_THREAD(
        GetSTSThread(),
        WrapRunnable(RefPtr<PeerConnectionMedia>(this),
                     &PeerConnectionMedia::EnsureTransport_s,
                     i,
                     transport->mComponents),
        NS_DISPATCH_NORMAL);
  }

  GatherIfReady();
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:17,代码来源:PeerConnectionMedia.cpp

示例7: CSFLogDebug

void
PeerConnectionMedia::ActivateOrRemoveTransports(const JsepSession& aSession)
{
  auto transports = aSession.GetTransports();
  for (size_t i = 0; i < transports.size(); ++i) {
    RefPtr<JsepTransport> transport = transports[i];

    std::string ufrag;
    std::string pwd;
    std::vector<std::string> candidates;

    if (transport->mComponents) {
      MOZ_ASSERT(transport->mIce);
      CSFLogDebug(logTag, "Transport %u is active", static_cast<unsigned>(i));
      ufrag = transport->mIce->GetUfrag();
      pwd = transport->mIce->GetPassword();
      candidates = transport->mIce->GetCandidates();
    } else {
      CSFLogDebug(logTag, "Transport %u is disabled", static_cast<unsigned>(i));
      // Make sure the MediaPipelineFactory doesn't try to use these.
      RemoveTransportFlow(i, false);
      RemoveTransportFlow(i, true);
    }

    RUN_ON_THREAD(
        GetSTSThread(),
        WrapRunnable(RefPtr<PeerConnectionMedia>(this),
                     &PeerConnectionMedia::ActivateOrRemoveTransport_s,
                     i,
                     transport->mComponents,
                     ufrag,
                     pwd,
                     candidates),
        NS_DISPATCH_NORMAL);
  }

  // We can have more streams than m-lines due to rollback.
  RUN_ON_THREAD(
      GetSTSThread(),
      WrapRunnable(RefPtr<PeerConnectionMedia>(this),
                   &PeerConnectionMedia::RemoveTransportsAtOrAfter_s,
                   transports.size()),
      NS_DISPATCH_NORMAL);
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:44,代码来源:PeerConnectionMedia.cpp

示例8: GetSTSThread

void
PeerConnectionMedia::EnsureTransports(const JsepSession& aSession)
{
  for (const auto& transceiver : aSession.GetTransceivers()) {
    if (!transceiver->HasLevel()) {
      continue;
    }

    RefPtr<JsepTransport> transport = transceiver->mTransport;
    RUN_ON_THREAD(
        GetSTSThread(),
        WrapRunnable(RefPtr<PeerConnectionMedia>(this),
                     &PeerConnectionMedia::EnsureTransport_s,
                     transceiver->GetLevel(),
                     transport->mComponents),
        NS_DISPATCH_NORMAL);
  }

  GatherIfReady();
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:20,代码来源:PeerConnectionMedia.cpp


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