Expose RtpCodecParameters to VideoMediaInfo stats.
Payload type -> RtpCodecParameters maps added for sender and receiver
side. It contains information that will be needed for RTCCodecStats[1]
dictionaries.
Video[Sender/Receiver]Info is updated with current codec payload type
for every stream which can be used to look up the codec in
VideoMediaInfo.
A similar change should be made for VoiceMediaInfo and
Voice[Sender/Receiver]Info.
[1] https://w3c.github.io/webrtc-stats/#codec-dict*
BUG=chromium:659117
Review-Url: https://codereview.webrtc.org/2484193002
Cr-Commit-Position: refs/heads/master@{#15060}
diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h
index 4262ff5..b254a14 100644
--- a/webrtc/media/base/mediachannel.h
+++ b/webrtc/media/base/mediachannel.h
@@ -692,7 +692,11 @@
frames_encoded(0) {}
std::vector<SsrcGroup> ssrc_groups;
+ // TODO(hbos): Move this to |VideoMediaInfo::send_codecs|?
std::string encoder_implementation_name;
+ // TODO(hbos): Move this to |MediaSenderInfo| when supported by
+ // |VoiceSenderInfo| as well (which also extends that class).
+ rtc::Optional<uint32_t> codec_payload_type;
int packets_cached;
int firs_rcvd;
int plis_rcvd;
@@ -736,7 +740,11 @@
}
std::vector<SsrcGroup> ssrc_groups;
+ // TODO(hbos): Move this to |VideoMediaInfo::receive_codecs|?
std::string decoder_implementation_name;
+ // TODO(hbos): Move this to |MediaReceiverInfo| when supported by
+ // |VoiceReceiverInfo| as well (which also extends that class).
+ rtc::Optional<uint32_t> codec_payload_type;
int packets_concealed;
int firs_sent;
int plis_sent;
@@ -812,6 +820,9 @@
int64_t bucket_delay;
};
+// Maps from payload type to |RtpCodecParameters|.
+typedef std::map<int, webrtc::RtpCodecParameters> RtpCodecParametersMap;
+
struct VoiceMediaInfo {
void Clear() {
senders.clear();
@@ -826,10 +837,14 @@
senders.clear();
receivers.clear();
bw_estimations.clear();
+ send_codecs.clear();
+ receive_codecs.clear();
}
std::vector<VideoSenderInfo> senders;
std::vector<VideoReceiverInfo> receivers;
std::vector<BandwidthEstimationInfo> bw_estimations;
+ RtpCodecParametersMap send_codecs;
+ RtpCodecParametersMap receive_codecs;
};
struct DataMediaInfo {