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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Merge and add the tests. Created 3 years, 9 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/modules/rtp_rtcp/source/rtp_receiver_impl.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h
index 4b5524877c77206c58eb8db145ba0f88202b75c9..e4ec8f5d049d472a11db110d5de5128fdd4e4c1b 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h
@@ -12,6 +12,7 @@
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
#include <memory>
+#include <vector>
#include "webrtc/base/criticalsection.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
@@ -21,6 +22,9 @@
namespace webrtc {
+// The maximum size of the ring buffer of the RtpContributingSource objects.
+static const size_t kContributingSourcesBufferSize = 500;
hbos 2017/03/30 09:51:54 What is the reason for choosing 500? Is this arbit
Zhi Huang 2017/03/31 06:44:04 I'm not sure what is right size of this. It is exp
+
class RtpReceiverImpl : public RtpReceiver {
public:
// Callbacks passed in here may not be NULL (use Null Object callbacks if you
@@ -56,6 +60,8 @@ class RtpReceiverImpl : public RtpReceiver {
TelephoneEventHandler* GetTelephoneEventHandler() override;
+ const std::vector<RtpContributingSource*>& GetContributingSources() override;
+
private:
bool HaveReceivedFrame() const;
@@ -66,6 +72,8 @@ class RtpReceiverImpl : public RtpReceiver {
bool* is_red,
PayloadUnion* payload);
+ void UpdateContributingSource();
+
Clock* clock_;
RTPPayloadRegistry* rtp_payload_registry_;
std::unique_ptr<RTPReceiverStrategy> rtp_media_receiver_;
@@ -84,6 +92,16 @@ class RtpReceiverImpl : public RtpReceiver {
uint32_t last_received_timestamp_;
int64_t last_received_frame_time_ms_;
uint16_t last_received_sequence_number_;
+
+ // Contributing Sources.
+ std::vector<RtpContributingSource*> contributing_sources_;
+ RtpContributingSource
+ contributing_sources_buffer_[kContributingSourcesBufferSize];
+ // The contribuing source that uses the |ssrc_|.
+ std::unique_ptr<RtpContributingSource> ssrc_source_;
+
+ size_t current_buffer_index_;
+ size_t current_buffer_size_;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698