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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 2768713002: Pass a |media_log| to FFmpegVideoDecoder and roll ffmpeg (Closed)
Patch Set: Update cast sender unittest. 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_video_decoder.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 606968b2141269ab1262ea9d3e5dbe8ad5d57d6b..ad30943d1d0284fc6d0c4946bd20643b7673d226 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -21,6 +21,7 @@
#include "media/base/bind_to_current_loop.h"
#include "media/base/decoder_buffer.h"
#include "media/base/limits.h"
+#include "media/base/media_log.h"
#include "media/base/media_switches.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_frame.h"
@@ -112,8 +113,10 @@ bool FFmpegVideoDecoder::IsCodecSupported(VideoCodec codec) {
return avcodec_find_decoder(VideoCodecToCodecID(codec)) != nullptr;
}
-FFmpegVideoDecoder::FFmpegVideoDecoder()
- : state_(kUninitialized), decode_nalus_(false) {
+FFmpegVideoDecoder::FFmpegVideoDecoder(scoped_refptr<MediaLog> media_log)
+ : media_log_(std::move(media_log)),
+ state_(kUninitialized),
+ decode_nalus_(false) {
thread_checker_.DetachFromThread();
}
@@ -358,7 +361,9 @@ bool FFmpegVideoDecoder::FFmpegDecode(
&packet);
// Log the problem if we can't decode a video frame and exit early.
if (result < 0) {
- LOG(ERROR) << "Error decoding video: " << buffer->AsHumanReadableString();
+ MEDIA_LOG(DEBUG, media_log_)
+ << "avcodec_decode_video2(): " << AVErrorToString(result) << ", at "
+ << buffer->AsHumanReadableString();
return false;
}
« no previous file with comments | « media/filters/ffmpeg_video_decoder.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698