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

Unified Diff: media/cast/test/sender.cc

Issue 184853003: Cast: Add GetStats() extensions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add files Created 6 years, 10 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/test/sender.cc
diff --git a/media/cast/test/sender.cc b/media/cast/test/sender.cc
index 16f55dcd234e0a69e2705d7a741c7a8ffe28f768..0ec130f759aff9497ee099c752f0816b235ce0ee 100644
--- a/media/cast/test/sender.cc
+++ b/media/cast/test/sender.cc
@@ -19,6 +19,7 @@
#include "media/cast/logging/log_serializer.h"
#include "media/cast/logging/logging_defines.h"
#include "media/cast/logging/proto/raw_events.pb.h"
+#include "media/cast/logging/stats_serializer.h"
#include "media/cast/test/utility/audio_utility.h"
#include "media/cast/test/utility/input_builder.h"
#include "media/cast/test/utility/video_utility.h"
@@ -382,6 +383,28 @@ void WriteLogsToFileAndStopSubscribing(
&(*serialized_string)[0], 1, serialized_string->size(), log_file.get());
if (ret != serialized_string->size())
VLOG(1) << "Failed to write logs to file.";
+
+ scoped_ptr<std::string> audio_stats_json(new std::string);
+ bool success = media::cast::SerializeStats(
+ cast_environment->Logging()->GetFrameStatsData(media::cast::AUDIO_EVENT),
+ cast_environment->Logging()->GetPacketStatsData(media::cast::AUDIO_EVENT),
+ audio_stats_json.get());
+
+ // We can write this string to a file if needed.
+ if (success)
+ VLOG(0) << "Audio stats JSON string: " << *audio_stats_json;
+ else
+ VLOG(1) << "Failed to write audio stats JSON string.";
+
+ scoped_ptr<std::string> video_stats_json(new std::string);
+ success = media::cast::SerializeStats(
+ cast_environment->Logging()->GetFrameStatsData(media::cast::VIDEO_EVENT),
+ cast_environment->Logging()->GetPacketStatsData(media::cast::VIDEO_EVENT),
+ video_stats_json.get());
+ if (success)
+ VLOG(0) << "Video stats JSON string: " << *video_stats_json;
+ else
+ VLOG(1) << "Failed to write video stats JSON string.";
}
} // namespace
« media/cast/logging/stats_converter.cc ('K') | « media/cast/logging/stats_converter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698