Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: media/base/media_log.cc

Issue 21953003: Added logging calls to FFmpegDemuxer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switched to using double instead of string for file size Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/media_log.h ('k') | media/base/media_log_event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/base/media_log.h ('k') | media/base/media_log_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698