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 <string> 15 16 #include "absl/strings/string_view.h" 17 18 namespace webrtc { 19 namespace webrtc_pc_e2e { 20 21 // Instances of `TrackIdStreamInfoMap` provide bookkeeping capabilities that 22 // are useful to associate stats reports track_ids to the remote stream info. 23 class TrackIdStreamInfoMap { 24 public: 25 struct StreamInfo { 26 std::string receiver_peer; 27 std::string stream_label; 28 std::string sync_group; 29 }; 30 31 virtual ~TrackIdStreamInfoMap() = default; 32 33 // These methods must be called on the same thread where 34 // StatsObserverInterface::OnStatsReports is invoked. 35 36 // Precondition: `track_id` must be already mapped to stream info. 37 virtual StreamInfo GetStreamInfoFromTrackId( 38 absl::string_view track_id) const = 0; 39 }; 40 41 } // namespace webrtc_pc_e2e 42 } // namespace webrtc 43 44 #endif // API_TEST_TRACK_ID_STREAM_INFO_MAP_H_ 45