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

Unified Diff: media/cdm/cdm_adapter.cc

Issue 2788483003: Introduce AudioBufferMemoryPool to avoid thrashing on audio buffers. (Closed)
Patch Set: Add class comments. 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/cdm/cdm_adapter.h ('k') | media/filters/android/media_codec_audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/cdm_adapter.cc
diff --git a/media/cdm/cdm_adapter.cc b/media/cdm/cdm_adapter.cc
index 2d0bd6c3ba28249d329ddce3018164e8d9d8c3c4..7b8f8379fc48be050a867c9bd741e0ba91f14b45 100644
--- a/media/cdm/cdm_adapter.cc
+++ b/media/cdm/cdm_adapter.cc
@@ -376,6 +376,7 @@ CdmAdapter::CdmAdapter(
allocator_(std::move(allocator)),
create_cdm_file_io_cb_(create_cdm_file_io_cb),
task_runner_(base::ThreadTaskRunnerHandle::Get()),
+ pool_(new AudioBufferMemoryPool()),
weak_factory_(this) {
DCHECK(!key_system_.empty());
DCHECK(!session_message_cb_.is_null());
@@ -936,7 +937,7 @@ bool CdmAdapter::AudioFramesDataToAudioFrames(
scoped_refptr<media::AudioBuffer> frame = media::AudioBuffer::CopyFrom(
sample_format, audio_channel_layout_, audio_channel_count,
audio_samples_per_second_, frame_count, &channel_ptrs[0],
- base::TimeDelta::FromMicroseconds(timestamp));
+ base::TimeDelta::FromMicroseconds(timestamp), pool_);
result_frames->push_back(frame);
data += frame_size;
« no previous file with comments | « media/cdm/cdm_adapter.h ('k') | media/filters/android/media_codec_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698