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

Unified Diff: chromecast/media/cma/backend/alsa/audio_decoder_alsa.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
Index: chromecast/media/cma/backend/alsa/audio_decoder_alsa.cc
diff --git a/chromecast/media/cma/backend/alsa/audio_decoder_alsa.cc b/chromecast/media/cma/backend/alsa/audio_decoder_alsa.cc
index 76888353f6dc1d20e90fd878f164a45ee510bd2a..c56e6dacc1aba689c32246250ef3c0e23f3e7a79 100644
--- a/chromecast/media/cma/backend/alsa/audio_decoder_alsa.cc
+++ b/chromecast/media/cma/backend/alsa/audio_decoder_alsa.cc
@@ -18,7 +18,6 @@
#include "chromecast/media/cma/base/decoder_buffer_adapter.h"
#include "chromecast/media/cma/base/decoder_buffer_base.h"
#include "chromecast/public/media/cast_decoder_buffer.h"
-#include "media/base/audio_buffer.h"
#include "media/base/audio_bus.h"
#include "media/base/channel_layout.h"
#include "media/base/decoder_buffer.h"
@@ -72,6 +71,7 @@ AudioDecoderAlsa::AudioDecoderAlsa(MediaPipelineBackendAlsa* backend)
current_pts_(kInvalidTimestamp),
pending_output_frames_(kNoPendingOutput),
volume_multiplier_(1.0f),
+ pool_(new ::media::AudioBufferMemoryPool()),
weak_factory_(this) {
TRACE_FUNCTION_ENTRY0();
DCHECK(backend_);
@@ -380,7 +380,7 @@ void AudioDecoderAlsa::OnBufferDecoded(
scoped_refptr<::media::AudioBuffer> buffer = ::media::AudioBuffer::CopyFrom(
::media::kSampleFormatPlanarF32, ::media::CHANNEL_LAYOUT_STEREO,
kNumChannels, config_.samples_per_second, input_frames, channels,
- base::TimeDelta());
+ base::TimeDelta(), pool_);
rate_shifter_->EnqueueBuffer(buffer);
rate_shifter_info_.back().input_frames += input_frames;
}
« no previous file with comments | « chromecast/media/cma/backend/alsa/audio_decoder_alsa.h ('k') | content/renderer/pepper/content_decryptor_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698