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

Unified Diff: media/cast/logging/receiver_time_offset_estimator_impl.cc

Issue 270493003: Cast: Deduplicate event types in cast library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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
Index: media/cast/logging/receiver_time_offset_estimator_impl.cc
diff --git a/media/cast/logging/receiver_time_offset_estimator_impl.cc b/media/cast/logging/receiver_time_offset_estimator_impl.cc
index 897c7e1a4b6fe097d918ea64b2af416335467177..44d5eb0b3d731e954ecb32d7f393de374704c784 100644
--- a/media/cast/logging/receiver_time_offset_estimator_impl.cc
+++ b/media/cast/logging/receiver_time_offset_estimator_impl.cc
@@ -25,9 +25,13 @@ ReceiverTimeOffsetEstimatorImpl::~ReceiverTimeOffsetEstimatorImpl() {
void ReceiverTimeOffsetEstimatorImpl::OnReceiveFrameEvent(
const FrameEvent& frame_event) {
DCHECK(thread_checker_.CalledOnValidThread());
+
+ if (frame_event.media_type != VIDEO_EVENT)
+ return;
+
CastLoggingEvent event = frame_event.type;
- if (event != kVideoFrameEncoded && event != kVideoAckSent &&
- event != kVideoAckReceived)
+ if (event != FRAME_ENCODED && event != FRAME_ACK_SENT &&
+ event != FRAME_ACK_RECEIVED)
return;
EventTimesMap::iterator it = event_times_map_.find(frame_event.rtp_timestamp);
@@ -37,7 +41,7 @@ void ReceiverTimeOffsetEstimatorImpl::OnReceiveFrameEvent(
event_times)).first;
}
switch (event) {
- case kVideoFrameEncoded:
+ case FRAME_ENCODED:
// Encode is supposed to happen only once. If we see duplicate event,
// throw away the entry.
if (it->second.event_a_time.is_null()) {
@@ -47,7 +51,7 @@ void ReceiverTimeOffsetEstimatorImpl::OnReceiveFrameEvent(
return;
}
break;
- case kVideoAckSent:
+ case FRAME_ACK_SENT:
if (it->second.event_b_time.is_null()) {
it->second.event_b_time = frame_event.timestamp;
} else if (it->second.event_b_time != frame_event.timestamp) {
@@ -57,7 +61,7 @@ void ReceiverTimeOffsetEstimatorImpl::OnReceiveFrameEvent(
return;
}
break;
- case kVideoAckReceived:
+ case FRAME_ACK_RECEIVED:
// If there are duplicate ack received events, pick the one with the
// smallest event timestamp so we can get a better bound.
if (it->second.event_c_time.is_null()) {

Powered by Google App Engine
This is Rietveld 408576698