Index: webrtc/api/rtpreceiverinterface.h |
diff --git a/webrtc/api/rtpreceiverinterface.h b/webrtc/api/rtpreceiverinterface.h |
index ce4abeb511364ba8c8172cbbc8fbc1ff5997f684..101445ab1d3fdf668a8855f3fe524e6c6d1c4f8c 100644 |
--- a/webrtc/api/rtpreceiverinterface.h |
+++ b/webrtc/api/rtpreceiverinterface.h |
@@ -39,6 +39,15 @@ class RtpSource { |
source_id_(source_id), |
source_type_(source_type) {} |
+ RtpSource(int64_t timestamp_ms, |
+ uint32_t source_id, |
+ RtpSourceType source_type, |
+ uint8_t audio_level) |
+ : timestamp_ms_(timestamp_ms), |
+ source_id_(source_id), |
+ source_type_(source_type), |
+ audio_level_(audio_level) {} |
+ |
int64_t timestamp_ms() const { return timestamp_ms_; } |
void update_timestamp_ms(int64_t timestamp_ms) { |
RTC_DCHECK_LE(timestamp_ms_, timestamp_ms); |
@@ -51,19 +60,21 @@ class RtpSource { |
// The source can be either a contributing source or a synchronization source. |
RtpSourceType source_type() const { return source_type_; } |
- // This isn't implemented yet and will always return an empty Optional. |
- // TODO(zhihuang): Implement this to return real audio level. |
- rtc::Optional<int8_t> audio_level() const { return rtc::Optional<int8_t>(); } |
+ rtc::Optional<uint8_t> audio_level() const { return audio_level_; } |
+ void update_audio_level(rtc::Optional<uint8_t> level) { |
danilchap
2017/08/15 08:18:29
write acessor usually has set_ prefix:
set_audio_l
Zach Stein
2017/08/15 21:44:59
I was following the style of this class (update_ti
|
+ audio_level_ = level; |
+ } |
bool operator==(const RtpSource& o) const { |
return timestamp_ms_ == o.timestamp_ms() && source_id_ == o.source_id() && |
- source_type_ == o.source_type(); |
+ source_type_ == o.source_type() && audio_level_ == o.audio_level_; |
} |
private: |
int64_t timestamp_ms_; |
uint32_t source_id_; |
RtpSourceType source_type_; |
+ rtc::Optional<uint8_t> audio_level_; |
}; |
class RtpReceiverObserverInterface { |