diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 19:08:15 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 19:08:15 +0000 |
commit | 36130eee7e32fe1a3ae3d92b642b8c452158730b (patch) | |
tree | e53fe1c8079bf98f12c8076b76761ccec3e30e90 /media/base | |
parent | 8aa71d6ba9f7429eb14e2ed1d167ff0e46cd237a (diff) | |
download | chromium_src-36130eee7e32fe1a3ae3d92b642b8c452158730b.zip chromium_src-36130eee7e32fe1a3ae3d92b642b8c452158730b.tar.gz chromium_src-36130eee7e32fe1a3ae3d92b642b8c452158730b.tar.bz2 |
Remove statistics reporting from chrome://media-internals and fix event logging.
Our internals page is for reporting things that are, like, internal. The statistics I'm removing are available from audio/video elements themselves, removing the need for including them on the internals page. They are also really spammy.
During the removal I also fixed a bug where we weren't reporting the associated parameters with each event (i.e., the name of the state for a PIPELINE_STATE_CHANGED event).
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10332082
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/media_log.cc | 52 | ||||
-rw-r--r-- | media/base/media_log.h | 15 | ||||
-rw-r--r-- | media/base/media_log_event.h | 5 | ||||
-rw-r--r-- | media/base/pipeline.cc | 1 |
4 files changed, 6 insertions, 67 deletions
diff --git a/media/base/media_log.cc b/media/base/media_log.cc index 3be4366..6d215b2 100644 --- a/media/base/media_log.cc +++ b/media/base/media_log.cc @@ -7,18 +7,14 @@ #include <string> #include "base/atomic_sequence_num.h" -#include "base/bind.h" -#include "base/lazy_instance.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" -#include "base/message_loop.h" #include "base/values.h" namespace media { -// A count of all MediaLogs created on this render process. -// Used to generate unique ids. -static base::StaticAtomicSequenceNumber media_log_count; +// A count of all MediaLogs created in the current process. Used to generate +// unique IDs. +static base::StaticAtomicSequenceNumber g_media_log_count; const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { switch (type) { @@ -56,8 +52,6 @@ const char* MediaLog::EventTypeToString(MediaLogEvent::Type type) { return "AUDIO_RENDERER_DISABLED"; case MediaLogEvent::BUFFERED_EXTENTS_CHANGED: return "BUFFERED_EXTENTS_CHANGED"; - case MediaLogEvent::STATISTICS_UPDATED: - return "STATISTICS_UPDATED"; } NOTREACHED(); return NULL; @@ -139,15 +133,11 @@ const char* MediaLog::PipelineStatusToString(PipelineStatus status) { return NULL; } -MediaLog::MediaLog() { - id_ = media_log_count.GetNext(); - stats_update_pending_ = false; -} +MediaLog::MediaLog() : id_(g_media_log_count.GetNext()) {} MediaLog::~MediaLog() {} -void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) { -} +void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {} scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) { scoped_ptr<MediaLogEvent> event(new MediaLogEvent); @@ -223,36 +213,4 @@ scoped_ptr<MediaLogEvent> MediaLog::CreateBufferedExtentsChangedEvent( return event.Pass(); } -void MediaLog::QueueStatisticsUpdatedEvent(PipelineStatistics stats) { - base::AutoLock auto_lock(stats_lock_); - last_statistics_ = stats; - - // Sadly, this function can get dispatched on threads not running a message - // loop. Happily, this is pretty rare (only VideoRendererBase at this time) - // so we simply leave stats updating for another call to trigger. - if (!stats_update_pending_ && MessageLoop::current()) { - stats_update_pending_ = true; - MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&media::MediaLog::AddStatisticsUpdatedEvent, this), - base::TimeDelta::FromMilliseconds(500)); - } -} - -void MediaLog::AddStatisticsUpdatedEvent() { - base::AutoLock auto_lock(stats_lock_); - scoped_ptr<MediaLogEvent> event( - CreateEvent(MediaLogEvent::STATISTICS_UPDATED)); - event->params.SetInteger("audio_bytes_decoded", - last_statistics_.audio_bytes_decoded); - event->params.SetInteger("video_bytes_decoded", - last_statistics_.video_bytes_decoded); - event->params.SetInteger("video_frames_decoded", - last_statistics_.video_frames_decoded); - event->params.SetInteger("video_frames_dropped", - last_statistics_.video_frames_dropped); - AddEvent(event.Pass()); - stats_update_pending_ = false; -} - } //namespace media diff --git a/media/base/media_log.h b/media/base/media_log.h index 9b87361b..fab1a63 100644 --- a/media/base/media_log.h +++ b/media/base/media_log.h @@ -7,7 +7,7 @@ #pragma once #include "base/memory/ref_counted.h" -#include "base/synchronization/lock.h" +#include "base/memory/scoped_ptr.h" #include "media/base/media_export.h" #include "media/base/media_log_event.h" #include "media/base/pipeline.h" @@ -46,27 +46,14 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> { scoped_ptr<MediaLogEvent> CreateBufferedExtentsChangedEvent( size_t start, size_t current, size_t end); - // Called when the pipeline statistics have been updated. - // This gets called every frame, so we send the most recent stats after 500ms. - // This function is NOT thread safe. - void QueueStatisticsUpdatedEvent(PipelineStatistics stats); - protected: friend class base::RefCountedThreadSafe<MediaLog>; virtual ~MediaLog(); private: - // Actually add a STATISTICS_UPDATED event. - void AddStatisticsUpdatedEvent(); - // A unique (to this process) id for this MediaLog. int32 id_; - // The most recent set of pipeline stats. - PipelineStatistics last_statistics_; - bool stats_update_pending_; - base::Lock stats_lock_; - DISALLOW_COPY_AND_ASSIGN(MediaLog); }; diff --git a/media/base/media_log_event.h b/media/base/media_log_event.h index 4167c893..b301570 100644 --- a/media/base/media_log_event.h +++ b/media/base/media_log_event.h @@ -69,11 +69,6 @@ struct MediaLogEvent { // "buffer_current": <current offset>. // "buffer_end": <last buffered byte>. BUFFERED_EXTENTS_CHANGED, - - // The recorded statistics of the media pipeline have been updated. - // params: "audio_bytes_decoded", "video_bytes_decoded", - // "video_frames_decoded", "video_frames_dropped": <integers>. - STATISTICS_UPDATED, }; int32 id; diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index 2d8effc..29a8dd0 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -565,7 +565,6 @@ void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) { statistics_.video_bytes_decoded += stats.video_bytes_decoded; statistics_.video_frames_decoded += stats.video_frames_decoded; statistics_.video_frames_dropped += stats.video_frames_dropped; - media_log_->QueueStatisticsUpdatedEvent(statistics_); } void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection, |