track_id_stream_info_map.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef API_TEST_TRACK_ID_STREAM_INFO_MAP_H_
  11. #define API_TEST_TRACK_ID_STREAM_INFO_MAP_H_
  12. #include "absl/strings/string_view.h"
  13. namespace webrtc {
  14. namespace webrtc_pc_e2e {
  15. // Instances of |TrackIdStreamInfoMap| provide bookkeeping capabilities that
  16. // are useful to associate stats reports track_ids to the remote stream info.
  17. class TrackIdStreamInfoMap {
  18. public:
  19. virtual ~TrackIdStreamInfoMap() = default;
  20. // These methods must be called on the same thread where
  21. // StatsObserverInterface::OnStatsReports is invoked.
  22. // Returns a reference to a stream label owned by the TrackIdStreamInfoMap.
  23. // Precondition: |track_id| must be already mapped to stream label.
  24. virtual absl::string_view GetStreamLabelFromTrackId(
  25. absl::string_view track_id) const = 0;
  26. // Returns a reference to a sync group name owned by the TrackIdStreamInfoMap.
  27. // Precondition: |track_id| must be already mapped to sync group.
  28. virtual absl::string_view GetSyncGroupLabelFromTrackId(
  29. absl::string_view track_id) const = 0;
  30. };
  31. } // namespace webrtc_pc_e2e
  32. } // namespace webrtc
  33. #endif // API_TEST_TRACK_ID_STREAM_INFO_MAP_H_