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

Unified Diff: media/filters/source_buffer_stream.cc

Issue 11471006: Log MediaSource parsing errors to the MediaLog so they can appear in chrome:media-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/source_buffer_stream.cc
diff --git a/media/filters/source_buffer_stream.cc b/media/filters/source_buffer_stream.cc
index acdcebf78596680b5661632c45ce9780a8ab43a7..bed6b0446a6ece41759f1680785e75ce510fb093 100644
--- a/media/filters/source_buffer_stream.cc
+++ b/media/filters/source_buffer_stream.cc
@@ -286,8 +286,10 @@ static int kDefaultVideoMemoryLimit = 150 * 1024 * 1024;
namespace media {
-SourceBufferStream::SourceBufferStream(const AudioDecoderConfig& audio_config)
- : current_config_index_(0),
+SourceBufferStream::SourceBufferStream(const AudioDecoderConfig& audio_config,
+ const ErrorLogCB& error_cb)
+ : error_cb_(error_cb),
+ current_config_index_(0),
append_config_index_(0),
seek_pending_(false),
seek_buffer_timestamp_(kNoTimestamp()),
@@ -304,8 +306,10 @@ SourceBufferStream::SourceBufferStream(const AudioDecoderConfig& audio_config)
audio_configs_.back()->CopyFrom(audio_config);
}
-SourceBufferStream::SourceBufferStream(const VideoDecoderConfig& video_config)
- : current_config_index_(0),
+SourceBufferStream::SourceBufferStream(const VideoDecoderConfig& video_config,
+ const ErrorLogCB& error_cb)
+ : error_cb_(error_cb),
+ current_config_index_(0),
append_config_index_(0),
seek_pending_(false),
seek_buffer_timestamp_(kNoTimestamp()),
@@ -358,19 +362,20 @@ bool SourceBufferStream::Append(
// New media segments must begin with a keyframe.
if (new_media_segment_ && !buffers.front()->IsKeyframe()) {
- DVLOG(1) << "Media segment did not begin with keyframe.";
+ ERROR_LOG(error_cb_) <<"Media segment did not begin with keyframe.";
return false;
}
// Buffers within a media segment should be monotonically increasing.
if (!IsMonotonicallyIncreasing(buffers)) {
- DVLOG(1) << "Buffers were not monotonically increasing.";
+ ERROR_LOG(error_cb_) <<"Buffers were not monotonically increasing.";
return false;
}
if (media_segment_start_time_ < base::TimeDelta() ||
buffers.front()->GetDecodeTimestamp() < base::TimeDelta()) {
- DVLOG(1) << "Cannot append a media segment with negative timestamps.";
+ ERROR_LOG(error_cb_)
+ << "Cannot append a media segment with negative timestamps.";
return false;
}
@@ -1037,22 +1042,22 @@ bool SourceBufferStream::UpdateAudioConfig(const AudioDecoderConfig& config) {
DCHECK(video_configs_.empty());
if (audio_configs_[0]->codec() != config.codec()) {
- DVLOG(1) << "UpdateAudioConfig() : Codec changes not allowed.";
+ ERROR_LOG(error_cb_) << "Audio codec changes not allowed.";
return false;
}
if (audio_configs_[0]->samples_per_second() != config.samples_per_second()) {
- DVLOG(1) << "UpdateAudioConfig() : Sample rate changes not allowed.";
+ ERROR_LOG(error_cb_) << "Audio sample rate changes not allowed.";
return false;
}
if (audio_configs_[0]->channel_layout() != config.channel_layout()) {
- DVLOG(1) << "UpdateAudioConfig() : Channel layout changes not allowed.";
+ ERROR_LOG(error_cb_) << "Audio channel layout changes not allowed.";
return false;
}
if (audio_configs_[0]->bits_per_channel() != config.bits_per_channel()) {
- DVLOG(1) << "UpdateAudioConfig() : Bits per channel changes not allowed.";
+ ERROR_LOG(error_cb_) << "Audio bits per channel changes not allowed.";
return false;
}
@@ -1077,12 +1082,12 @@ bool SourceBufferStream::UpdateVideoConfig(const VideoDecoderConfig& config) {
DCHECK(audio_configs_.empty());
if (video_configs_[0]->is_encrypted() != config.is_encrypted()) {
- DVLOG(1) << "UpdateVideoConfig() : Encryption changes not allowed.";
+ ERROR_LOG(error_cb_) <<"Video Encryption changes not allowed.";
return false;
}
if (video_configs_[0]->codec() != config.codec()) {
- DVLOG(1) << "UpdateVideoConfig() : Codec changes not allowed.";
+ ERROR_LOG(error_cb_) <<"Video codec changes not allowed.";
return false;
}

Powered by Google App Engine
This is Rietveld 408576698