Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2016 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 WEBRTC_API_TRACKMEDIAINFOMAP_H_ | |
| 12 #define WEBRTC_API_TRACKMEDIAINFOMAP_H_ | |
| 13 | |
| 14 #include <map> | |
| 15 #include <memory> | |
| 16 #include <vector> | |
| 17 | |
| 18 #include "webrtc/api/mediastreaminterface.h" | |
| 19 #include "webrtc/api/rtpreceiverinterface.h" | |
| 20 #include "webrtc/api/rtpsenderinterface.h" | |
| 21 #include "webrtc/base/refcount.h" | |
| 22 #include "webrtc/media/base/mediachannel.h" | |
| 23 | |
| 24 namespace webrtc { | |
| 25 | |
| 26 class TrackMediaInfoMap { | |
| 27 public: | |
| 28 TrackMediaInfoMap(std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info, | |
| 29 std::unique_ptr<cricket::VideoMediaInfo> video_media_info); | |
| 30 | |
|
Taylor Brandstetter
2017/01/05 00:35:42
Add comment explaining that this can only be calle
hbos
2017/01/05 15:27:56
Initialize removed.
| |
| 31 void Initialize( | |
| 32 const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& rtp_senders, | |
| 33 const std::vector<rtc::scoped_refptr<RtpReceiverInterface>>& | |
| 34 rtp_receivers); | |
|
hta-webrtc
2017/01/05 09:46:56
Hm. How do you expect to call this?
In particular
hbos
2017/01/05 15:27:56
SGTM, merging constructor and Initialize. I only s
| |
| 35 | |
| 36 const cricket::VoiceMediaInfo& voice_media_info() const { | |
| 37 return *voice_media_info_; | |
| 38 } | |
| 39 const cricket::VideoMediaInfo& video_media_info() const { | |
| 40 return *video_media_info_; | |
| 41 } | |
| 42 | |
|
Taylor Brandstetter
2017/01/05 00:35:42
Add comment explaining that Initialize must be cal
hbos
2017/01/05 15:27:56
Initialize removed.
| |
| 43 const std::vector<cricket::VoiceSenderInfo*>* GetVoiceSenderInfos( | |
| 44 const AudioTrackInterface& local_audio_track) const; | |
| 45 const cricket::VoiceReceiverInfo* GetVoiceReceiverInfo( | |
| 46 const AudioTrackInterface& remote_audio_track) const; | |
| 47 const std::vector<cricket::VideoSenderInfo*>* GetVideoSenderInfos( | |
| 48 const VideoTrackInterface& local_video_track) const; | |
| 49 const cricket::VideoReceiverInfo* GetVideoReceiverInfo( | |
| 50 const VideoTrackInterface& remote_video_track) const; | |
| 51 | |
| 52 rtc::scoped_refptr<AudioTrackInterface> GetAudioTrack( | |
| 53 const cricket::VoiceSenderInfo& voice_sender_info) const; | |
| 54 rtc::scoped_refptr<AudioTrackInterface> GetAudioTrack( | |
| 55 const cricket::VoiceReceiverInfo& voice_receiver_info) const; | |
| 56 rtc::scoped_refptr<VideoTrackInterface> GetVideoTrack( | |
| 57 const cricket::VideoSenderInfo& video_sender_info) const; | |
| 58 rtc::scoped_refptr<VideoTrackInterface> GetVideoTrack( | |
| 59 const cricket::VideoReceiverInfo& video_receiver_info) const; | |
| 60 | |
| 61 private: | |
| 62 bool is_initialized_; | |
|
Taylor Brandstetter
2017/01/05 00:35:42
nit: Can initialize this to false here, rather tha
hbos
2017/01/05 15:27:56
is_initialized_ removed.
| |
| 63 std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_; | |
| 64 std::unique_ptr<cricket::VideoMediaInfo> video_media_info_; | |
| 65 // Tracks to infos. | |
| 66 std::map<const AudioTrackInterface*, std::vector<cricket::VoiceSenderInfo*>> | |
| 67 local_audio_track_to_infos_; | |
| 68 std::map<const AudioTrackInterface*, cricket::VoiceReceiverInfo*> | |
| 69 remote_audio_track_to_info_; | |
| 70 std::map<const VideoTrackInterface*, std::vector<cricket::VideoSenderInfo*>> | |
| 71 local_video_track_to_infos_; | |
| 72 std::map<const VideoTrackInterface*, cricket::VideoReceiverInfo*> | |
| 73 remote_video_track_to_info_; | |
| 74 // Infos to tracks. | |
| 75 std::map<const cricket::VoiceSenderInfo*, | |
| 76 rtc::scoped_refptr<AudioTrackInterface>> voice_sender_info_to_track_; | |
| 77 std::map<const cricket::VoiceReceiverInfo*, | |
| 78 rtc::scoped_refptr<AudioTrackInterface>> voice_receiver_info_to_track_; | |
| 79 std::map<const cricket::VideoSenderInfo*, | |
| 80 rtc::scoped_refptr<VideoTrackInterface>> video_sender_info_to_track_; | |
| 81 std::map<const cricket::VideoReceiverInfo*, | |
| 82 rtc::scoped_refptr<VideoTrackInterface>> video_receiver_info_to_track_; | |
| 83 }; | |
| 84 | |
| 85 } // namespace webrtc | |
| 86 | |
| 87 #endif // WEBRTC_API_TRACKMEDIAINFOMAP_H_ | |
| OLD | NEW |