Chromium Code Reviews| Index: webrtc/api/trackmediainfomap.h |
| diff --git a/webrtc/api/trackmediainfomap.h b/webrtc/api/trackmediainfomap.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a61357e9418c753b13ffc2740ef38dd64ea252f1 |
| --- /dev/null |
| +++ b/webrtc/api/trackmediainfomap.h |
| @@ -0,0 +1,87 @@ |
| +/* |
| + * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#ifndef WEBRTC_API_TRACKMEDIAINFOMAP_H_ |
| +#define WEBRTC_API_TRACKMEDIAINFOMAP_H_ |
| + |
| +#include <map> |
| +#include <memory> |
| +#include <vector> |
| + |
| +#include "webrtc/api/mediastreaminterface.h" |
| +#include "webrtc/api/rtpreceiverinterface.h" |
| +#include "webrtc/api/rtpsenderinterface.h" |
| +#include "webrtc/base/refcount.h" |
| +#include "webrtc/media/base/mediachannel.h" |
| + |
| +namespace webrtc { |
| + |
| +class TrackMediaInfoMap { |
| + public: |
| + TrackMediaInfoMap(std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info, |
| + std::unique_ptr<cricket::VideoMediaInfo> video_media_info); |
| + |
|
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.
|
| + void Initialize( |
| + const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& rtp_senders, |
| + const std::vector<rtc::scoped_refptr<RtpReceiverInterface>>& |
| + 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
|
| + |
| + const cricket::VoiceMediaInfo& voice_media_info() const { |
| + return *voice_media_info_; |
| + } |
| + const cricket::VideoMediaInfo& video_media_info() const { |
| + return *video_media_info_; |
| + } |
| + |
|
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.
|
| + const std::vector<cricket::VoiceSenderInfo*>* GetVoiceSenderInfos( |
| + const AudioTrackInterface& local_audio_track) const; |
| + const cricket::VoiceReceiverInfo* GetVoiceReceiverInfo( |
| + const AudioTrackInterface& remote_audio_track) const; |
| + const std::vector<cricket::VideoSenderInfo*>* GetVideoSenderInfos( |
| + const VideoTrackInterface& local_video_track) const; |
| + const cricket::VideoReceiverInfo* GetVideoReceiverInfo( |
| + const VideoTrackInterface& remote_video_track) const; |
| + |
| + rtc::scoped_refptr<AudioTrackInterface> GetAudioTrack( |
| + const cricket::VoiceSenderInfo& voice_sender_info) const; |
| + rtc::scoped_refptr<AudioTrackInterface> GetAudioTrack( |
| + const cricket::VoiceReceiverInfo& voice_receiver_info) const; |
| + rtc::scoped_refptr<VideoTrackInterface> GetVideoTrack( |
| + const cricket::VideoSenderInfo& video_sender_info) const; |
| + rtc::scoped_refptr<VideoTrackInterface> GetVideoTrack( |
| + const cricket::VideoReceiverInfo& video_receiver_info) const; |
| + |
| + private: |
| + 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.
|
| + std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_; |
| + std::unique_ptr<cricket::VideoMediaInfo> video_media_info_; |
| + // Tracks to infos. |
| + std::map<const AudioTrackInterface*, std::vector<cricket::VoiceSenderInfo*>> |
| + local_audio_track_to_infos_; |
| + std::map<const AudioTrackInterface*, cricket::VoiceReceiverInfo*> |
| + remote_audio_track_to_info_; |
| + std::map<const VideoTrackInterface*, std::vector<cricket::VideoSenderInfo*>> |
| + local_video_track_to_infos_; |
| + std::map<const VideoTrackInterface*, cricket::VideoReceiverInfo*> |
| + remote_video_track_to_info_; |
| + // Infos to tracks. |
| + std::map<const cricket::VoiceSenderInfo*, |
| + rtc::scoped_refptr<AudioTrackInterface>> voice_sender_info_to_track_; |
| + std::map<const cricket::VoiceReceiverInfo*, |
| + rtc::scoped_refptr<AudioTrackInterface>> voice_receiver_info_to_track_; |
| + std::map<const cricket::VideoSenderInfo*, |
| + rtc::scoped_refptr<VideoTrackInterface>> video_sender_info_to_track_; |
| + std::map<const cricket::VideoReceiverInfo*, |
| + rtc::scoped_refptr<VideoTrackInterface>> video_receiver_info_to_track_; |
| +}; |
| + |
| +} // namespace webrtc |
| + |
| +#endif // WEBRTC_API_TRACKMEDIAINFOMAP_H_ |