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 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 16 namespace webrtc { 17 namespace webrtc_pc_e2e { 18 19 // Instances of |TrackIdStreamInfoMap| provide bookkeeping capabilities that 20 // are useful to associate stats reports track_ids to the remote stream info. 21 class 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. 29 // Precondition: |track_id| must be already mapped to stream label. 30 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. 34 // Precondition: |track_id| must be already mapped to sync group. 35 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_ 43