-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
DecoderStreamTraits<DemuxerStream::AUDIO>::DecoderStreamTraits(
MediaLog* media_log,
- ChannelLayout initial_hw_layout)
- : media_log_(media_log), initial_hw_layout_(initial_hw_layout) {
+ ChannelLayout initial_hw_layout,
+ SampleFormat initial_hw_sample_format)
+ : media_log_(media_log),
+ initial_hw_layout_(initial_hw_layout),
+ initial_hw_sample_format_(initial_hw_sample_format) {
weak_this_ = weak_factory_.GetWeakPtr();
}
auto config = stream->audio_decoder_config();
// Demuxer is not aware of hw layout, so we set it here.
config.set_target_output_channel_layout(initial_hw_layout_);
+ config.set_target_output_sample_format(initial_hw_sample_format_);
return config;
}
void DecoderStreamTraits<DemuxerStream::AUDIO>::OnDecoderInitialized(
DecoderType* decoder,
InitCB cb,
- Status result) {
+ DecoderStatus result) {
if (result.is_ok())
stats_.audio_pipeline_info.decoder_type = decoder->GetDecoderType();
std::move(cb).Run(result);
void DecoderStreamTraits<DemuxerStream::VIDEO>::OnDecoderInitialized(
DecoderType* decoder,
InitCB cb,
- Status result) {
+ DecoderStatus result) {
if (result.is_ok()) {
stats_.video_pipeline_info.decoder_type = decoder->GetDecoderType();
DVLOG(2) << stats_.video_pipeline_info.decoder_type;
base::TimeTicks::Now() - *buffer->metadata().decode_begin_time;
}
+void DecoderStreamTraits<DemuxerStream::VIDEO>::SetPreferNonPlatformDecoders(
+ bool prefer) {
+ prefer_non_platform_decoders_ = prefer;
+}
+
+bool DecoderStreamTraits<DemuxerStream::VIDEO>::GetPreferNonPlatformDecoders()
+ const {
+ return prefer_non_platform_decoders_;
+}
+
} // namespace media