| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return "pipeline: could not render"; | 81 return "pipeline: could not render"; |
| 82 case PIPELINE_ERROR_READ: | 82 case PIPELINE_ERROR_READ: |
| 83 return "pipeline: read error"; | 83 return "pipeline: read error"; |
| 84 case PIPELINE_ERROR_OPERATION_PENDING: | 84 case PIPELINE_ERROR_OPERATION_PENDING: |
| 85 return "pipeline: operation pending"; | 85 return "pipeline: operation pending"; |
| 86 case PIPELINE_ERROR_INVALID_STATE: | 86 case PIPELINE_ERROR_INVALID_STATE: |
| 87 return "pipeline: invalid state"; | 87 return "pipeline: invalid state"; |
| 88 case DEMUXER_ERROR_COULD_NOT_OPEN: | 88 case DEMUXER_ERROR_COULD_NOT_OPEN: |
| 89 return "demuxer: could not open"; | 89 return "demuxer: could not open"; |
| 90 case DEMUXER_ERROR_COULD_NOT_PARSE: | 90 case DEMUXER_ERROR_COULD_NOT_PARSE: |
| 91 return "dumuxer: could not parse"; | 91 return "demuxer: could not parse"; |
| 92 case DEMUXER_ERROR_NO_SUPPORTED_STREAMS: | 92 case DEMUXER_ERROR_NO_SUPPORTED_STREAMS: |
| 93 return "demuxer: no supported streams"; | 93 return "demuxer: no supported streams"; |
| 94 case DECODER_ERROR_NOT_SUPPORTED: | 94 case DECODER_ERROR_NOT_SUPPORTED: |
| 95 return "decoder: not supported"; | 95 return "decoder: not supported"; |
| 96 } | 96 } |
| 97 NOTREACHED(); | 97 NOTREACHED(); |
| 98 return NULL; | 98 return NULL; |
| 99 } | 99 } |
| 100 | 100 |
| 101 LogHelper::LogHelper(const LogCB& log_cb) : log_cb_(log_cb) {} | 101 LogHelper::LogHelper(const LogCB& log_cb) : log_cb_(log_cb) {} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 Pipeline::State state) { | 160 Pipeline::State state) { |
| 161 scoped_ptr<MediaLogEvent> event( | 161 scoped_ptr<MediaLogEvent> event( |
| 162 CreateEvent(MediaLogEvent::PIPELINE_STATE_CHANGED)); | 162 CreateEvent(MediaLogEvent::PIPELINE_STATE_CHANGED)); |
| 163 event->params.SetString("pipeline_state", Pipeline::GetStateString(state)); | 163 event->params.SetString("pipeline_state", Pipeline::GetStateString(state)); |
| 164 return event.Pass(); | 164 return event.Pass(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 scoped_ptr<MediaLogEvent> MediaLog::CreatePipelineErrorEvent( | 167 scoped_ptr<MediaLogEvent> MediaLog::CreatePipelineErrorEvent( |
| 168 PipelineStatus error) { | 168 PipelineStatus error) { |
| 169 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PIPELINE_ERROR)); | 169 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PIPELINE_ERROR)); |
| 170 event->params.SetString("pipeline_error", PipelineStatusToString(error)); | 170 event->params.SetInteger("pipeline_error", error); |
| 171 return event.Pass(); | 171 return event.Pass(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 scoped_ptr<MediaLogEvent> MediaLog::CreateVideoSizeSetEvent( | 174 scoped_ptr<MediaLogEvent> MediaLog::CreateVideoSizeSetEvent( |
| 175 size_t width, size_t height) { | 175 size_t width, size_t height) { |
| 176 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::VIDEO_SIZE_SET)); | 176 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::VIDEO_SIZE_SET)); |
| 177 event->params.SetInteger("width", width); | 177 event->params.SetInteger("width", width); |
| 178 event->params.SetInteger("height", height); | 178 event->params.SetInteger("height", height); |
| 179 return event.Pass(); | 179 return event.Pass(); |
| 180 } | 180 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 const char* key, base::TimeDelta value) { | 231 const char* key, base::TimeDelta value) { |
| 232 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); | 232 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); |
| 233 if (value.is_max()) | 233 if (value.is_max()) |
| 234 event->params.SetString(key, "unknown"); | 234 event->params.SetString(key, "unknown"); |
| 235 else | 235 else |
| 236 event->params.SetDouble(key, value.InSecondsF()); | 236 event->params.SetDouble(key, value.InSecondsF()); |
| 237 AddEvent(event.Pass()); | 237 AddEvent(event.Pass()); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } //namespace media | 240 } //namespace media |
| OLD | NEW |