| Index: media/base/media_log.cc
|
| diff --git a/media/base/media_log.cc b/media/base/media_log.cc
|
| index a5188f4c38c60e9b4e9a7ddd2cd1526a77a90aae..5cf2e832ae629032f4303e81a853a5c614dc6720 100644
|
| --- a/media/base/media_log.cc
|
| +++ b/media/base/media_log.cc
|
| @@ -7,6 +7,7 @@
|
| #include <string>
|
|
|
| #include "base/atomic_sequence_num.h"
|
| +#include "base/json/json_writer.h"
|
| #include "base/logging.h"
|
| #include "base/values.h"
|
|
|
| @@ -98,6 +99,22 @@ std::string MediaLog::PipelineStatusToString(PipelineStatus status) {
|
| return NULL;
|
| }
|
|
|
| +std::string MediaLog::MediaEventToLogString(const MediaLogEvent& event) {
|
| + // Special case for PIPELINE_ERROR, since that's by far the most useful
|
| + // event for figuring out media pipeline failures, and just reporting
|
| + // pipeline status as numeric code is not very helpful/user-friendly.
|
| + int error_code = 0;
|
| + if (event.type == MediaLogEvent::PIPELINE_ERROR &&
|
| + event.params.GetInteger("pipeline_error", &error_code)) {
|
| + PipelineStatus status = static_cast<PipelineStatus>(error_code);
|
| + return EventTypeToString(event.type) + " " +
|
| + media::MediaLog::PipelineStatusToString(status);
|
| + }
|
| + std::string params_json;
|
| + base::JSONWriter::Write(&event.params, ¶ms_json);
|
| + return EventTypeToString(event.type) + " " + params_json;
|
| +}
|
| +
|
| LogHelper::LogHelper(const LogCB& log_cb) : log_cb_(log_cb) {}
|
|
|
| LogHelper::~LogHelper() {
|
|
|