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

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

Issue 2933213003: 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 df1fe60c8d19ce59c17cb5d18b9475598e053892..211984142ad76d3894166412b669e694c24b1a68 100644
--- a/content/renderer/media/gpu/rtc_video_encoder.cc
+++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -208,6 +208,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_;
@@ -410,6 +413,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);
@@ -427,6 +431,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,
@@ -512,7 +521,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