blob: 0f8e43e20e9f9c8fd82c8a829adfaf2a187822c3 [file] [log] [blame]
Andrey Logvin20f45822020-07-01 08:32:15 +00001/*
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
11#ifndef API_TEST_TRACK_ID_STREAM_INFO_MAP_H_
12#define API_TEST_TRACK_ID_STREAM_INFO_MAP_H_
13
14#include "absl/strings/string_view.h"
15
16namespace webrtc {
17namespace webrtc_pc_e2e {
18
Artem Titov0e61fdd2021-07-25 21:50:14 +020019// Instances of `TrackIdStreamInfoMap` provide bookkeeping capabilities that
Andrey Logvin20f45822020-07-01 08:32:15 +000020// are useful to associate stats reports track_ids to the remote stream info.
21class TrackIdStreamInfoMap {
22 public:
23 virtual ~TrackIdStreamInfoMap() = default;
24
25 // These methods must be called on the same thread where
26 // StatsObserverInterface::OnStatsReports is invoked.
27
28 // Returns a reference to a stream label owned by the TrackIdStreamInfoMap.
Artem Titov0e61fdd2021-07-25 21:50:14 +020029 // Precondition: `track_id` must be already mapped to stream label.
Andrey Logvin20f45822020-07-01 08:32:15 +000030 virtual absl::string_view GetStreamLabelFromTrackId(
31 absl::string_view track_id) const = 0;
32
33 // Returns a reference to a sync group name owned by the TrackIdStreamInfoMap.
Artem Titov0e61fdd2021-07-25 21:50:14 +020034 // Precondition: `track_id` must be already mapped to sync group.
Andrey Logvin20f45822020-07-01 08:32:15 +000035 virtual absl::string_view GetSyncGroupLabelFromTrackId(
36 absl::string_view track_id) const = 0;
37};
38
39} // namespace webrtc_pc_e2e
40} // namespace webrtc
41
42#endif // API_TEST_TRACK_ID_STREAM_INFO_MAP_H_