summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxhwang <xhwang@chromium.org>2014-09-08 21:55:47 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-09 05:43:49 +0000
commitff459d4eeb89479ae810f6be3d3b5b50fef3324a (patch)
treea9131ee19f07cb953c817cc27967320d7a180257
parentb943d1c8690d35fc9aeaedaca39c32baddffc082 (diff)
downloadchromium_src-ff459d4eeb89479ae810f6be3d3b5b50fef3324a.zip
chromium_src-ff459d4eeb89479ae810f6be3d3b5b50fef3324a.tar.gz
chromium_src-ff459d4eeb89479ae810f6be3d3b5b50fef3324a.tar.bz2
MediaLog: Log selected audio/video decoder name.
The name of selected audio/video decoder will appear in chrome://media-internals. This is useful for quickly identifying which decoder is being used (e.g. whether we are using GpuVideoDecoder for hardware accelerated video decoding). BUG=411535 Review URL: https://codereview.chromium.org/547913002 Cr-Commit-Position: refs/heads/master@{#293851}
-rw-r--r--media/base/audio_decoder.h5
-rw-r--r--media/base/mock_filters.cc8
-rw-r--r--media/base/mock_filters.h2
-rw-r--r--media/base/video_decoder.h5
-rw-r--r--media/blink/webmediaplayer_impl.cc41
-rw-r--r--media/filters/audio_renderer_impl.cc6
-rw-r--r--media/filters/audio_renderer_impl.h4
-rw-r--r--media/filters/audio_renderer_impl_unittest.cc3
-rw-r--r--media/filters/decoder_stream.cc10
-rw-r--r--media/filters/decoder_stream.h6
-rw-r--r--media/filters/decoder_stream_traits.cc4
-rw-r--r--media/filters/decrypting_audio_decoder.cc4
-rw-r--r--media/filters/decrypting_audio_decoder.h1
-rw-r--r--media/filters/decrypting_video_decoder.cc4
-rw-r--r--media/filters/decrypting_video_decoder.h1
-rw-r--r--media/filters/fake_video_decoder.cc4
-rw-r--r--media/filters/fake_video_decoder.h1
-rw-r--r--media/filters/ffmpeg_audio_decoder.cc4
-rw-r--r--media/filters/ffmpeg_audio_decoder.h1
-rw-r--r--media/filters/ffmpeg_video_decoder.cc4
-rw-r--r--media/filters/ffmpeg_video_decoder.h1
-rw-r--r--media/filters/gpu_video_decoder.cc10
-rw-r--r--media/filters/gpu_video_decoder.h6
-rw-r--r--media/filters/opus_audio_decoder.cc4
-rw-r--r--media/filters/opus_audio_decoder.h1
-rw-r--r--media/filters/pipeline_integration_test_base.cc6
-rw-r--r--media/filters/video_frame_stream_unittest.cc3
-rw-r--r--media/filters/video_renderer_impl.cc6
-rw-r--r--media/filters/video_renderer_impl.h4
-rw-r--r--media/filters/video_renderer_impl_unittest.cc3
-rw-r--r--media/filters/vpx_video_decoder.cc4
-rw-r--r--media/filters/vpx_video_decoder.h1
-rw-r--r--media/tools/player_x11/player_x11.cc6
33 files changed, 126 insertions, 47 deletions
diff --git a/media/base/audio_decoder.h b/media/base/audio_decoder.h
index 779e5ef..44e79a4 100644
--- a/media/base/audio_decoder.h
+++ b/media/base/audio_decoder.h
@@ -5,6 +5,8 @@
#ifndef MEDIA_BASE_AUDIO_DECODER_H_
#define MEDIA_BASE_AUDIO_DECODER_H_
+#include <string>
+
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "media/base/audio_decoder_config.h"
@@ -47,6 +49,9 @@ class MEDIA_EXPORT AudioDecoder {
// depends on |this|.
virtual ~AudioDecoder();
+ // Returns the name of the decoder for logging purpose.
+ virtual std::string GetDisplayName() const = 0;
+
// Initializes an AudioDecoder with the given DemuxerStream, executing the
// callback upon completion.
// |statistics_cb| is used to update global pipeline statistics.
diff --git a/media/base/mock_filters.cc b/media/base/mock_filters.cc
index 4bb03e4..55d7eb5 100644
--- a/media/base/mock_filters.cc
+++ b/media/base/mock_filters.cc
@@ -52,10 +52,18 @@ VideoRotation MockDemuxerStream::video_rotation() {
return VIDEO_ROTATION_0;
}
+std::string MockVideoDecoder::GetDisplayName() const {
+ return "MockVideoDecoder";
+}
+
MockVideoDecoder::MockVideoDecoder() {
EXPECT_CALL(*this, HasAlpha()).WillRepeatedly(Return(false));
}
+std::string MockAudioDecoder::GetDisplayName() const {
+ return "MockAudioDecoder";
+}
+
MockVideoDecoder::~MockVideoDecoder() {}
MockAudioDecoder::MockAudioDecoder() {}
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h
index 7e2e8f3..1b290ab 100644
--- a/media/base/mock_filters.h
+++ b/media/base/mock_filters.h
@@ -78,6 +78,7 @@ class MockVideoDecoder : public VideoDecoder {
virtual ~MockVideoDecoder();
// VideoDecoder implementation.
+ virtual std::string GetDisplayName() const;
MOCK_METHOD4(Initialize, void(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
@@ -97,6 +98,7 @@ class MockAudioDecoder : public AudioDecoder {
virtual ~MockAudioDecoder();
// AudioDecoder implementation.
+ virtual std::string GetDisplayName() const;
MOCK_METHOD3(Initialize,
void(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
diff --git a/media/base/video_decoder.h b/media/base/video_decoder.h
index 89c62db..52aa867 100644
--- a/media/base/video_decoder.h
+++ b/media/base/video_decoder.h
@@ -5,6 +5,8 @@
#ifndef MEDIA_BASE_VIDEO_DECODER_H_
#define MEDIA_BASE_VIDEO_DECODER_H_
+#include <string>
+
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "media/base/media_export.h"
@@ -46,6 +48,9 @@ class MEDIA_EXPORT VideoDecoder {
// depends on |this|.
virtual ~VideoDecoder();
+ // Returns the name of the decoder for logging purpose.
+ virtual std::string GetDisplayName() const = 0;
+
// Initializes a VideoDecoder with the given |config|, executing the
// |status_cb| upon completion. |output_cb| is called for each output frame
// decoded by Decode().
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index bed9299..0c5f859 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -840,24 +840,23 @@ scoped_ptr<Renderer> WebMediaPlayerImpl::CreateRenderer() {
// Create our audio decoders and renderer.
ScopedVector<AudioDecoder> audio_decoders;
- LogCB log_cb = base::Bind(&LogMediaSourceError, media_log_);
- audio_decoders.push_back(new FFmpegAudioDecoder(media_task_runner_, log_cb));
- audio_decoders.push_back(new OpusAudioDecoder(media_task_runner_));
-
- scoped_ptr<AudioRenderer> audio_renderer(new AudioRendererImpl(
- media_task_runner_,
- audio_source_provider_.get(),
- audio_decoders.Pass(),
- set_decryptor_ready_cb,
- audio_hardware_config_));
+ audio_decoders.push_back(new media::FFmpegAudioDecoder(
+ media_task_runner_, base::Bind(&LogMediaSourceError, media_log_)));
+ audio_decoders.push_back(new media::OpusAudioDecoder(media_task_runner_));
+
+ scoped_ptr<AudioRenderer> audio_renderer(
+ new AudioRendererImpl(media_task_runner_,
+ audio_source_provider_.get(),
+ audio_decoders.Pass(),
+ set_decryptor_ready_cb,
+ audio_hardware_config_,
+ media_log_));
// Create our video decoders and renderer.
ScopedVector<VideoDecoder> video_decoders;
- if (gpu_factories_.get()) {
- video_decoders.push_back(
- new GpuVideoDecoder(gpu_factories_, media_log_));
- }
+ if (gpu_factories_.get())
+ video_decoders.push_back(new GpuVideoDecoder(gpu_factories_));
#if !defined(MEDIA_DISABLE_LIBVPX)
video_decoders.push_back(new VpxVideoDecoder(media_task_runner_));
@@ -865,13 +864,13 @@ scoped_ptr<Renderer> WebMediaPlayerImpl::CreateRenderer() {
video_decoders.push_back(new FFmpegVideoDecoder(media_task_runner_));
- scoped_ptr<VideoRenderer> video_renderer(
- new VideoRendererImpl(
- media_task_runner_,
- video_decoders.Pass(),
- set_decryptor_ready_cb,
- base::Bind(&WebMediaPlayerImpl::FrameReady, base::Unretained(this)),
- true));
+ scoped_ptr<VideoRenderer> video_renderer(new VideoRendererImpl(
+ media_task_runner_,
+ video_decoders.Pass(),
+ set_decryptor_ready_cb,
+ base::Bind(&WebMediaPlayerImpl::FrameReady, base::Unretained(this)),
+ true,
+ media_log_));
// Create renderer.
return scoped_ptr<Renderer>(new RendererImpl(
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index 164864d..166b51f 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -45,13 +45,15 @@ AudioRendererImpl::AudioRendererImpl(
media::AudioRendererSink* sink,
ScopedVector<AudioDecoder> decoders,
const SetDecryptorReadyCB& set_decryptor_ready_cb,
- const AudioHardwareConfig& hardware_config)
+ const AudioHardwareConfig& hardware_config,
+ const scoped_refptr<MediaLog>& media_log)
: task_runner_(task_runner),
expecting_config_changes_(false),
sink_(sink),
audio_buffer_stream_(new AudioBufferStream(task_runner,
decoders.Pass(),
- set_decryptor_ready_cb)),
+ set_decryptor_ready_cb,
+ media_log)),
hardware_config_(hardware_config),
playback_rate_(0),
state_(kUninitialized),
diff --git a/media/filters/audio_renderer_impl.h b/media/filters/audio_renderer_impl.h
index 086cf99..b927d1f 100644
--- a/media/filters/audio_renderer_impl.h
+++ b/media/filters/audio_renderer_impl.h
@@ -29,6 +29,7 @@
#include "media/base/audio_renderer.h"
#include "media/base/audio_renderer_sink.h"
#include "media/base/decryptor.h"
+#include "media/base/media_log.h"
#include "media/base/time_source.h"
#include "media/filters/audio_renderer_algorithm.h"
#include "media/filters/decoder_stream.h"
@@ -64,7 +65,8 @@ class MEDIA_EXPORT AudioRendererImpl
AudioRendererSink* sink,
ScopedVector<AudioDecoder> decoders,
const SetDecryptorReadyCB& set_decryptor_ready_cb,
- const AudioHardwareConfig& hardware_params);
+ const AudioHardwareConfig& hardware_params,
+ const scoped_refptr<MediaLog>& media_log);
virtual ~AudioRendererImpl();
// TimeSource implementation.
diff --git a/media/filters/audio_renderer_impl_unittest.cc b/media/filters/audio_renderer_impl_unittest.cc
index fc6c781..4918d75 100644
--- a/media/filters/audio_renderer_impl_unittest.cc
+++ b/media/filters/audio_renderer_impl_unittest.cc
@@ -98,7 +98,8 @@ class AudioRendererImplTest : public ::testing::Test {
sink_.get(),
decoders.Pass(),
SetDecryptorReadyCB(),
- hardware_config_));
+ hardware_config_,
+ new MediaLog()));
}
virtual ~AudioRendererImplTest() {
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc
index b3d58ae..8f2deaf 100644
--- a/media/filters/decoder_stream.cc
+++ b/media/filters/decoder_stream.cc
@@ -42,8 +42,10 @@ template <DemuxerStream::Type StreamType>
DecoderStream<StreamType>::DecoderStream(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
ScopedVector<Decoder> decoders,
- const SetDecryptorReadyCB& set_decryptor_ready_cb)
+ const SetDecryptorReadyCB& set_decryptor_ready_cb,
+ const scoped_refptr<MediaLog>& media_log)
: task_runner_(task_runner),
+ media_log_(media_log),
state_(STATE_UNINITIALIZED),
stream_(NULL),
low_delay_(false),
@@ -236,6 +238,12 @@ void DecoderStream<StreamType>::OnDecoderSelected(
decoder_ = selected_decoder.Pass();
decrypting_demuxer_stream_ = decrypting_demuxer_stream.Pass();
+ const std::string stream_type = DecoderStreamTraits<StreamType>::ToString();
+ media_log_->SetBooleanProperty((stream_type + "_dds").c_str(),
+ decrypting_demuxer_stream_);
+ media_log_->SetStringProperty((stream_type + "_decoder").c_str(),
+ decoder_->GetDisplayName());
+
if (StreamTraits::NeedsBitstreamConversion(decoder_.get()))
stream_->EnableBitstreamConverter();
base::ResetAndReturn(&init_cb_).Run(true);
diff --git a/media/filters/decoder_stream.h b/media/filters/decoder_stream.h
index 5afd0b8..28587c57 100644
--- a/media/filters/decoder_stream.h
+++ b/media/filters/decoder_stream.h
@@ -15,6 +15,7 @@
#include "media/base/decryptor.h"
#include "media/base/demuxer_stream.h"
#include "media/base/media_export.h"
+#include "media/base/media_log.h"
#include "media/base/pipeline_status.h"
#include "media/filters/decoder_selector.h"
#include "media/filters/decoder_stream_traits.h"
@@ -52,7 +53,8 @@ class MEDIA_EXPORT DecoderStream {
DecoderStream(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
ScopedVector<Decoder> decoders,
- const SetDecryptorReadyCB& set_decryptor_ready_cb);
+ const SetDecryptorReadyCB& set_decryptor_ready_cb,
+ const scoped_refptr<MediaLog>& media_log);
virtual ~DecoderStream();
// Initializes the DecoderStream and returns the initialization result
@@ -159,6 +161,8 @@ class MEDIA_EXPORT DecoderStream {
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ scoped_refptr<MediaLog> media_log_;
+
State state_;
StatisticsCB statistics_cb_;
diff --git a/media/filters/decoder_stream_traits.cc b/media/filters/decoder_stream_traits.cc
index 824b912..1c654c3 100644
--- a/media/filters/decoder_stream_traits.cc
+++ b/media/filters/decoder_stream_traits.cc
@@ -15,7 +15,7 @@
namespace media {
std::string DecoderStreamTraits<DemuxerStream::AUDIO>::ToString() {
- return "Audio";
+ return "audio";
}
void DecoderStreamTraits<DemuxerStream::AUDIO>::Initialize(
@@ -47,7 +47,7 @@ scoped_refptr<DecoderStreamTraits<DemuxerStream::AUDIO>::OutputType>
}
std::string DecoderStreamTraits<DemuxerStream::VIDEO>::ToString() {
- return "Video";
+ return "video";
}
void DecoderStreamTraits<DemuxerStream::VIDEO>::Initialize(
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index ee50e2e..c5494f0 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -44,6 +44,10 @@ DecryptingAudioDecoder::DecryptingAudioDecoder(
key_added_while_decode_pending_(false),
weak_factory_(this) {}
+std::string DecryptingAudioDecoder::GetDisplayName() const {
+ return "DecryptingAudioDecoder";
+}
+
void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
const OutputCB& output_cb) {
diff --git a/media/filters/decrypting_audio_decoder.h b/media/filters/decrypting_audio_decoder.h
index 9ea211a..5dd455c 100644
--- a/media/filters/decrypting_audio_decoder.h
+++ b/media/filters/decrypting_audio_decoder.h
@@ -43,6 +43,7 @@ class MEDIA_EXPORT DecryptingAudioDecoder : public AudioDecoder {
virtual ~DecryptingAudioDecoder();
// AudioDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
const OutputCB& output_cb) OVERRIDE;
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc
index 421ec07..4a14bad 100644
--- a/media/filters/decrypting_video_decoder.cc
+++ b/media/filters/decrypting_video_decoder.cc
@@ -30,6 +30,10 @@ DecryptingVideoDecoder::DecryptingVideoDecoder(
trace_id_(0),
weak_factory_(this) {}
+std::string DecryptingVideoDecoder::GetDisplayName() const {
+ return "DecryptingVideoDecoder";
+}
+
void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool /* low_delay */,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/decrypting_video_decoder.h b/media/filters/decrypting_video_decoder.h
index 6550a29..c301e55 100644
--- a/media/filters/decrypting_video_decoder.h
+++ b/media/filters/decrypting_video_decoder.h
@@ -32,6 +32,7 @@ class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder {
virtual ~DecryptingVideoDecoder();
// VideoDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/fake_video_decoder.cc b/media/filters/fake_video_decoder.cc
index cf26ed5..f7f1abd 100644
--- a/media/filters/fake_video_decoder.cc
+++ b/media/filters/fake_video_decoder.cc
@@ -40,6 +40,10 @@ FakeVideoDecoder::~FakeVideoDecoder() {
decoded_frames_.clear();
}
+std::string FakeVideoDecoder::GetDisplayName() const {
+ return "FakeVideoDecoder";
+}
+
void FakeVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/fake_video_decoder.h b/media/filters/fake_video_decoder.h
index 5e476d8..e96dc16 100644
--- a/media/filters/fake_video_decoder.h
+++ b/media/filters/fake_video_decoder.h
@@ -36,6 +36,7 @@ class FakeVideoDecoder : public VideoDecoder {
virtual ~FakeVideoDecoder();
// VideoDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 466c786..ae4f3fb 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -143,6 +143,10 @@ FFmpegAudioDecoder::~FFmpegAudioDecoder() {
}
}
+std::string FFmpegAudioDecoder::GetDisplayName() const {
+ return "FFmpegAudioDecoder";
+}
+
void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
const OutputCB& output_cb) {
diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h
index 680128c..b13a016 100644
--- a/media/filters/ffmpeg_audio_decoder.h
+++ b/media/filters/ffmpeg_audio_decoder.h
@@ -36,6 +36,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
virtual ~FFmpegAudioDecoder();
// AudioDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
const OutputCB& output_cb) OVERRIDE;
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 59e061c..93dcee2 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -149,6 +149,10 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
return 0;
}
+std::string FFmpegVideoDecoder::GetDisplayName() const {
+ return "FFmpegVideoDecoder";
+}
+
void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h
index 529d69e..909a578 100644
--- a/media/filters/ffmpeg_video_decoder.h
+++ b/media/filters/ffmpeg_video_decoder.h
@@ -36,6 +36,7 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder {
void set_decode_nalus(bool decode_nalus) { decode_nalus_ = decode_nalus; }
// VideoDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 3954e09..5ca6c67 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -18,7 +18,6 @@
#include "gpu/command_buffer/common/mailbox_holder.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/decoder_buffer.h"
-#include "media/base/media_log.h"
#include "media/base/media_switches.h"
#include "media/base/pipeline.h"
#include "media/base/pipeline_status.h"
@@ -61,12 +60,10 @@ GpuVideoDecoder::BufferData::BufferData(
GpuVideoDecoder::BufferData::~BufferData() {}
GpuVideoDecoder::GpuVideoDecoder(
- const scoped_refptr<GpuVideoAcceleratorFactories>& factories,
- const scoped_refptr<MediaLog>& media_log)
+ const scoped_refptr<GpuVideoAcceleratorFactories>& factories)
: needs_bitstream_conversion_(false),
factories_(factories),
state_(kNormal),
- media_log_(media_log),
decoder_texture_target_(0),
next_picture_buffer_id_(0),
next_bitstream_buffer_id_(0),
@@ -138,6 +135,10 @@ static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB(
cb.Run(status);
}
+std::string GpuVideoDecoder::GetDisplayName() const {
+ return "GpuVideoDecoder";
+}
+
void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool /* low_delay */,
const PipelineStatusCB& orig_status_cb,
@@ -187,7 +188,6 @@ void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
}
DVLOG(3) << "GpuVideoDecoder::Initialize() succeeded.";
- media_log_->SetStringProperty("video_decoder", "gpu");
status_cb.Run(PIPELINE_OK);
}
diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h
index 3307684..743c127 100644
--- a/media/filters/gpu_video_decoder.h
+++ b/media/filters/gpu_video_decoder.h
@@ -38,10 +38,10 @@ class MEDIA_EXPORT GpuVideoDecoder
public VideoDecodeAccelerator::Client {
public:
explicit GpuVideoDecoder(
- const scoped_refptr<GpuVideoAcceleratorFactories>& factories,
- const scoped_refptr<MediaLog>& media_log);
+ const scoped_refptr<GpuVideoAcceleratorFactories>& factories);
// VideoDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
@@ -152,8 +152,6 @@ class MEDIA_EXPORT GpuVideoDecoder
// steady-state of the decoder.
std::vector<SHMBuffer*> available_shm_segments_;
- scoped_refptr<MediaLog> media_log_;
-
std::map<int32, PendingDecoderBuffer> bitstream_buffers_in_decoder_;
PictureBufferMap assigned_picture_buffers_;
// PictureBuffers given to us by VDA via PictureReady, which we sent forward
diff --git a/media/filters/opus_audio_decoder.cc b/media/filters/opus_audio_decoder.cc
index 6347347..51484ea 100644
--- a/media/filters/opus_audio_decoder.cc
+++ b/media/filters/opus_audio_decoder.cc
@@ -249,6 +249,10 @@ OpusAudioDecoder::OpusAudioDecoder(
opus_decoder_(NULL),
start_input_timestamp_(kNoTimestamp()) {}
+std::string OpusAudioDecoder::GetDisplayName() const {
+ return "OpusAudioDecoder";
+}
+
void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
const OutputCB& output_cb) {
diff --git a/media/filters/opus_audio_decoder.h b/media/filters/opus_audio_decoder.h
index 19ef04d..b69af92 100644
--- a/media/filters/opus_audio_decoder.h
+++ b/media/filters/opus_audio_decoder.h
@@ -31,6 +31,7 @@ class MEDIA_EXPORT OpusAudioDecoder : public AudioDecoder {
virtual ~OpusAudioDecoder();
// AudioDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const AudioDecoderConfig& config,
const PipelineStatusCB& status_cb,
const OutputCB& output_cb) OVERRIDE;
diff --git a/media/filters/pipeline_integration_test_base.cc b/media/filters/pipeline_integration_test_base.cc
index 7251adf..8edab1887 100644
--- a/media/filters/pipeline_integration_test_base.cc
+++ b/media/filters/pipeline_integration_test_base.cc
@@ -256,7 +256,8 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer(
decryptor),
base::Bind(&PipelineIntegrationTestBase::OnVideoRendererPaint,
base::Unretained(this)),
- false));
+ false,
+ new MediaLog()));
if (!clockless_playback_) {
audio_sink_ = new NullAudioSink(message_loop_.message_loop_proxy());
@@ -286,7 +287,8 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer(
base::Bind(&PipelineIntegrationTestBase::SetDecryptor,
base::Unretained(this),
decryptor),
- hardware_config_));
+ hardware_config_,
+ new MediaLog()));
if (hashing_enabled_)
audio_sink_->StartAudioHashForTesting();
diff --git a/media/filters/video_frame_stream_unittest.cc b/media/filters/video_frame_stream_unittest.cc
index e36172c..3a19e55 100644
--- a/media/filters/video_frame_stream_unittest.cc
+++ b/media/filters/video_frame_stream_unittest.cc
@@ -82,7 +82,8 @@ class VideoFrameStreamTest
message_loop_.message_loop_proxy(),
decoders.Pass(),
base::Bind(&VideoFrameStreamTest::SetDecryptorReadyCallback,
- base::Unretained(this))));
+ base::Unretained(this)),
+ new MediaLog()));
// Decryptor can only decrypt (not decrypt-and-decode) so that
// DecryptingDemuxerStream will be used.
diff --git a/media/filters/video_renderer_impl.cc b/media/filters/video_renderer_impl.cc
index 55a68c8..5d98288 100644
--- a/media/filters/video_renderer_impl.cc
+++ b/media/filters/video_renderer_impl.cc
@@ -24,11 +24,13 @@ VideoRendererImpl::VideoRendererImpl(
ScopedVector<VideoDecoder> decoders,
const SetDecryptorReadyCB& set_decryptor_ready_cb,
const PaintCB& paint_cb,
- bool drop_frames)
+ bool drop_frames,
+ const scoped_refptr<MediaLog>& media_log)
: task_runner_(task_runner),
video_frame_stream_(new VideoFrameStream(task_runner,
decoders.Pass(),
- set_decryptor_ready_cb)),
+ set_decryptor_ready_cb,
+ media_log)),
low_delay_(false),
received_end_of_stream_(false),
rendered_end_of_stream_(false),
diff --git a/media/filters/video_renderer_impl.h b/media/filters/video_renderer_impl.h
index 181beb57..59f1884 100644
--- a/media/filters/video_renderer_impl.h
+++ b/media/filters/video_renderer_impl.h
@@ -16,6 +16,7 @@
#include "base/threading/platform_thread.h"
#include "media/base/decryptor.h"
#include "media/base/demuxer_stream.h"
+#include "media/base/media_log.h"
#include "media/base/pipeline_status.h"
#include "media/base/video_decoder.h"
#include "media/base/video_frame.h"
@@ -53,7 +54,8 @@ class MEDIA_EXPORT VideoRendererImpl
ScopedVector<VideoDecoder> decoders,
const SetDecryptorReadyCB& set_decryptor_ready_cb,
const PaintCB& paint_cb,
- bool drop_frames);
+ bool drop_frames,
+ const scoped_refptr<MediaLog>& media_log);
virtual ~VideoRendererImpl();
// VideoRenderer implementation.
diff --git a/media/filters/video_renderer_impl_unittest.cc b/media/filters/video_renderer_impl_unittest.cc
index b81f81a..592090c 100644
--- a/media/filters/video_renderer_impl_unittest.cc
+++ b/media/filters/video_renderer_impl_unittest.cc
@@ -60,7 +60,8 @@ class VideoRendererImplTest : public ::testing::Test {
decoders.Pass(),
media::SetDecryptorReadyCB(),
base::Bind(&StrictMock<MockCB>::Display, base::Unretained(&mock_cb_)),
- true));
+ true,
+ new MediaLog()));
demuxer_stream_.set_video_decoder_config(TestVideoConfig::Normal());
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index cb652c0..bf7cc3c 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -202,6 +202,10 @@ VpxVideoDecoder::~VpxVideoDecoder() {
CloseDecoder();
}
+std::string VpxVideoDecoder::GetDisplayName() const {
+ return "VpxVideoDecoder";
+}
+
void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/filters/vpx_video_decoder.h b/media/filters/vpx_video_decoder.h
index 0e1a941..fdc5958 100644
--- a/media/filters/vpx_video_decoder.h
+++ b/media/filters/vpx_video_decoder.h
@@ -32,6 +32,7 @@ class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder {
virtual ~VpxVideoDecoder();
// VideoDecoder implementation.
+ virtual std::string GetDisplayName() const OVERRIDE;
virtual void Initialize(const VideoDecoderConfig& config,
bool low_delay,
const PipelineStatusCB& status_cb,
diff --git a/media/tools/player_x11/player_x11.cc b/media/tools/player_x11/player_x11.cc
index e5df83c..e2198b3 100644
--- a/media/tools/player_x11/player_x11.cc
+++ b/media/tools/player_x11/player_x11.cc
@@ -121,7 +121,8 @@ void InitPipeline(
video_decoders.Pass(),
media::SetDecryptorReadyCB(),
paint_cb,
- true));
+ true,
+ new media::MediaLog()));
ScopedVector<media::AudioDecoder> audio_decoders;
audio_decoders.push_back(new media::FFmpegAudioDecoder(task_runner,
@@ -139,7 +140,8 @@ void InitPipeline(
new media::NullAudioSink(task_runner),
audio_decoders.Pass(),
media::SetDecryptorReadyCB(),
- hardware_config));
+ hardware_config,
+ new media::MediaLog()));
scoped_ptr<media::Renderer> renderer(new media::RendererImpl(
task_runner, demuxer, audio_renderer.Pass(), video_renderer.Pass()));