You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.9 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include "test/call_config_utils.h"
  11. #include "call/video_receive_stream.h"
  12. #include "test/gtest.h"
  13. namespace webrtc {
  14. namespace test {
  15. TEST(CallConfigUtils, MarshalUnmarshalProcessSameObject) {
  16. VideoReceiveStream::Config recv_config(nullptr);
  17. VideoReceiveStream::Decoder decoder;
  18. decoder.payload_type = 10;
  19. decoder.video_format.name = "test";
  20. decoder.video_format.parameters["99"] = "b";
  21. recv_config.decoders.push_back(decoder);
  22. recv_config.render_delay_ms = 10;
  23. recv_config.target_delay_ms = 15;
  24. recv_config.rtp.remote_ssrc = 100;
  25. recv_config.rtp.local_ssrc = 101;
  26. recv_config.rtp.rtcp_mode = RtcpMode::kCompound;
  27. recv_config.rtp.transport_cc = false;
  28. recv_config.rtp.lntf.enabled = false;
  29. recv_config.rtp.nack.rtp_history_ms = 150;
  30. recv_config.rtp.red_payload_type = 50;
  31. recv_config.rtp.rtx_ssrc = 1000;
  32. recv_config.rtp.rtx_associated_payload_types[10] = 10;
  33. recv_config.rtp.extensions.emplace_back("uri", 128, true);
  34. VideoReceiveStream::Config unmarshaled_config =
  35. ParseVideoReceiveStreamJsonConfig(
  36. nullptr, GenerateVideoReceiveStreamJsonConfig(recv_config));
  37. EXPECT_EQ(recv_config.decoders[0].payload_type,
  38. unmarshaled_config.decoders[0].payload_type);
  39. EXPECT_EQ(recv_config.decoders[0].video_format.name,
  40. unmarshaled_config.decoders[0].video_format.name);
  41. EXPECT_EQ(recv_config.decoders[0].video_format.parameters,
  42. unmarshaled_config.decoders[0].video_format.parameters);
  43. EXPECT_EQ(recv_config.render_delay_ms, unmarshaled_config.render_delay_ms);
  44. EXPECT_EQ(recv_config.target_delay_ms, unmarshaled_config.target_delay_ms);
  45. EXPECT_EQ(recv_config.rtp.remote_ssrc, unmarshaled_config.rtp.remote_ssrc);
  46. EXPECT_EQ(recv_config.rtp.local_ssrc, unmarshaled_config.rtp.local_ssrc);
  47. EXPECT_EQ(recv_config.rtp.rtcp_mode, unmarshaled_config.rtp.rtcp_mode);
  48. EXPECT_EQ(recv_config.rtp.transport_cc, unmarshaled_config.rtp.transport_cc);
  49. EXPECT_EQ(recv_config.rtp.lntf.enabled, unmarshaled_config.rtp.lntf.enabled);
  50. EXPECT_EQ(recv_config.rtp.nack.rtp_history_ms,
  51. unmarshaled_config.rtp.nack.rtp_history_ms);
  52. EXPECT_EQ(recv_config.rtp.red_payload_type,
  53. unmarshaled_config.rtp.red_payload_type);
  54. EXPECT_EQ(recv_config.rtp.rtx_ssrc, unmarshaled_config.rtp.rtx_ssrc);
  55. EXPECT_EQ(recv_config.rtp.rtx_associated_payload_types,
  56. unmarshaled_config.rtp.rtx_associated_payload_types);
  57. EXPECT_EQ(recv_config.rtp.extensions, recv_config.rtp.extensions);
  58. }
  59. } // namespace test
  60. } // namespace webrtc