webrtc_m130/webrtc/video/send_statistics_proxy.h
stefan@webrtc.org 168f23faa5 Move pacer to fully use webrtc::Clock instead of webrtc::TickTime.
This required rewriting the send-side delay stats api to be callback based, as otherwise the SuspendBelowMinBitrate test started flaking much more frequently since it had lock order inversion problems.

R=pbos@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/21869005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6664 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-07-11 13:44:02 +00:00

87 lines
3.2 KiB
C++

/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_
#define WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_
#include <string>
#include "webrtc/common_types.h"
#include "webrtc/video_engine/include/vie_codec.h"
#include "webrtc/video_engine/include/vie_capture.h"
#include "webrtc/video_send_stream.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/thread_annotations.h"
namespace webrtc {
class CriticalSectionWrapper;
class SendStatisticsProxy : public RtcpStatisticsCallback,
public StreamDataCountersCallback,
public BitrateStatisticsObserver,
public FrameCountObserver,
public ViEEncoderObserver,
public ViECaptureObserver,
public SendSideDelayObserver {
public:
explicit SendStatisticsProxy(const VideoSendStream::Config& config);
virtual ~SendStatisticsProxy();
VideoSendStream::Stats GetStats() const;
protected:
// From RtcpStatisticsCallback.
virtual void StatisticsUpdated(const RtcpStatistics& statistics,
uint32_t ssrc) OVERRIDE;
// From StreamDataCountersCallback.
virtual void DataCountersUpdated(const StreamDataCounters& counters,
uint32_t ssrc) OVERRIDE;
// From BitrateStatisticsObserver.
virtual void Notify(const BitrateStatistics& stats, uint32_t ssrc) OVERRIDE;
// From FrameCountObserver.
virtual void FrameCountUpdated(FrameType frame_type,
uint32_t frame_count,
const unsigned int ssrc) OVERRIDE;
// From ViEEncoderObserver.
virtual void OutgoingRate(const int video_channel,
const unsigned int framerate,
const unsigned int bitrate) OVERRIDE;
virtual void SuspendChange(int video_channel, bool is_suspended) OVERRIDE;
// From ViECaptureObserver.
virtual void BrightnessAlarm(const int capture_id,
const Brightness brightness) OVERRIDE {}
virtual void CapturedFrameRate(const int capture_id,
const unsigned char frame_rate) OVERRIDE;
virtual void NoPictureAlarm(const int capture_id,
const CaptureAlarm alarm) OVERRIDE {}
virtual void SendSideDelayUpdated(int avg_delay_ms,
int max_delay_ms,
uint32_t ssrc) OVERRIDE;
private:
StreamStats* GetStatsEntry(uint32_t ssrc) EXCLUSIVE_LOCKS_REQUIRED(crit_);
const VideoSendStream::Config config_;
scoped_ptr<CriticalSectionWrapper> crit_;
VideoSendStream::Stats stats_ GUARDED_BY(crit_);
};
} // namespace webrtc
#endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_