/* * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
#include"test/call_config_utils.h"
#include <string> #include <vector>
namespace webrtc { namespace test {
// Deserializes a JSON representation of the VideoReceiveStreamInterface::Config // back into a valid object. This will not initialize the decoders or the // renderer.
VideoReceiveStreamInterface::Config ParseVideoReceiveStreamJsonConfig(
webrtc::Transport* transport, const Json::Value& json) { auto receive_config = VideoReceiveStreamInterface::Config(transport); for (constauto& decoder_json : json["decoders"]) {
VideoReceiveStreamInterface::Decoder decoder;
decoder.video_format =
SdpVideoFormat(decoder_json["payload_name"].asString());
decoder.payload_type = decoder_json["payload_type"].asInt64(); for (constauto& params_json : decoder_json["codec_params"]) {
std::vector<std::string> members = params_json.getMemberNames();
RTC_CHECK_EQ(members.size(), 1);
decoder.video_format.parameters[members[0]] =
params_json[members[0]].asString();
}
receive_config.decoders.push_back(decoder);
}
receive_config.render_delay_ms = json["render_delay_ms"].asInt64();
receive_config.rtp.remote_ssrc = json["rtp"]["remote_ssrc"].asInt64();
receive_config.rtp.local_ssrc = json["rtp"]["local_ssrc"].asInt64();
receive_config.rtp.rtcp_mode =
json["rtp"]["rtcp_mode"].asString() == "RtcpMode::kCompound"
? RtcpMode::kCompound
: RtcpMode::kReducedSize;
receive_config.rtp.lntf.enabled = json["rtp"]["lntf"]["enabled"].asInt64();
receive_config.rtp.nack.rtp_history_ms =
json["rtp"]["nack"]["rtp_history_ms"].asInt64();
receive_config.rtp.ulpfec_payload_type =
json["rtp"]["ulpfec_payload_type"].asInt64();
receive_config.rtp.red_payload_type =
json["rtp"]["red_payload_type"].asInt64();
receive_config.rtp.rtx_ssrc = json["rtp"]["rtx_ssrc"].asInt64();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.