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

Unified Diff: media/filters/opus_audio_decoder.h

Issue 100503006: Cleanup OPUS decoder. Remove extraneous transforms and copies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch demuxer. Created 7 years 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: media/filters/opus_audio_decoder.h
diff --git a/media/filters/opus_audio_decoder.h b/media/filters/opus_audio_decoder.h
index 50ba0690eb37ecde901cfe7245d4b5f6a4c6e388..b2db23f3795dc85af9057b8bc6f8973b78d52e0e 100644
--- a/media/filters/opus_audio_decoder.h
+++ b/media/filters/opus_audio_decoder.h
@@ -10,6 +10,7 @@
#include "base/time/time.h"
#include "media/base/audio_decoder.h"
#include "media/base/demuxer_stream.h"
+#include "media/base/sample_format.h"
struct OpusMSDecoder;
@@ -62,9 +63,10 @@ class MEDIA_EXPORT OpusAudioDecoder : public AudioDecoder {
OpusMSDecoder* opus_decoder_;
// Decoded audio format.
- int bits_per_channel_;
ChannelLayout channel_layout_;
int samples_per_second_;
+ const SampleFormat sample_format_;
+ const int bits_per_channel_;
// Used for computing output timestamps.
scoped_ptr<AudioTimestampHelper> output_timestamp_helper_;
@@ -87,8 +89,11 @@ class MEDIA_EXPORT OpusAudioDecoder : public AudioDecoder {
// from the CodecDelay value in the container.
base::TimeDelta timestamp_offset_;
- // Buffer for output from libopus.
- scoped_ptr<int16[]> output_buffer_;
+ // Hack to correctly trim the |frame_delay_at_start_| on playbacks after the
+ // first. We track the first frame which has audio data and the amount
+ // discarded from that frame (if any).
+ base::TimeDelta first_output_frame_;
+ int partial_frame_delay_at_start_;
DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698