Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: webrtc/api/rtpreceiverinterface.h

Issue 3000713002: Add audio_level member to RtpSource and set it from RtpReceiverImpl::IncomingRtpPacket. (Closed)
Patch Set: Style feedback from deadbeef Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtpreceiverinterface.h
diff --git a/webrtc/api/rtpreceiverinterface.h b/webrtc/api/rtpreceiverinterface.h
index ce4abeb511364ba8c8172cbbc8fbc1ff5997f684..3119fb781d317790772018d85b440cd50b5c169b 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 set_audio_level(const rtc::Optional<uint8_t>& level) {
+ 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 {
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698