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

Unified Diff: media/cast/audio_receiver/audio_receiver.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
« no previous file with comments | « media/cast/audio_receiver/audio_receiver.h ('k') | media/cast/audio_receiver/audio_receiver_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/audio_receiver/audio_receiver.cc
diff --git a/media/cast/audio_receiver/audio_receiver.cc b/media/cast/audio_receiver/audio_receiver.cc
index 94abdfffb13b9f00e0b094a7f7da82294200e813..212419c81d616180cd868debab7c9f1dc0f13bab 100644
--- a/media/cast/audio_receiver/audio_receiver.cc
+++ b/media/cast/audio_receiver/audio_receiver.cc
@@ -26,8 +26,7 @@ AudioReceiver::AudioReceiver(scoped_refptr<CastEnvironment> cast_environment,
transport::PacedPacketSender* const packet_sender)
: RtpReceiver(cast_environment->Clock(), &audio_config, NULL),
cast_environment_(cast_environment),
- event_subscriber_(kReceiverRtcpEventHistorySize,
- ReceiverRtcpEventSubscriber::kAudioEventSubscriber),
+ event_subscriber_(kReceiverRtcpEventHistorySize, AUDIO_EVENT),
codec_(audio_config.codec),
frequency_(audio_config.frequency),
target_delay_delta_(
@@ -46,7 +45,8 @@ AudioReceiver::AudioReceiver(scoped_refptr<CastEnvironment> cast_environment,
base::TimeDelta::FromMilliseconds(audio_config.rtcp_interval),
audio_config.feedback_ssrc,
audio_config.incoming_ssrc,
- audio_config.rtcp_c_name),
+ audio_config.rtcp_c_name,
+ true),
is_waiting_for_consecutive_frame_(false),
weak_factory_(this) {
if (!audio_config.use_external_decoder)
@@ -84,26 +84,16 @@ void AudioReceiver::OnReceivedPayloadData(const uint8* payload_data,
frame_id_to_rtp_timestamp_[rtp_header.frame_id & 0xff] =
rtp_header.rtp_timestamp;
cast_environment_->Logging()->InsertPacketEvent(
- now, kAudioPacketReceived, rtp_header.rtp_timestamp,
+ now, PACKET_RECEIVED, AUDIO_EVENT, rtp_header.rtp_timestamp,
rtp_header.frame_id, rtp_header.packet_id, rtp_header.max_packet_id,
payload_size);
bool duplicate = false;
const bool complete =
framer_.InsertPacket(payload_data, payload_size, rtp_header, &duplicate);
- if (duplicate) {
- cast_environment_->Logging()->InsertPacketEvent(
- now,
- kDuplicateAudioPacketReceived,
- rtp_header.rtp_timestamp,
- rtp_header.frame_id,
- rtp_header.packet_id,
- rtp_header.max_packet_id,
- payload_size);
- // Duplicate packets are ignored.
- return;
- }
- if (!complete)
+
+ // Duplicate packets are ignored.
+ if (duplicate || !complete)
return;
EmitAvailableEncodedFrames();
@@ -155,9 +145,9 @@ void AudioReceiver::EmitRawAudioFrame(
if (audio_bus.get()) {
const base::TimeTicks now = cast_environment->Clock()->NowTicks();
cast_environment->Logging()->InsertFrameEvent(
- now, kAudioFrameDecoded, rtp_timestamp, frame_id);
+ now, FRAME_DECODED, AUDIO_EVENT, rtp_timestamp, frame_id);
cast_environment->Logging()->InsertFrameEventWithDelay(
- now, kAudioPlayoutDelay, rtp_timestamp, frame_id,
+ now, FRAME_PLAYOUT, AUDIO_EVENT, rtp_timestamp, frame_id,
playout_time - now);
}
callback.Run(audio_bus.Pass(), playout_time, is_continuous);
@@ -266,7 +256,8 @@ void AudioReceiver::CastFeedback(const RtcpCastMessage& cast_message) {
RtpTimestamp rtp_timestamp =
frame_id_to_rtp_timestamp_[cast_message.ack_frame_id_ & 0xff];
cast_environment_->Logging()->InsertFrameEvent(
- now, kAudioAckSent, rtp_timestamp, cast_message.ack_frame_id_);
+ now, FRAME_ACK_SENT, AUDIO_EVENT, rtp_timestamp,
+ cast_message.ack_frame_id_);
ReceiverRtcpEventSubscriber::RtcpEventMultiMap rtcp_events;
event_subscriber_.GetRtcpEventsAndReset(&rtcp_events);
« no previous file with comments | « media/cast/audio_receiver/audio_receiver.h ('k') | media/cast/audio_receiver/audio_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698