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

Unified Diff: webrtc/api/rtpreceiverinterface.h

Issue 3000713002: Add audio_level member to RtpSource and set it from RtpReceiverImpl::IncomingRtpPacket. (Closed)
Patch Set: Move set_audio_level before RemoveOutdatedSources. 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
Index: webrtc/api/rtpreceiverinterface.h
diff --git a/webrtc/api/rtpreceiverinterface.h b/webrtc/api/rtpreceiverinterface.h
index ce4abeb511364ba8c8172cbbc8fbc1ff5997f684..81ecc64fc217fa8784e779c106fdd37c48fc6ecd 100644
--- a/webrtc/api/rtpreceiverinterface.h
+++ b/webrtc/api/rtpreceiverinterface.h
@@ -37,7 +37,17 @@ class RtpSource {
RtpSource(int64_t timestamp_ms, uint32_t source_id, RtpSourceType source_type)
: timestamp_ms_(timestamp_ms),
source_id_(source_id),
- source_type_(source_type) {}
+ source_type_(source_type),
+ audio_level_() {}
pthatcher 2017/08/21 22:55:39 Do you even need to do audio_level_() here? I tho
Zach Stein 2017/08/22 21:29:59 I think the right thing will happen without this.
+
+ 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) {}
pthatcher 2017/08/21 22:55:40 Is the other constructor (without an audio_level)
Zhi Huang 2017/08/22 00:01:19 Some internal tests will call the other constructo
Zach Stein 2017/08/22 21:29:59 Yup, some external code relies on the existing con
int64_t timestamp_ms() const { return timestamp_ms_; }
void update_timestamp_ms(int64_t timestamp_ms) {
@@ -51,19 +61,19 @@ 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(rtc::Optional<uint8_t> level) { audio_level_ = level; }
pthatcher 2017/08/21 22:55:39 I think "const rtc::Optional<T>&" is usually how w
Zach Stein 2017/08/22 21:29:59 Done.
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') | webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698