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

Unified Diff: chrome/renderer/media/cast_session_delegate.cc

Issue 184853003: Cast: Add GetStats() extensions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static cast to int Created 6 years, 9 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: chrome/renderer/media/cast_session_delegate.cc
diff --git a/chrome/renderer/media/cast_session_delegate.cc b/chrome/renderer/media/cast_session_delegate.cc
index a1432770ced56074c98a2dc79e6588059b264360..5c9671c1cbaff6a2f376ccf9273f2bfc9767d712 100644
--- a/chrome/renderer/media/cast_session_delegate.cc
+++ b/chrome/renderer/media/cast_session_delegate.cc
@@ -182,6 +182,21 @@ void CastSessionDelegate::GetEventLogsAndReset(
callback.Run(serialized_log.Pass());
}
+void CastSessionDelegate::GetStatsAndReset(bool is_audio,
+ const StatsCallback& callback) {
+ media::cast::FrameStatsMap frame_stats =
+ cast_environment_->Logging()->GetFrameStatsData(
+ is_audio ? media::cast::AUDIO_EVENT : media::cast::VIDEO_EVENT);
+ media::cast::PacketStatsMap packet_stats =
+ cast_environment_->Logging()->GetPacketStatsData(
+ is_audio ? media::cast::AUDIO_EVENT : media::cast::VIDEO_EVENT);
+
+ scoped_ptr<base::DictionaryValue> stats = media::cast::ConvertStats(
+ frame_stats, packet_stats);
+
+ callback.Run(stats.Pass());
+}
+
void CastSessionDelegate::StatusNotificationCB(
media::cast::transport::CastTransportStatus unused_status) {
DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
« no previous file with comments | « chrome/renderer/media/cast_session_delegate.h ('k') | chrome/test/data/extensions/api_test/cast_streaming/basics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698