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

Unified Diff: content/renderer/pepper/content_decryptor_delegate.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 | « content/renderer/pepper/content_decryptor_delegate.h ('k') | media/base/audio_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/content_decryptor_delegate.cc
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc
index 0048699582e2aeffaeb35ce532a61daafcd8d5c2..a28e2a7883181e5be099f5fe671e93d05a7ce4f7 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -14,7 +14,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/trace_event/trace_event.h"
#include "content/renderer/pepper/ppb_buffer_impl.h"
-#include "media/base/audio_buffer.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/cdm_key_information.h"
@@ -384,6 +383,7 @@ ContentDecryptorDelegate::ContentDecryptorDelegate(
audio_samples_per_second_(0),
audio_channel_count_(0),
audio_channel_layout_(media::CHANNEL_LAYOUT_NONE),
+ pool_(new media::AudioBufferMemoryPool()),
weak_ptr_factory_(this) {
weak_this_ = weak_ptr_factory_.GetWeakPtr();
}
@@ -1238,13 +1238,9 @@ bool ContentDecryptorDelegate::DeserializeAudioFrames(
const int frame_count = frame_size / audio_bytes_per_frame;
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));
+ sample_format, audio_channel_layout_, audio_channel_count_,
+ audio_samples_per_second_, frame_count, &channel_ptrs[0],
+ base::TimeDelta::FromMicroseconds(timestamp), pool_);
frames->push_back(frame);
cur += frame_size;
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.h ('k') | media/base/audio_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698