diff options
author | damienv@chromium.org <damienv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-21 06:04:35 +0000 |
---|---|---|
committer | damienv@chromium.org <damienv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-21 06:04:35 +0000 |
commit | 17172925cd04148fe1725eec80bd80b9e92de58b (patch) | |
tree | 913161bb552072310a6dfc2be1c051ef79283fc8 /media/filters | |
parent | 9522e95478eea925f4d9e4bfc91d6181b7d91d53 (diff) | |
download | chromium_src-17172925cd04148fe1725eec80bd80b9e92de58b.zip chromium_src-17172925cd04148fe1725eec80bd80b9e92de58b.tar.gz chromium_src-17172925cd04148fe1725eec80bd80b9e92de58b.tar.bz2 |
Extract SourceBuffer related constants to a separate file.
This change makes it easier to provide platform specific values in the future.
BUG=None
Review URL: https://codereview.chromium.org/343003002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/filters')
-rw-r--r-- | media/filters/source_buffer_platform.cc | 14 | ||||
-rw-r--r-- | media/filters/source_buffer_platform.h | 18 | ||||
-rw-r--r-- | media/filters/source_buffer_stream.cc | 12 |
3 files changed, 36 insertions, 8 deletions
diff --git a/media/filters/source_buffer_platform.cc b/media/filters/source_buffer_platform.cc new file mode 100644 index 0000000..6457e8c --- /dev/null +++ b/media/filters/source_buffer_platform.cc @@ -0,0 +1,14 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/filters/source_buffer_platform.h" + +namespace media { + +// 12MB: approximately 5 minutes of 320Kbps content. +// 150MB: approximately 5 minutes of 4Mbps content. +const int kSourceBufferAudioMemoryLimit = 12 * 1024 * 1024; +const int kSourceBufferVideoMemoryLimit = 150 * 1024 * 1024; + +} // namespace media diff --git a/media/filters/source_buffer_platform.h b/media/filters/source_buffer_platform.h new file mode 100644 index 0000000..b063f99 --- /dev/null +++ b/media/filters/source_buffer_platform.h @@ -0,0 +1,18 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_FILTERS_SOURCE_BUFFER_PLATFORM_H_ +#define MEDIA_FILTERS_SOURCE_BUFFER_PLATFORM_H_ + +#include "media/base/media_export.h" + +namespace media { + +// The maximum amount of data in bytes the stream will keep in memory. +MEDIA_EXPORT extern const int kSourceBufferAudioMemoryLimit; +MEDIA_EXPORT extern const int kSourceBufferVideoMemoryLimit; + +} // namespace media + +#endif // MEDIA_FILTERS_SOURCE_BUFFER_PLATFORM_H_ diff --git a/media/filters/source_buffer_stream.cc b/media/filters/source_buffer_stream.cc index fe22b4a..f72b00a 100644 --- a/media/filters/source_buffer_stream.cc +++ b/media/filters/source_buffer_stream.cc @@ -11,6 +11,7 @@ #include "base/debug/trace_event.h" #include "base/logging.h" #include "media/base/audio_splicer.h" +#include "media/filters/source_buffer_platform.h" namespace media { @@ -333,11 +334,6 @@ static int kDefaultBufferDurationInMs = 125; static base::TimeDelta kSeekToStartFudgeRoom() { return base::TimeDelta::FromMilliseconds(1000); } -// The maximum amount of data in bytes the stream will keep in memory. -// 12MB: approximately 5 minutes of 320Kbps content. -// 150MB: approximately 5 minutes of 4Mbps content. -static int kDefaultAudioMemoryLimit = 12 * 1024 * 1024; -static int kDefaultVideoMemoryLimit = 150 * 1024 * 1024; namespace media { @@ -358,7 +354,7 @@ SourceBufferStream::SourceBufferStream(const AudioDecoderConfig& audio_config, last_appended_buffer_is_keyframe_(false), last_output_buffer_timestamp_(kNoTimestamp()), max_interbuffer_distance_(kNoTimestamp()), - memory_limit_(kDefaultAudioMemoryLimit), + memory_limit_(kSourceBufferAudioMemoryLimit), config_change_pending_(false), splice_buffers_index_(0), pending_buffers_complete_(false), @@ -384,7 +380,7 @@ SourceBufferStream::SourceBufferStream(const VideoDecoderConfig& video_config, last_appended_buffer_is_keyframe_(false), last_output_buffer_timestamp_(kNoTimestamp()), max_interbuffer_distance_(kNoTimestamp()), - memory_limit_(kDefaultVideoMemoryLimit), + memory_limit_(kSourceBufferVideoMemoryLimit), config_change_pending_(false), splice_buffers_index_(0), pending_buffers_complete_(false), @@ -411,7 +407,7 @@ SourceBufferStream::SourceBufferStream(const TextTrackConfig& text_config, last_appended_buffer_is_keyframe_(false), last_output_buffer_timestamp_(kNoTimestamp()), max_interbuffer_distance_(kNoTimestamp()), - memory_limit_(kDefaultAudioMemoryLimit), + memory_limit_(kSourceBufferAudioMemoryLimit), config_change_pending_(false), splice_buffers_index_(0), pending_buffers_complete_(false), |