summaryrefslogtreecommitdiffstats
path: root/media/cast/logging
diff options
context:
space:
mode:
authorimcheng@chromium.org <imcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-06 08:06:25 +0000
committerimcheng@chromium.org <imcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-06 08:06:25 +0000
commit96aab75f46388b39335f41f6a03ede6b46a4c447 (patch)
treeed1f8e9b670427121fbfbcca53c8744c0655e9b5 /media/cast/logging
parent6f62c048956871309c6add746c3b530b1f8e8864 (diff)
downloadchromium_src-96aab75f46388b39335f41f6a03ede6b46a4c447.zip
chromium_src-96aab75f46388b39335f41f6a03ede6b46a4c447.tar.gz
chromium_src-96aab75f46388b39335f41f6a03ede6b46a4c447.tar.bz2
Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
We don't need the event as we have k{AV}FrameReceived already. Rename k{AV}FrameCaptured to k{AV}FrameCaptureBegin, and k{AV}FrameReceived to k{AV}FrameCaptureEnd. kVideoFrameSentToEncoder will be removed from media/cast in a separate patch. BUG=367383 Review URL: https://codereview.chromium.org/258873002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/cast/logging')
-rw-r--r--media/cast/logging/encoding_event_subscriber_unittest.cc12
-rw-r--r--media/cast/logging/logging_defines.cc16
-rw-r--r--media/cast/logging/logging_defines.h12
-rw-r--r--media/cast/logging/logging_impl_unittest.cc22
-rw-r--r--media/cast/logging/proto/proto_utils.cc8
-rw-r--r--media/cast/logging/proto/raw_events.proto12
-rw-r--r--media/cast/logging/serialize_deserialize_test.cc2
-rw-r--r--media/cast/logging/stats_event_subscriber.cc3
-rw-r--r--media/cast/logging/stats_event_subscriber_unittest.cc4
9 files changed, 49 insertions, 42 deletions
diff --git a/media/cast/logging/encoding_event_subscriber_unittest.cc b/media/cast/logging/encoding_event_subscriber_unittest.cc
index 8c919c0..264ae93 100644
--- a/media/cast/logging/encoding_event_subscriber_unittest.cc
+++ b/media/cast/logging/encoding_event_subscriber_unittest.cc
@@ -78,7 +78,7 @@ TEST_F(EncodingEventSubscriberTest, FrameEventTruncating) {
// Entry with RTP timestamp 0 should get dropped.
for (int i = 0; i < 11; i++) {
cast_environment_->Logging()->InsertFrameEvent(now,
- kVideoFrameCaptured,
+ kVideoFrameCaptureBegin,
i * 100,
/*frame_id*/ 0);
cast_environment_->Logging()->InsertFrameEvent(now,
@@ -508,12 +508,12 @@ TEST_F(EncodingEventSubscriberTest, FirstRtpTimestamp) {
base::TimeTicks now(testing_clock_->NowTicks());
cast_environment_->Logging()->InsertFrameEvent(now,
- kVideoFrameCaptured,
+ kVideoFrameCaptureBegin,
rtp_timestamp,
/*frame_id*/ 0);
cast_environment_->Logging()->InsertFrameEvent(now,
- kVideoFrameReceived,
+ kVideoFrameCaptureEnd,
rtp_timestamp + 30,
/*frame_id*/ 1);
@@ -531,7 +531,7 @@ TEST_F(EncodingEventSubscriberTest, FirstRtpTimestamp) {
rtp_timestamp = 67890;
cast_environment_->Logging()->InsertFrameEvent(now,
- kVideoFrameCaptured,
+ kVideoFrameCaptureBegin,
rtp_timestamp,
/*frame_id*/ 0);
GetEventsAndReset();
@@ -545,13 +545,13 @@ TEST_F(EncodingEventSubscriberTest, RelativeRtpTimestampWrapAround) {
base::TimeTicks now(testing_clock_->NowTicks());
cast_environment_->Logging()->InsertFrameEvent(now,
- kVideoFrameCaptured,
+ kVideoFrameCaptureBegin,
rtp_timestamp,
/*frame_id*/ 0);
// RtpTimestamp has now wrapped around.
cast_environment_->Logging()->InsertFrameEvent(now,
- kVideoFrameReceived,
+ kVideoFrameCaptureEnd,
rtp_timestamp + 30,
/*frame_id*/ 1);
diff --git a/media/cast/logging/logging_defines.cc b/media/cast/logging/logging_defines.cc
index 4452d99..bcb9c37 100644
--- a/media/cast/logging/logging_defines.cc
+++ b/media/cast/logging/logging_defines.cc
@@ -25,13 +25,13 @@ const char* CastLoggingToString(CastLoggingEvent event) {
ENUM_TO_STRING(RembBitrate);
ENUM_TO_STRING(AudioAckSent);
ENUM_TO_STRING(VideoAckSent);
- ENUM_TO_STRING(AudioFrameReceived);
- ENUM_TO_STRING(AudioFrameCaptured);
+ ENUM_TO_STRING(AudioFrameCaptureBegin);
+ ENUM_TO_STRING(AudioFrameCaptureEnd);
ENUM_TO_STRING(AudioFrameEncoded);
ENUM_TO_STRING(AudioPlayoutDelay);
ENUM_TO_STRING(AudioFrameDecoded);
- ENUM_TO_STRING(VideoFrameCaptured);
- ENUM_TO_STRING(VideoFrameReceived);
+ ENUM_TO_STRING(VideoFrameCaptureBegin);
+ ENUM_TO_STRING(VideoFrameCaptureEnd);
ENUM_TO_STRING(VideoFrameSentToEncoder);
ENUM_TO_STRING(VideoFrameEncoded);
ENUM_TO_STRING(VideoFrameDecoded);
@@ -58,8 +58,8 @@ EventMediaType GetEventMediaType(CastLoggingEvent event) {
case kRembBitrate:
return OTHER_EVENT;
case kAudioAckSent:
- case kAudioFrameReceived:
- case kAudioFrameCaptured:
+ case kAudioFrameCaptureBegin:
+ case kAudioFrameCaptureEnd:
case kAudioFrameEncoded:
case kAudioPlayoutDelay:
case kAudioFrameDecoded:
@@ -70,8 +70,8 @@ EventMediaType GetEventMediaType(CastLoggingEvent event) {
return AUDIO_EVENT;
case kVideoAckReceived:
case kVideoAckSent:
- case kVideoFrameCaptured:
- case kVideoFrameReceived:
+ case kVideoFrameCaptureBegin:
+ case kVideoFrameCaptureEnd:
case kVideoFrameSentToEncoder:
case kVideoFrameEncoded:
case kVideoFrameDecoded:
diff --git a/media/cast/logging/logging_defines.h b/media/cast/logging/logging_defines.h
index 3acf6f9..f1d5c81 100644
--- a/media/cast/logging/logging_defines.h
+++ b/media/cast/logging/logging_defines.h
@@ -25,21 +25,21 @@ enum CastLoggingEvent {
kPacketLoss,
kJitterMs,
kVideoAckReceived, // Sender side frame event.
- kRembBitrate, // Generic event. No longer used.
+ kRembBitrate, // Generic event. No longer used.
// Receiver side frame events.
kAudioAckSent,
kVideoAckSent,
// Audio sender.
- kAudioFrameReceived,
- kAudioFrameCaptured,
+ kAudioFrameCaptureBegin,
+ kAudioFrameCaptureEnd,
kAudioFrameEncoded,
// Audio receiver.
kAudioFrameDecoded,
kAudioPlayoutDelay,
// Video sender.
- kVideoFrameCaptured,
- kVideoFrameReceived,
- kVideoFrameSentToEncoder,
+ kVideoFrameCaptureBegin,
+ kVideoFrameCaptureEnd,
+ kVideoFrameSentToEncoder, // Deprecated
kVideoFrameEncoded,
// Video receiver.
kVideoFrameDecoded,
diff --git a/media/cast/logging/logging_impl_unittest.cc b/media/cast/logging/logging_impl_unittest.cc
index 9cb7171..cced0ac 100644
--- a/media/cast/logging/logging_impl_unittest.cc
+++ b/media/cast/logging/logging_impl_unittest.cc
@@ -52,8 +52,8 @@ TEST_F(LoggingImplTest, BasicFrameLogging) {
base::TimeTicks now;
do {
now = testing_clock_.NowTicks();
- logging_.InsertFrameEvent(now, kAudioFrameCaptured, rtp_timestamp,
- frame_id);
+ logging_.InsertFrameEvent(
+ now, kAudioFrameCaptureBegin, rtp_timestamp, frame_id);
testing_clock_.Advance(
base::TimeDelta::FromMilliseconds(kFrameIntervalMs));
rtp_timestamp += kFrameIntervalMs * 90;
@@ -111,7 +111,10 @@ TEST_F(LoggingImplTest, FrameLoggingWithDelay) {
int delay = kPlayoutDelayMs +
base::RandInt(-kRandomSizeInterval, kRandomSizeInterval);
logging_.InsertFrameEventWithDelay(
- testing_clock_.NowTicks(), kAudioFrameCaptured, rtp_timestamp, frame_id,
+ testing_clock_.NowTicks(),
+ kAudioFrameCaptureBegin,
+ rtp_timestamp,
+ frame_id,
base::TimeDelta::FromMilliseconds(delay));
testing_clock_.Advance(base::TimeDelta::FromMilliseconds(kFrameIntervalMs));
rtp_timestamp += kFrameIntervalMs * 90;
@@ -132,8 +135,10 @@ TEST_F(LoggingImplTest, MultipleEventFrameLogging) {
uint32 frame_id = 0u;
uint32 num_events = 0u;
do {
- logging_.InsertFrameEvent(testing_clock_.NowTicks(), kAudioFrameCaptured,
- rtp_timestamp, frame_id);
+ logging_.InsertFrameEvent(testing_clock_.NowTicks(),
+ kAudioFrameCaptureBegin,
+ rtp_timestamp,
+ frame_id);
++num_events;
if (frame_id % 2) {
logging_.InsertEncodedFrameEvent(testing_clock_.NowTicks(),
@@ -205,9 +210,10 @@ TEST_F(LoggingImplTest, MultipleRawEventSubscribers) {
// Now logging_ has two subscribers.
logging_.AddRawEventSubscriber(&event_subscriber_2);
- logging_.InsertFrameEvent(testing_clock_.NowTicks(), kAudioFrameCaptured,
- /*rtp_timestamp*/ 0u,
- /*frame_id*/ 0u);
+ logging_.InsertFrameEvent(testing_clock_.NowTicks(),
+ kAudioFrameCaptureBegin,
+ /*rtp_timestamp*/ 0u,
+ /*frame_id*/ 0u);
std::vector<FrameEvent> frame_events;
event_subscriber_.GetFrameEventsAndReset(&frame_events);
diff --git a/media/cast/logging/proto/proto_utils.cc b/media/cast/logging/proto/proto_utils.cc
index 6ca194b..90517e1 100644
--- a/media/cast/logging/proto/proto_utils.cc
+++ b/media/cast/logging/proto/proto_utils.cc
@@ -23,13 +23,13 @@ media::cast::proto::EventType ToProtoEventType(CastLoggingEvent event) {
TO_PROTO_ENUM(kRembBitrate, REMB_BITRATE);
TO_PROTO_ENUM(kAudioAckSent, AUDIO_ACK_SENT);
TO_PROTO_ENUM(kVideoAckSent, VIDEO_ACK_SENT);
- TO_PROTO_ENUM(kAudioFrameReceived, AUDIO_FRAME_RECEIVED);
- TO_PROTO_ENUM(kAudioFrameCaptured, AUDIO_FRAME_CAPTURED);
+ TO_PROTO_ENUM(kAudioFrameCaptureEnd, AUDIO_FRAME_CAPTURE_END);
+ TO_PROTO_ENUM(kAudioFrameCaptureBegin, AUDIO_FRAME_CAPTURE_BEGIN);
TO_PROTO_ENUM(kAudioFrameEncoded, AUDIO_FRAME_ENCODED);
TO_PROTO_ENUM(kAudioPlayoutDelay, AUDIO_PLAYOUT_DELAY);
TO_PROTO_ENUM(kAudioFrameDecoded, AUDIO_FRAME_DECODED);
- TO_PROTO_ENUM(kVideoFrameCaptured, VIDEO_FRAME_CAPTURED);
- TO_PROTO_ENUM(kVideoFrameReceived, VIDEO_FRAME_RECEIVED);
+ TO_PROTO_ENUM(kVideoFrameCaptureBegin, VIDEO_FRAME_CAPTURE_BEGIN);
+ TO_PROTO_ENUM(kVideoFrameCaptureEnd, VIDEO_FRAME_CAPTURE_END);
TO_PROTO_ENUM(kVideoFrameSentToEncoder, VIDEO_FRAME_SENT_TO_ENCODER);
TO_PROTO_ENUM(kVideoFrameEncoded, VIDEO_FRAME_ENCODED);
TO_PROTO_ENUM(kVideoFrameDecoded, VIDEO_FRAME_DECODED);
diff --git a/media/cast/logging/proto/raw_events.proto b/media/cast/logging/proto/raw_events.proto
index 8f232cf..adbd943 100644
--- a/media/cast/logging/proto/raw_events.proto
+++ b/media/cast/logging/proto/raw_events.proto
@@ -19,22 +19,22 @@ enum EventType {
PACKET_LOSS = 2;
JITTER_MS = 3;
VIDEO_ACK_RECEIVED = 4; // Sender side frame event.
- REMB_BITRATE = 5; // Generic event. No longer used.
+ REMB_BITRATE = 5; // Generic event. No longer used.
// Audio receiver.
AUDIO_ACK_SENT = 6;
// Video receiver.
VIDEO_ACK_SENT = 7;
// Audio sender.
- AUDIO_FRAME_RECEIVED = 8;
- AUDIO_FRAME_CAPTURED = 9;
+ AUDIO_FRAME_CAPTURE_END = 8;
+ AUDIO_FRAME_CAPTURE_BEGIN = 9;
AUDIO_FRAME_ENCODED = 10;
// Audio receiver.
AUDIO_PLAYOUT_DELAY = 11;
AUDIO_FRAME_DECODED = 12;
// Video sender.
- VIDEO_FRAME_CAPTURED = 13;
- VIDEO_FRAME_RECEIVED = 14;
- VIDEO_FRAME_SENT_TO_ENCODER = 15;
+ VIDEO_FRAME_CAPTURE_BEGIN = 13;
+ VIDEO_FRAME_CAPTURE_END = 14;
+ VIDEO_FRAME_SENT_TO_ENCODER = 15; // Deprecated
VIDEO_FRAME_ENCODED = 16;
// Video receiver.
VIDEO_FRAME_DECODED = 17;
diff --git a/media/cast/logging/serialize_deserialize_test.cc b/media/cast/logging/serialize_deserialize_test.cc
index d1d7a4a..b309ced 100644
--- a/media/cast/logging/serialize_deserialize_test.cc
+++ b/media/cast/logging/serialize_deserialize_test.cc
@@ -20,7 +20,7 @@ using media::cast::proto::LogMetadata;
namespace {
const media::cast::CastLoggingEvent kVideoFrameEvents[] = {
- media::cast::kVideoFrameCaptured, media::cast::kVideoFrameReceived,
+ media::cast::kVideoFrameCaptureBegin, media::cast::kVideoFrameCaptureEnd,
media::cast::kVideoFrameSentToEncoder, media::cast::kVideoFrameEncoded,
media::cast::kVideoFrameDecoded, media::cast::kVideoRenderDelay};
diff --git a/media/cast/logging/stats_event_subscriber.cc b/media/cast/logging/stats_event_subscriber.cc
index 008add1..e292d66 100644
--- a/media/cast/logging/stats_event_subscriber.cc
+++ b/media/cast/logging/stats_event_subscriber.cc
@@ -23,7 +23,8 @@ const size_t kMaxFrameEventTimeMapSize = 100;
const size_t kMaxPacketEventTimeMapSize = 1000;
CastLoggingEvent GetCapturedEvent(EventMediaType media_type) {
- return media_type == AUDIO_EVENT ? kAudioFrameCaptured : kVideoFrameCaptured;
+ return media_type == AUDIO_EVENT ?
+ kAudioFrameCaptureBegin : kVideoFrameCaptureBegin;
}
CastLoggingEvent GetEncodedEvent(EventMediaType media_type) {
diff --git a/media/cast/logging/stats_event_subscriber_unittest.cc b/media/cast/logging/stats_event_subscriber_unittest.cc
index 7d6b5c8..90602d5 100644
--- a/media/cast/logging/stats_event_subscriber_unittest.cc
+++ b/media/cast/logging/stats_event_subscriber_unittest.cc
@@ -74,7 +74,7 @@ TEST_F(StatsEventSubscriberTest, Capture) {
base::TimeTicks start_time = sender_clock_->NowTicks();
for (int i = 0; i < num_frames; i++) {
cast_environment_->Logging()->InsertFrameEvent(sender_clock_->NowTicks(),
- kVideoFrameCaptured,
+ kVideoFrameCaptureBegin,
rtp_timestamp,
frame_id);
@@ -220,7 +220,7 @@ TEST_F(StatsEventSubscriberTest, E2ELatency) {
base::TimeDelta total_latency;
for (int i = 0; i < num_frames; i++) {
cast_environment_->Logging()->InsertFrameEvent(sender_clock_->NowTicks(),
- kVideoFrameCaptured,
+ kVideoFrameCaptureBegin,
rtp_timestamp,
frame_id);