breadcrumbs: Audio/Video >
It currently displays 3 things:
If your code lies in media/ or webkit/glue/, information about it can appear on chrome://media-internals. Simply get a hold of the MediaLog instance associated with WebMediaPlayer or PipelineImpl and start logging!
Well, ok, not quite. You may have noticed the Metrics section. If you’d like a new time measurement to appear there, simply open up chrome/browser/ui/webui/media/metrics.js and add the two events between which you’d like to measure to the list at the top.
MediaLog contains helper methods for creating MediaLogEvents, and ContentMediaLog implements its AddEvent() function to send a MediaLogEvent to the browser process as an IPC message. A single instance of MediaLog is associated with each WebMediaPlayer. This instance currently gets passed down to PipelineImpl and BufferedResourceLoader and can easily be handed off to other potential data sources (it’s RefCountedThreadSafe).
MediaInternals is a singleton attached to the IO thread. The IPC messages from ContentMediaLog get passed to it, and it handles notifications from AudioRendererHost. It lives in chrome/, but it implements the MediaObserver interface in content/, allowing AudioRendererHost and RenderMessageFilter (the IPC message handler) to call it.
MediaInternals talks to chrome://media-internals by packaging up and sending JavaScript function calls to it via MediaInternalsUI. It also currently stores the information it receives from AudioRendererHost to hand off to newly created media-internals tabs, but this functionality may be removed in the future. MediaInternalsUI is a WebUI component that hosts chrome://media-internals. There’s not much of interest here, just lots of proxying function calls across threads. chrome://media-internals contains most of the logic. It handles MediaLogEvents, NetLog events, and updates from AudioRendererHost. It infers the contents of the media cache from NetLog events (cache_entry.js, disjoint_range_set.js) and displays a log of events (event_list.js) and properties (media_player.js) of each active media player. I also displays time measurements between pre-defined events (metrics.js) and some basic information about audio streams from AudioRendererHost.