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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2771983006: Log AVERROR messages from FFmpegDemuxer in chrome://media-internals. (Closed)
Patch Set: Update FFmpegVideoDecoder log message format to match. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 22edbe7569190bddf4d6993efc83e98b52a9afcd..e0abd230f12f91c5e57212c981f06c780086a630 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -247,8 +247,9 @@ std::unique_ptr<FFmpegDemuxerStream> FFmpegDemuxerStream::Create(
<< video_config->AsHumanReadableString();
}
- return base::WrapUnique(new FFmpegDemuxerStream(
- demuxer, stream, std::move(audio_config), std::move(video_config)));
+ return base::WrapUnique(
+ new FFmpegDemuxerStream(demuxer, stream, std::move(audio_config),
+ std::move(video_config), media_log));
}
static void UnmarkEndOfStreamAndClearError(AVFormatContext* format_context) {
@@ -263,13 +264,15 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(
FFmpegDemuxer* demuxer,
AVStream* stream,
std::unique_ptr<AudioDecoderConfig> audio_config,
- std::unique_ptr<VideoDecoderConfig> video_config)
+ std::unique_ptr<VideoDecoderConfig> video_config,
+ scoped_refptr<MediaLog> media_log)
: demuxer_(demuxer),
task_runner_(base::ThreadTaskRunnerHandle::Get()),
stream_(stream),
start_time_(kNoTimestamp),
audio_config_(audio_config.release()),
video_config_(video_config.release()),
+ media_log_(std::move(media_log)),
type_(UNKNOWN),
liveness_(LIVENESS_UNKNOWN),
end_of_stream_(false),
@@ -479,6 +482,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
ConvertStreamTimestamp(stream_->time_base, packet->pts);
if (stream_timestamp == kNoTimestamp) {
+ MEDIA_LOG(ERROR, media_log_) << "FFmpegDemuxer: PTS is not defined";
demuxer_->NotifyDemuxerError(DEMUXER_ERROR_COULD_NOT_PARSE);
return;
}
@@ -504,6 +508,8 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
// Only allow negative timestamps past if we know they'll be fixed up by the
// code paths below; otherwise they should be treated as a parse error.
if (!fixup_negative_timestamps_ && buffer->timestamp() < base::TimeDelta()) {
+ MEDIA_LOG(DEBUG, media_log_)
+ << "FFmpegDemuxer: unfixable negative timestamp";
demuxer_->NotifyDemuxerError(DEMUXER_ERROR_COULD_NOT_PARSE);
return;
}
@@ -1726,8 +1732,15 @@ void FFmpegDemuxer::OnReadFrameDone(ScopedAVPacket packet, int result) {
// - either underlying ffmpeg returned an error
// - or FFMpegDemuxer reached the maximum allowed memory usage.
if (result < 0 || IsMaxMemoryUsageReached()) {
- DVLOG(1) << __func__ << " result=" << result
- << " IsMaxMemoryUsageReached=" << IsMaxMemoryUsageReached();
+ if (result < 0) {
+ MEDIA_LOG(DEBUG, media_log_)
+ << GetDisplayName()
+ << ": av_read_frame(): " << AVErrorToString(result);
+ } else {
+ MEDIA_LOG(DEBUG, media_log_)
+ << GetDisplayName() << ": memory limit exceeded";
+ }
+
// Update the duration based on the highest elapsed time across all streams.
base::TimeDelta max_duration;
for (const auto& stream : streams_) {
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698