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

Unified Diff: webrtc/video/receive_statistics_proxy.h

Issue 2042603002: Movable support for VideoReceiveStream::Config and avoid copies (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add TODO Created 4 years, 6 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 | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy.h
diff --git a/webrtc/video/receive_statistics_proxy.h b/webrtc/video/receive_statistics_proxy.h
index f88bbf51a27bcff761950c715252c4f204086ce9..86c35e73ddd9b6fb2cf8df925692b9aa7c22923d 100644
--- a/webrtc/video/receive_statistics_proxy.h
+++ b/webrtc/video/receive_statistics_proxy.h
@@ -37,7 +37,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
public RtcpPacketTypeCounterObserver,
public StreamDataCountersCallback {
public:
- ReceiveStatisticsProxy(const VideoReceiveStream::Config& config,
+ ReceiveStatisticsProxy(const VideoReceiveStream::Config* config,
Clock* clock);
virtual ~ReceiveStatisticsProxy();
@@ -96,7 +96,14 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
Clock* const clock_;
- const VideoReceiveStream::Config config_;
+ // Ownership of this object lies with the owner of the ReceiveStatisticsProxy
+ // instance. Lifetime is guaranteed to outlive |this|.
+ // TODO(tommi): In practice the config_ reference is only used for accessing
+ // config_.rtp.fec.ulpfec_payload_type. Instead of holding a pointer back,
+ // we could just store the value of ulpfec_payload_type and change the
+ // ReceiveStatisticsProxy() ctor to accept a const& of Config (since we'll
+ // then no longer store a pointer to the object).
+ const VideoReceiveStream::Config& config_;
rtc::CriticalSection crit_;
VideoReceiveStream::Stats stats_ GUARDED_BY(crit_);
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698