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

Unified Diff: media/filters/ffmpeg_audio_decoder.h

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/filters/android/media_codec_audio_decoder.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.h
diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h
index 214a2245e4b8696e2f3e52da7f8b8701584a00c5..8ac9d70abf214b6f6cae9b5480681db0d4f7b986 100644
--- a/media/filters/ffmpeg_audio_decoder.h
+++ b/media/filters/ffmpeg_audio_decoder.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/time/time.h"
+#include "media/base/audio_buffer.h"
#include "media/base/audio_decoder.h"
#include "media/base/demuxer_stream.h"
#include "media/base/media_log.h"
@@ -46,6 +47,11 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
const DecodeCB& decode_cb) override;
void Reset(const base::Closure& closure) override;
+ // Callback called from within FFmpeg to allocate a buffer based on the
+ // properties of |codec_context| and |frame|. See AVCodecContext.get_buffer2
+ // documentation inside FFmpeg.
+ int GetAudioBuffer(struct AVCodecContext* s, AVFrame* frame, int flags);
+
private:
// There are four states the decoder can be in:
//
@@ -111,6 +117,8 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
scoped_refptr<MediaLog> media_log_;
+ scoped_refptr<AudioBufferMemoryPool> pool_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
};
« no previous file with comments | « media/filters/android/media_codec_audio_decoder.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698