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); |