1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_BASE_MEDIA_LOG_EVENT_H_
6 #define MEDIA_BASE_MEDIA_LOG_EVENT_H_
8 #include "base/time/time.h"
9 #include "base/values.h"
13 struct MediaLogEvent
{
16 MediaLogEvent(const MediaLogEvent
& event
) {
20 MediaLogEvent
& operator=(const MediaLogEvent
& event
) {
23 scoped_ptr
<base::DictionaryValue
> event_copy(event
.params
.DeepCopy());
24 params
.Swap(event_copy
.get());
30 // A WebMediaPlayer is being created or destroyed.
32 WEBMEDIAPLAYER_CREATED
,
33 WEBMEDIAPLAYER_DESTROYED
,
35 // A media player is loading a resource.
36 // params: "url": <URL of the resource>.
39 // A media player has started seeking.
40 // params: "seek_target": <number of seconds to which to seek>.
43 // A media player has been told to play or pause.
48 // The state of Pipeline has changed.
49 // params: "pipeline_state": <string name of the state>.
50 PIPELINE_STATE_CHANGED
,
52 // An error has occurred in the pipeline.
53 // params: "pipeline_error": <string name of the error>.
56 // The size of the video has been determined.
57 // params: "width": <integral width of the video>.
58 // "height": <integral height of the video>.
61 // A property of the pipeline has been set by a filter.
62 // These take a single parameter based upon the name of the event and of
63 // the appropriate type. e.g. DURATION_SET: "duration" of type TimeDelta.
68 // Audio/Video stream playback has ended.
71 // Text stream playback has ended.
74 // The extents of the sliding buffer have changed.
75 // params: "buffer_start": <first buffered byte>.
76 // "buffer_current": <current offset>.
77 // "buffer_end": <last buffered byte>.
78 BUFFERED_EXTENTS_CHANGED
,
80 // Error log reported by media code such as reasons of playback error.
81 MEDIA_ERROR_LOG_ENTRY
,
82 // params: "error": Error string describing the error detected.
84 // Informative log reported by media code.
86 // params: "info": String with details of an informative log entry.
88 // Debug log reported by media code.
89 MEDIA_DEBUG_LOG_ENTRY
,
90 // params: "debug": String with details of a debug log entry.
92 // A property has changed without any special event occurring.
95 TYPE_LAST
= PROPERTY_CHANGE
100 base::DictionaryValue params
;
101 base::TimeTicks time
;
106 #endif // MEDIA_BASE_MEDIA_LOG_EVENT_H_