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

Side by Side Diff: media/base/pipeline_status.h

Issue 10824283: Make explicit the PipelineStatus enum values and warn that they are logged to UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 #ifndef MEDIA_BASE_PIPELINE_STATUS_H_ 5 #ifndef MEDIA_BASE_PIPELINE_STATUS_H_
6 #define MEDIA_BASE_PIPELINE_STATUS_H_ 6 #define MEDIA_BASE_PIPELINE_STATUS_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 9
10 #include <string> 10 #include <string>
11 11
12 namespace media { 12 namespace media {
13 13
14 // Status states for pipeline. All codes except PIPELINE_OK indicate errors. 14 // Status states for pipeline. All codes except PIPELINE_OK indicate errors.
15 // Logged to UMA, so never reuse a value, always add new/greater ones!
scherkus (not reviewing) 2012/08/13 21:08:59 is this only logged for GpuVideoDecoder::Initializ
Ami GONE FROM CHROMIUM 2012/08/13 21:23:54 Today, yes.
scherkus (not reviewing) 2012/08/14 21:40:30 Should VideoDecoders have their own status codes /
Ami GONE FROM CHROMIUM 2012/08/14 21:43:28 My rule of thumb is that if you're not going to ha
scherkus (not reviewing) 2012/08/15 01:03:44 Think about it from WMPI's perspective and http://
15 // TODO(vrk/scherkus): Trim the unused status codes. (crbug.com/126070) 16 // TODO(vrk/scherkus): Trim the unused status codes. (crbug.com/126070)
16 enum PipelineStatus { 17 enum PipelineStatus {
17 PIPELINE_OK, 18 PIPELINE_OK = 0,
18 PIPELINE_ERROR_URL_NOT_FOUND, 19 PIPELINE_ERROR_URL_NOT_FOUND = 1,
19 PIPELINE_ERROR_NETWORK, 20 PIPELINE_ERROR_NETWORK = 2,
20 PIPELINE_ERROR_DECODE, 21 PIPELINE_ERROR_DECODE = 3,
21 PIPELINE_ERROR_DECRYPT, 22 PIPELINE_ERROR_DECRYPT = 4,
22 PIPELINE_ERROR_ABORT, 23 PIPELINE_ERROR_ABORT = 5,
23 PIPELINE_ERROR_INITIALIZATION_FAILED, 24 PIPELINE_ERROR_INITIALIZATION_FAILED = 6,
24 PIPELINE_ERROR_REQUIRED_FILTER_MISSING, 25 PIPELINE_ERROR_REQUIRED_FILTER_MISSING = 7,
25 PIPELINE_ERROR_COULD_NOT_RENDER, 26 PIPELINE_ERROR_COULD_NOT_RENDER = 8,
26 PIPELINE_ERROR_READ, 27 PIPELINE_ERROR_READ = 9,
27 PIPELINE_ERROR_OPERATION_PENDING, 28 PIPELINE_ERROR_OPERATION_PENDING = 10,
28 PIPELINE_ERROR_INVALID_STATE, 29 PIPELINE_ERROR_INVALID_STATE = 11,
29 // Demuxer related errors. 30 // Demuxer related errors.
30 DEMUXER_ERROR_COULD_NOT_OPEN, 31 DEMUXER_ERROR_COULD_NOT_OPEN = 12,
31 DEMUXER_ERROR_COULD_NOT_PARSE, 32 DEMUXER_ERROR_COULD_NOT_PARSE = 13,
32 DEMUXER_ERROR_NO_SUPPORTED_STREAMS, 33 DEMUXER_ERROR_NO_SUPPORTED_STREAMS = 14,
33 // Decoder related errors. 34 // Decoder related errors.
34 DECODER_ERROR_NOT_SUPPORTED, 35 DECODER_ERROR_NOT_SUPPORTED = 15,
35 PIPELINE_STATUS_MAX, // Must be greater than all other values logged. 36 PIPELINE_STATUS_MAX, // Must be greater than all other values logged.
36 }; 37 };
37 38
38 typedef base::Callback<void(PipelineStatus)> PipelineStatusCB; 39 typedef base::Callback<void(PipelineStatus)> PipelineStatusCB;
39 40
40 // Wrap & return a callback around |cb| which reports its argument to UMA under 41 // Wrap & return a callback around |cb| which reports its argument to UMA under
41 // the requested |name|. 42 // the requested |name|.
42 PipelineStatusCB CreateUMAReportingPipelineCB(const std::string& name, 43 PipelineStatusCB CreateUMAReportingPipelineCB(const std::string& name,
43 const PipelineStatusCB& cb); 44 const PipelineStatusCB& cb);
44 45
(...skipping 11 matching lines...) Expand all
56 uint32 video_frames_decoded; 57 uint32 video_frames_decoded;
57 uint32 video_frames_dropped; 58 uint32 video_frames_dropped;
58 }; 59 };
59 60
60 // Used for updating pipeline statistics. 61 // Used for updating pipeline statistics.
61 typedef base::Callback<void(const PipelineStatistics&)> StatisticsCB; 62 typedef base::Callback<void(const PipelineStatistics&)> StatisticsCB;
62 63
63 } // namespace media 64 } // namespace media
64 65
65 #endif // MEDIA_BASE_PIPELINE_STATUS_H_ 66 #endif // MEDIA_BASE_PIPELINE_STATUS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698