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::PIPELINE_STATISTICS_CHANGED: |
| 60 return "PIPELINE_STATISTICS_CHANGED"; |
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 191 } |
190 | 192 |
191 scoped_ptr<MediaLogEvent> MediaLog::CreateMediaSourceErrorEvent( | 193 scoped_ptr<MediaLogEvent> MediaLog::CreateMediaSourceErrorEvent( |
192 const std::string& error) { | 194 const std::string& error) { |
193 scoped_ptr<MediaLogEvent> event( | 195 scoped_ptr<MediaLogEvent> event( |
194 CreateEvent(MediaLogEvent::MEDIA_SOURCE_ERROR)); | 196 CreateEvent(MediaLogEvent::MEDIA_SOURCE_ERROR)); |
195 event->params.SetString("error", error); | 197 event->params.SetString("error", error); |
196 return event.Pass(); | 198 return event.Pass(); |
197 } | 199 } |
198 | 200 |
| 201 scoped_ptr<MediaLogEvent> MediaLog::CreatePipelineStatisticsChangedEvent( |
| 202 const PipelineStatistics& stats) { |
| 203 scoped_ptr<MediaLogEvent> event( |
| 204 CreateEvent(MediaLogEvent::PIPELINE_STATISTICS_CHANGED)); |
| 205 event->params.SetInteger("decoded_audio_bytes", stats.audio_bytes_decoded); |
| 206 event->params.SetInteger("decoded_video_bytes", stats.video_bytes_decoded); |
| 207 event->params.SetInteger("decoded_video_frames", stats.video_frames_decoded); |
| 208 event->params.SetInteger("dropped_video_frames", stats.video_frames_dropped); |
| 209 return event.Pass(); |
| 210 } |
199 } //namespace media | 211 } //namespace media |
OLD | NEW |