OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/base/media_log.h" | 5 #include "media/base/media_log.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 case MediaLogEvent::AUDIO_ENDED: | 49 case MediaLogEvent::AUDIO_ENDED: |
50 return "AUDIO_ENDED"; | 50 return "AUDIO_ENDED"; |
51 case MediaLogEvent::VIDEO_ENDED: | 51 case MediaLogEvent::VIDEO_ENDED: |
52 return "VIDEO_ENDED"; | 52 return "VIDEO_ENDED"; |
53 case MediaLogEvent::AUDIO_RENDERER_DISABLED: | 53 case MediaLogEvent::AUDIO_RENDERER_DISABLED: |
54 return "AUDIO_RENDERER_DISABLED"; | 54 return "AUDIO_RENDERER_DISABLED"; |
55 case MediaLogEvent::BUFFERED_EXTENTS_CHANGED: | 55 case MediaLogEvent::BUFFERED_EXTENTS_CHANGED: |
56 return "BUFFERED_EXTENTS_CHANGED"; | 56 return "BUFFERED_EXTENTS_CHANGED"; |
57 case MediaLogEvent::MEDIA_SOURCE_ERROR: | 57 case MediaLogEvent::MEDIA_SOURCE_ERROR: |
58 return "MEDIA_SOURCE_ERROR"; | 58 return "MEDIA_SOURCE_ERROR"; |
| 59 case MediaLogEvent::PROPERTY_CHANGE: |
| 60 return "PROPERTY_CHANGE"; |
59 } | 61 } |
60 NOTREACHED(); | 62 NOTREACHED(); |
61 return NULL; | 63 return NULL; |
62 } | 64 } |
63 | 65 |
64 const char* MediaLog::PipelineStatusToString(PipelineStatus status) { | 66 const char* MediaLog::PipelineStatusToString(PipelineStatus status) { |
65 switch (status) { | 67 switch (status) { |
66 case PIPELINE_OK: | 68 case PIPELINE_OK: |
67 return "pipeline: ok"; | 69 return "pipeline: ok"; |
68 case PIPELINE_ERROR_URL_NOT_FOUND: | 70 case PIPELINE_ERROR_URL_NOT_FOUND: |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 193 } |
192 | 194 |
193 scoped_ptr<MediaLogEvent> MediaLog::CreateMediaSourceErrorEvent( | 195 scoped_ptr<MediaLogEvent> MediaLog::CreateMediaSourceErrorEvent( |
194 const std::string& error) { | 196 const std::string& error) { |
195 scoped_ptr<MediaLogEvent> event( | 197 scoped_ptr<MediaLogEvent> event( |
196 CreateEvent(MediaLogEvent::MEDIA_SOURCE_ERROR)); | 198 CreateEvent(MediaLogEvent::MEDIA_SOURCE_ERROR)); |
197 event->params.SetString("error", error); | 199 event->params.SetString("error", error); |
198 return event.Pass(); | 200 return event.Pass(); |
199 } | 201 } |
200 | 202 |
| 203 void MediaLog::SetStringProperty( |
| 204 const char* key, const std::string& value) { |
| 205 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); |
| 206 event->params.SetString(key, value); |
| 207 AddEvent(event.Pass()); |
| 208 } |
| 209 |
| 210 void MediaLog::SetIntegerProperty( |
| 211 const char* key, int value) { |
| 212 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); |
| 213 event->params.SetInteger(key, value); |
| 214 AddEvent(event.Pass()); |
| 215 } |
| 216 |
| 217 void MediaLog::SetDoubleProperty( |
| 218 const char* key, double value) { |
| 219 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); |
| 220 event->params.SetDouble(key, value); |
| 221 AddEvent(event.Pass()); |
| 222 } |
| 223 |
| 224 void MediaLog::SetBooleanProperty( |
| 225 const char* key, bool value) { |
| 226 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); |
| 227 event->params.SetBoolean(key, value); |
| 228 AddEvent(event.Pass()); |
| 229 } |
| 230 |
201 } //namespace media | 231 } //namespace media |
OLD | NEW |