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

Unified Diff: content/renderer/media/gpu/rtc_video_encoder.cc

Issue 2948623002: Merge 60: Handle zero timestamp in RTCVideoEncoder timestamp matching & add UMA (Closed)
Patch Set: Created 3 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/gpu/rtc_video_encoder.cc
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc
index d0133bf80752249a476272d8c4e94b06dc270e84..714009ea8a7467f4eb62c42ee14e3545f3bf91ab 100644
--- a/content/renderer/media/gpu/rtc_video_encoder.cc
+++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -207,6 +207,9 @@ class RTCVideoEncoder::Impl
void SetStatus(int32_t status);
+ // Records |failed_timestamp_match_| value after a session.
+ void RecordTimestampMatchUMA() const;
+
// This is attached to |gpu_task_runner_|, not the thread class is constructed
// on.
base::ThreadChecker thread_checker_;
@@ -409,6 +412,7 @@ void RTCVideoEncoder::Impl::RequestEncodingParametersChange(
void RTCVideoEncoder::Impl::Destroy(base::WaitableEvent* async_waiter) {
DVLOG(3) << "Impl::Destroy()";
DCHECK(thread_checker_.CalledOnValidThread());
+ RecordTimestampMatchUMA();
if (video_encoder_) {
video_encoder_.reset();
SetStatus(WEBRTC_VIDEO_CODEC_UNINITIALIZED);
@@ -426,6 +430,11 @@ void RTCVideoEncoder::Impl::SetStatus(int32_t status) {
status_ = status;
}
+void RTCVideoEncoder::Impl::RecordTimestampMatchUMA() const {
+ UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderTimestampMatchSuccess",
+ failed_timestamp_match_ == false);
+}
+
void RTCVideoEncoder::Impl::RequireBitstreamBuffers(
unsigned int input_count,
const gfx::Size& input_coded_size,
@@ -511,7 +520,7 @@ void RTCVideoEncoder::Impl::BitstreamBufferReady(int32_t bitstream_buffer_id,
// Find RTP timestamp by going through |pending_timestamps_|. Derive it from
// capture time otherwise.
base::Optional<uint32_t> rtp_timestamp;
- if (!timestamp.is_zero() && !failed_timestamp_match_) {
+ if (!failed_timestamp_match_) {
// Pop timestamps until we have a match.
while (!pending_timestamps_.empty()) {
const auto& front_timestamps = pending_timestamps_.front();
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698