(Auto)update libjingle 66294299-> 66299810
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6062 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
150835ea34
commit
0b53bd29af
@ -326,11 +326,13 @@ std::string VideoCapturer::ToString(const CapturedFrame* captured_frame) const {
|
|||||||
|
|
||||||
void VideoCapturer::GetStats(VariableInfo<int>* adapt_drops_stats,
|
void VideoCapturer::GetStats(VariableInfo<int>* adapt_drops_stats,
|
||||||
VariableInfo<int>* effect_drops_stats,
|
VariableInfo<int>* effect_drops_stats,
|
||||||
VariableInfo<double>* frame_time_stats) {
|
VariableInfo<double>* frame_time_stats,
|
||||||
|
VideoFormat* last_captured_frame_format) {
|
||||||
talk_base::CritScope cs(&frame_stats_crit_);
|
talk_base::CritScope cs(&frame_stats_crit_);
|
||||||
GetVariableSnapshot(adapt_frame_drops_data_, adapt_drops_stats);
|
GetVariableSnapshot(adapt_frame_drops_data_, adapt_drops_stats);
|
||||||
GetVariableSnapshot(effect_frame_drops_data_, effect_drops_stats);
|
GetVariableSnapshot(effect_frame_drops_data_, effect_drops_stats);
|
||||||
GetVariableSnapshot(frame_time_data_, frame_time_stats);
|
GetVariableSnapshot(frame_time_data_, frame_time_stats);
|
||||||
|
*last_captured_frame_format = last_captured_frame_format_;
|
||||||
|
|
||||||
adapt_frame_drops_data_.Reset();
|
adapt_frame_drops_data_.Reset();
|
||||||
effect_frame_drops_data_.Reset();
|
effect_frame_drops_data_.Reset();
|
||||||
@ -530,18 +532,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*,
|
|||||||
}
|
}
|
||||||
SignalVideoFrame(this, adapted_frame);
|
SignalVideoFrame(this, adapted_frame);
|
||||||
|
|
||||||
double time_now = frame_length_time_reporter_.TimerNow();
|
UpdateStats(captured_frame);
|
||||||
if (previous_frame_time_ != 0.0) {
|
|
||||||
// Update stats protected from jmi data fetches.
|
|
||||||
talk_base::CritScope cs(&frame_stats_crit_);
|
|
||||||
|
|
||||||
adapt_frame_drops_data_.AddSample(adapt_frame_drops_);
|
|
||||||
effect_frame_drops_data_.AddSample(effect_frame_drops_);
|
|
||||||
frame_time_data_.AddSample(time_now - previous_frame_time_);
|
|
||||||
}
|
|
||||||
previous_frame_time_ = time_now;
|
|
||||||
effect_frame_drops_ = 0;
|
|
||||||
adapt_frame_drops_ = 0;
|
|
||||||
|
|
||||||
#endif // VIDEO_FRAME_NAME
|
#endif // VIDEO_FRAME_NAME
|
||||||
}
|
}
|
||||||
@ -717,6 +708,27 @@ bool VideoCapturer::ShouldFilterFormat(const VideoFormat& format) const {
|
|||||||
format.height > max_format_->height;
|
format.height > max_format_->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VideoCapturer::UpdateStats(const CapturedFrame* captured_frame) {
|
||||||
|
// Update stats protected from fetches from different thread.
|
||||||
|
talk_base::CritScope cs(&frame_stats_crit_);
|
||||||
|
|
||||||
|
last_captured_frame_format_.width = captured_frame->width;
|
||||||
|
last_captured_frame_format_.height = captured_frame->height;
|
||||||
|
// TODO(ronghuawu): Useful to report interval as well?
|
||||||
|
last_captured_frame_format_.interval = 0;
|
||||||
|
last_captured_frame_format_.fourcc = captured_frame->fourcc;
|
||||||
|
|
||||||
|
double time_now = frame_length_time_reporter_.TimerNow();
|
||||||
|
if (previous_frame_time_ != 0.0) {
|
||||||
|
adapt_frame_drops_data_.AddSample(adapt_frame_drops_);
|
||||||
|
effect_frame_drops_data_.AddSample(effect_frame_drops_);
|
||||||
|
frame_time_data_.AddSample(time_now - previous_frame_time_);
|
||||||
|
}
|
||||||
|
previous_frame_time_ = time_now;
|
||||||
|
effect_frame_drops_ = 0;
|
||||||
|
adapt_frame_drops_ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void VideoCapturer::GetVariableSnapshot(
|
void VideoCapturer::GetVariableSnapshot(
|
||||||
const talk_base::RollingAccumulator<T>& data,
|
const talk_base::RollingAccumulator<T>& data,
|
||||||
|
@ -294,7 +294,8 @@ class VideoCapturer
|
|||||||
// should be called only periodically to log statistics.
|
// should be called only periodically to log statistics.
|
||||||
void GetStats(VariableInfo<int>* adapt_drop_stats,
|
void GetStats(VariableInfo<int>* adapt_drop_stats,
|
||||||
VariableInfo<int>* effect_drop_stats,
|
VariableInfo<int>* effect_drop_stats,
|
||||||
VariableInfo<double>* frame_time_stats);
|
VariableInfo<double>* frame_time_stats,
|
||||||
|
VideoFormat* last_captured_frame_format);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Callback attached to SignalFrameCaptured where SignalVideoFrames is called.
|
// Callback attached to SignalFrameCaptured where SignalVideoFrames is called.
|
||||||
@ -348,6 +349,8 @@ class VideoCapturer
|
|||||||
// Returns true if format doesn't fulfill all applied restrictions.
|
// Returns true if format doesn't fulfill all applied restrictions.
|
||||||
bool ShouldFilterFormat(const VideoFormat& format) const;
|
bool ShouldFilterFormat(const VideoFormat& format) const;
|
||||||
|
|
||||||
|
void UpdateStats(const CapturedFrame* captured_frame);
|
||||||
|
|
||||||
// Helper function to save statistics on the current data from a
|
// Helper function to save statistics on the current data from a
|
||||||
// RollingAccumulator into stats.
|
// RollingAccumulator into stats.
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -385,6 +388,8 @@ class VideoCapturer
|
|||||||
talk_base::RollingAccumulator<int> effect_frame_drops_data_;
|
talk_base::RollingAccumulator<int> effect_frame_drops_data_;
|
||||||
double previous_frame_time_;
|
double previous_frame_time_;
|
||||||
talk_base::RollingAccumulator<double> frame_time_data_;
|
talk_base::RollingAccumulator<double> frame_time_data_;
|
||||||
|
// The captured frame format before potential adapation.
|
||||||
|
VideoFormat last_captured_frame_format_;
|
||||||
|
|
||||||
talk_base::CriticalSection crit_;
|
talk_base::CriticalSection crit_;
|
||||||
VideoProcessors video_processors_;
|
VideoProcessors video_processors_;
|
||||||
|
@ -2381,20 +2381,22 @@ bool WebRtcVideoMediaChannel::GetStats(const StatsOptions& options,
|
|||||||
sinfo.packets_lost = -1;
|
sinfo.packets_lost = -1;
|
||||||
sinfo.fraction_lost = -1;
|
sinfo.fraction_lost = -1;
|
||||||
sinfo.rtt_ms = -1;
|
sinfo.rtt_ms = -1;
|
||||||
sinfo.input_frame_width = static_cast<int>(channel_stream_info->width());
|
|
||||||
sinfo.input_frame_height =
|
|
||||||
static_cast<int>(channel_stream_info->height());
|
|
||||||
|
|
||||||
VideoCapturer* video_capturer = send_channel->video_capturer();
|
VideoCapturer* video_capturer = send_channel->video_capturer();
|
||||||
if (video_capturer) {
|
if (video_capturer) {
|
||||||
|
VideoFormat last_captured_frame_format;
|
||||||
video_capturer->GetStats(&sinfo.adapt_frame_drops,
|
video_capturer->GetStats(&sinfo.adapt_frame_drops,
|
||||||
&sinfo.effects_frame_drops,
|
&sinfo.effects_frame_drops,
|
||||||
&sinfo.capturer_frame_time);
|
&sinfo.capturer_frame_time,
|
||||||
|
&last_captured_frame_format);
|
||||||
|
sinfo.input_frame_width = last_captured_frame_format.width;
|
||||||
|
sinfo.input_frame_height = last_captured_frame_format.height;
|
||||||
|
} else {
|
||||||
|
sinfo.input_frame_width = 0;
|
||||||
|
sinfo.input_frame_height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
webrtc::VideoCodec vie_codec;
|
webrtc::VideoCodec vie_codec;
|
||||||
// TODO(ronghuawu): Add unit tests to cover the new send stats:
|
|
||||||
// send_frame_width/height.
|
|
||||||
if (!video_capturer || video_capturer->IsMuted()) {
|
if (!video_capturer || video_capturer->IsMuted()) {
|
||||||
sinfo.send_frame_width = 0;
|
sinfo.send_frame_width = 0;
|
||||||
sinfo.send_frame_height = 0;
|
sinfo.send_frame_height = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user