Redo 587688 and 592088 to add histograms in capturer

This change redoes
https://chromium-review.googlesource.com/587688
and
https://chromium-review.googlesource.com/592088

The above two changes added histograms in webrtc capturer implementations to
track the edge cases.

After change https://chromium-review.googlesource.com/c/617845, this change
should be safe to be merged into webrtc.

Bug: webrtc:8040, webrtc:8046
Change-Id: I28b9f26227a5a231c918969d8280ede91015dbe4
Reviewed-on: https://chromium-review.googlesource.com/615852
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Zijie He <zijiehe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#19437}
This commit is contained in:
Zijie He 2017-08-15 15:31:31 -07:00 committed by Commit Bot
parent 1fd66656b3
commit 565d046edc
3 changed files with 14 additions and 1 deletions

View File

@ -15,6 +15,7 @@
#include "webrtc/modules/desktop_capture/desktop_geometry.h"
#include "webrtc/rtc_base/checks.h"
#include "webrtc/system_wrappers/include/metrics.h"
namespace webrtc {
@ -78,6 +79,8 @@ void BlankDetectorDesktopCapturerWrapper::OnCaptureResult(
last_frame_is_blank_ = IsBlankFrame(*frame);
is_first_frame_ = false;
}
RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.BlankFrameDetected",
last_frame_is_blank_);
if (!last_frame_is_blank_) {
non_blank_frame_received_ = true;
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));

View File

@ -13,6 +13,7 @@
#include <utility>
#include "webrtc/rtc_base/checks.h"
#include "webrtc/system_wrappers/include/metrics.h"
namespace webrtc {
@ -145,6 +146,10 @@ void FallbackDesktopCapturerWrapper::OnCaptureResult(
Result result,
std::unique_ptr<DesktopFrame> frame) {
RTC_DCHECK(callback_);
RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.PrimaryCapturerError",
result != Result::SUCCESS);
RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.PrimaryCapturerPermanentError",
result == Result::ERROR_PERMANENT);
if (result == Result::SUCCESS) {
callback_->OnCaptureResult(result, std::move(frame));
return;

View File

@ -17,6 +17,7 @@
#include "webrtc/rtc_base/checks.h"
#include "webrtc/rtc_base/logging.h"
#include "webrtc/system_wrappers/include/metrics.h"
using Microsoft::WRL::ComPtr;
@ -44,7 +45,11 @@ bool DxgiTextureStaging::InitializeStage(ID3D11Texture2D* texture) {
AssertStageAndSurfaceAreSameObject();
D3D11_TEXTURE2D_DESC current_desc;
stage_->GetDesc(&current_desc);
if (memcmp(&desc, &current_desc, sizeof(D3D11_TEXTURE2D_DESC)) == 0) {
const bool recreate_needed = (
memcmp(&desc, &current_desc, sizeof(D3D11_TEXTURE2D_DESC)) != 0);
RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.StagingTextureRecreate",
recreate_needed);
if (!recreate_needed) {
return true;
}