summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/test/pc/e2e/peer_params_preprocessor.h
blob: c222811546a67b460bedc4761394fa1d57fa4a8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 *  Copyright (c) 2022 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.
 */
#ifndef TEST_PC_E2E_PEER_PARAMS_PREPROCESSOR_H_
#define TEST_PC_E2E_PEER_PARAMS_PREPROCESSOR_H_

#include <memory>
#include <set>
#include <string>

#include "api/test/pclf/peer_configurer.h"

namespace webrtc {
namespace webrtc_pc_e2e {

class PeerParamsPreprocessor {
 public:
  PeerParamsPreprocessor();
  ~PeerParamsPreprocessor();

  // Set missing params to default values if it is required:
  //  * Generate video stream labels if some of them are missing
  //  * Generate audio stream labels if some of them are missing
  //  * Set video source generation mode if it is not specified
  //  * Video codecs under test
  void SetDefaultValuesForMissingParams(PeerConfigurer& peer);

  // Validate peer's parameters, also ensure uniqueness of all video stream
  // labels.
  void ValidateParams(const PeerConfigurer& peer);

 private:
  class DefaultNamesProvider;
  std::unique_ptr<DefaultNamesProvider> peer_names_provider_;

  std::set<std::string> peer_names_;
  std::set<std::string> video_labels_;
  std::set<std::string> audio_labels_;
  std::set<std::string> video_sync_groups_;
  std::set<std::string> audio_sync_groups_;
};

}  // namespace webrtc_pc_e2e
}  // namespace webrtc

#endif  // TEST_PC_E2E_PEER_PARAMS_PREPROCESSOR_H_