Add RTP timestamp to contributing sources

RTP timestamp was recently added to contributing sources in the WebRTC
specification. This CL implements that change in WebRTC.

Bug: webrtc:10650
Change-Id: Ic0ccfbea7049a5b66063fa6cf60d01d5bd713132
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137515
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28020}
diff --git a/api/rtp_receiver_interface.h b/api/rtp_receiver_interface.h
index 3934215..f79bf8f 100644
--- a/api/rtp_receiver_interface.h
+++ b/api/rtp_receiver_interface.h
@@ -24,6 +24,7 @@
 #include "api/proxy.h"
 #include "api/rtp_parameters.h"
 #include "api/scoped_refptr.h"
+#include "rtc_base/deprecation.h"
 #include "rtc_base/ref_count.h"
 
 namespace webrtc {
@@ -36,13 +37,23 @@
 class RtpSource {
  public:
   RtpSource() = delete;
-  RtpSource(int64_t timestamp_ms,
-            uint32_t source_id,
-            RtpSourceType source_type);
+
   RtpSource(int64_t timestamp_ms,
             uint32_t source_id,
             RtpSourceType source_type,
-            uint8_t audio_level);
+            absl::optional<uint8_t> audio_level,
+            uint32_t rtp_timestamp);
+
+  // DEPRECATED: Will be removed after 2019-07-31.
+  RTC_DEPRECATED RtpSource(int64_t timestamp_ms,
+                           uint32_t source_id,
+                           RtpSourceType source_type);
+  // DEPRECATED: Will be removed after 2019-07-31.
+  RTC_DEPRECATED RtpSource(int64_t timestamp_ms,
+                           uint32_t source_id,
+                           RtpSourceType source_type,
+                           uint8_t audio_level);
+
   RtpSource(const RtpSource&);
   RtpSource& operator=(const RtpSource&);
   ~RtpSource();
@@ -64,9 +75,12 @@
     audio_level_ = level;
   }
 
+  uint32_t rtp_timestamp() const { return rtp_timestamp_; }
+
   bool operator==(const RtpSource& o) const {
     return timestamp_ms_ == o.timestamp_ms() && source_id_ == o.source_id() &&
-           source_type_ == o.source_type() && audio_level_ == o.audio_level_;
+           source_type_ == o.source_type() && audio_level_ == o.audio_level_ &&
+           rtp_timestamp_ == o.rtp_timestamp();
   }
 
  private:
@@ -74,6 +88,7 @@
   uint32_t source_id_;
   RtpSourceType source_type_;
   absl::optional<uint8_t> audio_level_;
+  uint32_t rtp_timestamp_;
 };
 
 class RtpReceiverObserverInterface {