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

Side by Side Diff: media/filters/android/media_codec_audio_decoder.h

Issue 2788483003: Introduce AudioBufferMemoryPool to avoid thrashing on audio buffers. (Closed)
Patch Set: Add class comments. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « media/cdm/cdm_adapter.cc ('k') | media/filters/android/media_codec_audio_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ 6 #define MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "base/timer/timer.h" 16 #include "base/timer/timer.h"
17 #include "media/base/android/media_codec_loop.h" 17 #include "media/base/android/media_codec_loop.h"
18 #include "media/base/android/media_drm_bridge_cdm_context.h" 18 #include "media/base/android/media_drm_bridge_cdm_context.h"
19 #include "media/base/audio_buffer.h"
19 #include "media/base/audio_decoder.h" 20 #include "media/base/audio_decoder.h"
20 #include "media/base/audio_decoder_config.h" 21 #include "media/base/audio_decoder_config.h"
21 #include "media/base/media_export.h" 22 #include "media/base/media_export.h"
22 23
23 // MediaCodecAudioDecoder is based on Android's MediaCodec API. 24 // MediaCodecAudioDecoder is based on Android's MediaCodec API.
24 // The MediaCodec API is required to play encrypted (as in EME) content on 25 // The MediaCodec API is required to play encrypted (as in EME) content on
25 // Android. It is also a way to employ hardware-accelerated decoding. 26 // Android. It is also a way to employ hardware-accelerated decoding.
26 27
27 // Implementation notes. 28 // Implementation notes.
28 // 29 //
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // CDM related stuff. 186 // CDM related stuff.
186 187
187 // CDM context that knowns about MediaCrypto. Owned by CDM which is external 188 // CDM context that knowns about MediaCrypto. Owned by CDM which is external
188 // to this decoder. 189 // to this decoder.
189 MediaDrmBridgeCdmContext* media_drm_bridge_cdm_context_; 190 MediaDrmBridgeCdmContext* media_drm_bridge_cdm_context_;
190 191
191 // MediaDrmBridge requires registration/unregistration of the player, this 192 // MediaDrmBridge requires registration/unregistration of the player, this
192 // registration id is used for this. 193 // registration id is used for this.
193 int cdm_registration_id_; 194 int cdm_registration_id_;
194 195
196 // Pool which helps avoid thrashing memory when returning audio buffers.
197 scoped_refptr<AudioBufferMemoryPool> pool_;
198
195 // The MediaCrypto object is used in the MediaCodec.configure() in case of 199 // The MediaCrypto object is used in the MediaCodec.configure() in case of
196 // an encrypted stream. 200 // an encrypted stream.
197 media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto_; 201 media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto_;
198 202
199 base::WeakPtrFactory<MediaCodecAudioDecoder> weak_factory_; 203 base::WeakPtrFactory<MediaCodecAudioDecoder> weak_factory_;
200 204
201 DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder); 205 DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder);
202 }; 206 };
203 207
204 } // namespace media 208 } // namespace media
205 209
206 #endif // MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ 210 #endif // MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « media/cdm/cdm_adapter.cc ('k') | media/filters/android/media_codec_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698