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

Side by Side Diff: webrtc/video/send_statistics_proxy.h

Issue 2122743003: Fix stats for encoder target bitrate when target rate is zero. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed bad logging. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 18 matching lines...) Expand all
29 #include "webrtc/video_send_stream.h" 29 #include "webrtc/video_send_stream.h"
30 30
31 namespace webrtc { 31 namespace webrtc {
32 32
33 class SendStatisticsProxy : public CpuOveruseMetricsObserver, 33 class SendStatisticsProxy : public CpuOveruseMetricsObserver,
34 public RtcpStatisticsCallback, 34 public RtcpStatisticsCallback,
35 public RtcpPacketTypeCounterObserver, 35 public RtcpPacketTypeCounterObserver,
36 public StreamDataCountersCallback, 36 public StreamDataCountersCallback,
37 public BitrateStatisticsObserver, 37 public BitrateStatisticsObserver,
38 public FrameCountObserver, 38 public FrameCountObserver,
39 public VideoEncoderRateObserver,
40 public SendSideDelayObserver { 39 public SendSideDelayObserver {
41 public: 40 public:
42 static const int kStatsTimeoutMs; 41 static const int kStatsTimeoutMs;
43 42
44 SendStatisticsProxy(Clock* clock, 43 SendStatisticsProxy(Clock* clock,
45 const VideoSendStream::Config& config, 44 const VideoSendStream::Config& config,
46 VideoEncoderConfig::ContentType content_type); 45 VideoEncoderConfig::ContentType content_type);
47 virtual ~SendStatisticsProxy(); 46 virtual ~SendStatisticsProxy();
48 47
49 VideoSendStream::Stats GetStats(); 48 VideoSendStream::Stats GetStats();
50 49
51 virtual void OnSendEncodedImage(const EncodedImage& encoded_image, 50 virtual void OnSendEncodedImage(const EncodedImage& encoded_image,
52 const CodecSpecificInfo* codec_info); 51 const CodecSpecificInfo* codec_info);
53 // Used to update incoming frame rate. 52 // Used to update incoming frame rate.
54 void OnIncomingFrame(int width, int height); 53 void OnIncomingFrame(int width, int height);
55 54
56 void OnEncoderStatsUpdate(uint32_t framerate, 55 void OnEncoderStatsUpdate(uint32_t framerate,
57 uint32_t bitrate, 56 uint32_t bitrate,
58 const std::string& encoder_name); 57 const std::string& encoder_name);
59 void OnSuspendChange(bool is_suspended); 58 void OnSuspendChange(bool is_suspended);
60 void OnInactiveSsrc(uint32_t ssrc); 59 void OnInactiveSsrc(uint32_t ssrc);
61 60
62 // Used to indicate change in content type, which may require a change in 61 // Used to indicate change in content type, which may require a change in
63 // how stats are collected. 62 // how stats are collected.
64 void SetContentType(VideoEncoderConfig::ContentType content_type); 63 void SetContentType(VideoEncoderConfig::ContentType content_type);
65 64
66 // Implements VideoEncoderRateObserver. 65 // Used to update the encoder target rate.
67 void OnSetRates(uint32_t bitrate_bps, int framerate) override; 66 void OnSetEncoderTargetRate(uint32_t bitrate_bps);
68 67
69 // Implements CpuOveruseMetricsObserver. 68 // Implements CpuOveruseMetricsObserver.
70 void OnEncodedFrameTimeMeasured(int encode_time_ms, 69 void OnEncodedFrameTimeMeasured(int encode_time_ms,
71 const CpuOveruseMetrics& metrics) override; 70 const CpuOveruseMetrics& metrics) override;
72 71
73 int GetSendFrameRate() const; 72 int GetSendFrameRate() const;
74 73
75 protected: 74 protected:
76 // From RtcpStatisticsCallback. 75 // From RtcpStatisticsCallback.
77 void StatisticsUpdated(const RtcpStatistics& statistics, 76 void StatisticsUpdated(const RtcpStatistics& statistics,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const VideoSendStream::Stats start_stats_; 180 const VideoSendStream::Stats start_stats_;
182 std::map<int, QpCounters> 181 std::map<int, QpCounters>
183 qp_counters_; // QP counters mapped by spatial idx. 182 qp_counters_; // QP counters mapped by spatial idx.
184 }; 183 };
185 184
186 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_); 185 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_);
187 }; 186 };
188 187
189 } // namespace webrtc 188 } // namespace webrtc
190 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ 189 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_
OLDNEW
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698