1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
media / base / demuxer_memory_limit_default.cc [blame]
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/demuxer_memory_limit.h"
#include "base/system/sys_info.h"
namespace media {
size_t GetDemuxerStreamAudioMemoryLimit(
const AudioDecoderConfig* /*audio_config*/) {
return base::SysInfo::IsLowEndDevice()
? internal::kDemuxerStreamAudioMemoryLimitLow
: internal::kDemuxerStreamAudioMemoryLimitDefault;
}
size_t GetDemuxerStreamVideoMemoryLimit(
Demuxer::DemuxerTypes /*demuxer_type*/,
const VideoDecoderConfig* /*video_config*/) {
return base::SysInfo::IsLowEndDevice()
? internal::kDemuxerStreamVideoMemoryLimitLow
: internal::kDemuxerStreamVideoMemoryLimitDefault;
}
size_t GetDemuxerMemoryLimit(Demuxer::DemuxerTypes demuxer_type) {
return GetDemuxerStreamAudioMemoryLimit(nullptr) +
GetDemuxerStreamVideoMemoryLimit(demuxer_type, nullptr);
}
} // namespace media