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

Unified Diff: media/base/media_log.h

Issue 1236543007: MSE: Log buffered audio splice generation to media-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/base/media_log.h
diff --git a/media/base/media_log.h b/media/base/media_log.h
index 1e4b9464dd761a6deecf1616eaeabcec3ed6d38b..48b5e979ec205a9bb817f4ea32899d8c90c3f141 100644
--- a/media/base/media_log.h
+++ b/media/base/media_log.h
@@ -26,6 +26,36 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
MEDIALOG_DEBUG,
};
+ // Captures the parameter detail of a BUFFERED_AUDIO_SPLICE_STATISTICS_CHANGED
DaleCurtis 2015/07/14 23:37:47 Instead of adding a class for this, do we just wan
+ // MediaLogEvent.
+ class AudioSpliceStatistics {
+ public:
+ AudioSpliceStatistics();
+ AudioSpliceStatistics(int count,
+ int degenerate_count,
+ double total_duration,
DaleCurtis 2015/07/14 23:37:47 Why not TimeDelta for all these?
+ double min_duration,
+ double max_duration);
+
+ // Methods to update statistics.
+ void OnSplice(double duration);
+ void OnDegenerateSplice();
+
+ // Methods to retrieve statistics.
+ int count() const { return count_; }
+ int degenerate_count() const { return degenerate_count_; }
+ double AverageDuration() const;
+ double min_duration() const { return min_duration_; }
+ double max_duration() const { return max_duration_; }
+
+ private:
+ int count_;
+ int degenerate_count_;
+ double total_duration_;
+ double min_duration_;
+ double max_duration_;
+ };
+
// Convert various enums to strings.
static std::string MediaLogLevelToString(MediaLogLevel level);
static MediaLogEvent::Type MediaLogLevelToEventType(MediaLogLevel level);
@@ -59,6 +89,8 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
size_t width, size_t height);
scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent(
int64 start, int64 current, int64 end);
+ scoped_ptr<MediaLogEvent> CreateBufferedSpliceStatisticsChangedEvent(
+ const AudioSpliceStatistics& statistics);
// Report a log message at the specified log level.
void AddLogEvent(MediaLogLevel level, const std::string& message);

Powered by Google App Engine
This is Rietveld 408576698