summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authordalecurtis <dalecurtis@chromium.org>2016-03-18 12:05:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-18 19:08:00 +0000
commit34169ec239517cdbb38c1e5cb6cc6a6be3dc253e (patch)
treee19f4b582d75a9fbed740a5fbae83767f699f6ea /media/base
parentf29b190921e405363d8dd1063246fd10f20eb31a (diff)
downloadchromium_src-34169ec239517cdbb38c1e5cb6cc6a6be3dc253e.zip
chromium_src-34169ec239517cdbb38c1e5cb6cc6a6be3dc253e.tar.gz
chromium_src-34169ec239517cdbb38c1e5cb6cc6a6be3dc253e.tar.bz2
Cleanse all instances of overloaded PIPELINE_ERROR_DECODE.
We have a few places in our media pipeline where we overloaded the pipeline decode error to mean other things. This makes it hard to understand the source of errors in the field. This fixes them: - ChunkDemuxer now reports its own error for append failure and when an application requests a decode or network error. - AudioRendererImpl no longer logs audio rendering errors as decode errors. Removes the old histogram for these values in favor of a new error code. It also: - Cleanses deprecated error codes. - Fixes various super old TODO comments in webmediaplayer_util.cc BUG=595076 TEST=unit tests pass, uma show up better. Review URL: https://codereview.chromium.org/1813093002 Cr-Commit-Position: refs/heads/master@{#382039}
Diffstat (limited to 'media/base')
-rw-r--r--media/base/media_log.cc14
-rw-r--r--media/base/pipeline_impl_unittest.cc8
-rw-r--r--media/base/pipeline_status.h23
3 files changed, 27 insertions, 18 deletions
diff --git a/media/base/media_log.cc b/media/base/media_log.cc
index ed43742..046e75b 100644
--- a/media/base/media_log.cc
+++ b/media/base/media_log.cc
@@ -91,8 +91,6 @@ std::string MediaLog::PipelineStatusToString(PipelineStatus status) {
switch (status) {
case PIPELINE_OK:
return "pipeline: ok";
- case PIPELINE_ERROR_URL_NOT_FOUND:
- return "pipeline: url not found";
case PIPELINE_ERROR_NETWORK:
return "pipeline: network error";
case PIPELINE_ERROR_DECODE:
@@ -105,8 +103,6 @@ std::string MediaLog::PipelineStatusToString(PipelineStatus status) {
return "pipeline: could not render";
case PIPELINE_ERROR_READ:
return "pipeline: read error";
- case PIPELINE_ERROR_OPERATION_PENDING:
- return "pipeline: operation pending";
case PIPELINE_ERROR_INVALID_STATE:
return "pipeline: invalid state";
case DEMUXER_ERROR_COULD_NOT_OPEN:
@@ -117,6 +113,16 @@ std::string MediaLog::PipelineStatusToString(PipelineStatus status) {
return "demuxer: no supported streams";
case DECODER_ERROR_NOT_SUPPORTED:
return "decoder: not supported";
+ case CHUNK_DEMUXER_ERROR_APPEND_FAILED:
+ return "chunk demuxer: append failed";
+ case CHUNK_DEMUXER_ERROR_EOS_STATUS_DECODE_ERROR:
+ return "chunk demuxer: application requested decode error on eos";
+ case CHUNK_DEMUXER_ERROR_EOS_STATUS_NETWORK_ERROR:
+ return "chunk demuxer: application requested network error on eos";
+ case AUDIO_RENDERER_ERROR:
+ return "audio renderer: output device reported an error";
+ case AUDIO_RENDERER_ERROR_SPLICE_FAILED:
+ return "audio renderer: post-decode audio splicing failed";
}
NOTREACHED();
return NULL;
diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc
index 6df2463..d08ecf1 100644
--- a/media/base/pipeline_impl_unittest.cc
+++ b/media/base/pipeline_impl_unittest.cc
@@ -465,14 +465,6 @@ TEST_F(PipelineImplTest, DemuxerErrorDuringStop) {
message_loop_.RunUntilIdle();
}
-TEST_F(PipelineImplTest, URLNotFound) {
- EXPECT_CALL(*demuxer_, Initialize(_, _, _))
- .WillOnce(PostCallback<1>(PIPELINE_ERROR_URL_NOT_FOUND));
- EXPECT_CALL(*demuxer_, Stop());
-
- StartPipelineAndExpect(PIPELINE_ERROR_URL_NOT_FOUND);
-}
-
TEST_F(PipelineImplTest, NoStreams) {
EXPECT_CALL(*demuxer_, Initialize(_, _, _))
.WillOnce(PostCallback<1>(PIPELINE_OK));
diff --git a/media/base/pipeline_status.h b/media/base/pipeline_status.h
index 32e163c..2f4b359 100644
--- a/media/base/pipeline_status.h
+++ b/media/base/pipeline_status.h
@@ -15,10 +15,9 @@ namespace media {
// Status states for pipeline. All codes except PIPELINE_OK indicate errors.
// Logged to UMA, so never reuse a value, always add new/greater ones!
-// TODO(vrk/scherkus): Trim the unused status codes. (crbug.com/126070)
enum PipelineStatus {
PIPELINE_OK = 0,
- PIPELINE_ERROR_URL_NOT_FOUND = 1,
+ // Deprecated: PIPELINE_ERROR_URL_NOT_FOUND = 1,
PIPELINE_ERROR_NETWORK = 2,
PIPELINE_ERROR_DECODE = 3,
// Deprecated: PIPELINE_ERROR_DECRYPT = 4,
@@ -26,23 +25,35 @@ enum PipelineStatus {
PIPELINE_ERROR_INITIALIZATION_FAILED = 6,
PIPELINE_ERROR_COULD_NOT_RENDER = 8,
PIPELINE_ERROR_READ = 9,
- PIPELINE_ERROR_OPERATION_PENDING = 10,
+ // Deprecated: PIPELINE_ERROR_OPERATION_PENDING = 10,
PIPELINE_ERROR_INVALID_STATE = 11,
+
// Demuxer related errors.
DEMUXER_ERROR_COULD_NOT_OPEN = 12,
DEMUXER_ERROR_COULD_NOT_PARSE = 13,
DEMUXER_ERROR_NO_SUPPORTED_STREAMS = 14,
+
// Decoder related errors.
DECODER_ERROR_NOT_SUPPORTED = 15,
+
+ // ChunkDemuxer related errors.
+ CHUNK_DEMUXER_ERROR_APPEND_FAILED = 16,
+ CHUNK_DEMUXER_ERROR_EOS_STATUS_DECODE_ERROR = 17,
+ CHUNK_DEMUXER_ERROR_EOS_STATUS_NETWORK_ERROR = 18,
+
+ // Audio rendering errors.
+ AUDIO_RENDERER_ERROR = 19,
+ AUDIO_RENDERER_ERROR_SPLICE_FAILED = 20,
+
// Must be equal to the largest value ever logged.
- PIPELINE_STATUS_MAX = DECODER_ERROR_NOT_SUPPORTED,
+ PIPELINE_STATUS_MAX = AUDIO_RENDERER_ERROR_SPLICE_FAILED,
};
typedef base::Callback<void(PipelineStatus)> PipelineStatusCB;
struct PipelineStatistics {
- uint64_t audio_bytes_decoded = 0; // Should be uint64_t?
- uint32_t video_bytes_decoded = 0; // Should be uint64_t?
+ uint64_t audio_bytes_decoded = 0;
+ uint64_t video_bytes_decoded = 0;
uint32_t video_frames_decoded = 0;
uint32_t video_frames_dropped = 0;
int64_t audio_memory_usage = 0;