Esempio n. 1
0
bool WebMediaTrackConstraintSet::isEmpty() const {
  for (const auto& constraint : allConstraints()) {
    if (!constraint->isEmpty())
      return false;
  }
  return true;
}
bool WebMediaTrackConstraintSet::hasMandatoryOutsideSet(const std::vector<std::string>& goodNames, std::string& foundName) const
{
    for (const auto& constraint : allConstraints()) {
        if (constraint->hasMandatory()) {
            if (std::find(goodNames.begin(), goodNames.end(), constraint->name())
                == goodNames.end()) {
                foundName = constraint->name();
                return true;
            }
        }
    }
    return false;
}
Esempio n. 3
0
WebString WebMediaTrackConstraintSet::toString() const {
  StringBuilder builder;
  bool first = true;
  for (const auto& constraint : allConstraints()) {
    if (!constraint->isEmpty()) {
      if (!first)
        builder.append(", ");
      builder.append(constraint->name());
      builder.append(": ");
      builder.append(constraint->toString());
      first = false;
    }
  }
  return builder.toString();
}