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

Side by Side 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: Android. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_OPUS_AUDIO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ 6 #define MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "media/base/audio_decoder.h" 11 #include "media/base/audio_decoder.h"
12 #include "media/base/demuxer_stream.h" 12 #include "media/base/demuxer_stream.h"
13 #include "media/base/sample_format.h"
13 14
14 struct OpusMSDecoder; 15 struct OpusMSDecoder;
15 16
16 namespace base { 17 namespace base {
17 class MessageLoopProxy; 18 class MessageLoopProxy;
18 } 19 }
19 20
20 namespace media { 21 namespace media {
21 22
22 class AudioBuffer; 23 class AudioBuffer;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 base::WeakPtr<OpusAudioDecoder> weak_this_; 59 base::WeakPtr<OpusAudioDecoder> weak_this_;
59 60
60 DemuxerStream* demuxer_stream_; 61 DemuxerStream* demuxer_stream_;
61 StatisticsCB statistics_cb_; 62 StatisticsCB statistics_cb_;
62 OpusMSDecoder* opus_decoder_; 63 OpusMSDecoder* opus_decoder_;
63 64
64 // Decoded audio format. 65 // Decoded audio format.
65 int bits_per_channel_; 66 int bits_per_channel_;
66 ChannelLayout channel_layout_; 67 ChannelLayout channel_layout_;
67 int samples_per_second_; 68 int samples_per_second_;
69 SampleFormat sample_format_;
68 70
69 // Used for computing output timestamps. 71 // Used for computing output timestamps.
70 scoped_ptr<AudioTimestampHelper> output_timestamp_helper_; 72 scoped_ptr<AudioTimestampHelper> output_timestamp_helper_;
71 base::TimeDelta last_input_timestamp_; 73 base::TimeDelta last_input_timestamp_;
72 74
73 ReadCB read_cb_; 75 ReadCB read_cb_;
74 76
75 // Number of frames to be discarded from the start of the packet. This value 77 // Number of frames to be discarded from the start of the packet. This value
76 // is respected for all packets except for the first one in the stream. For 78 // is respected for all packets except for the first one in the stream. For
77 // the first packet in the stream, |frame_delay_at_start_| is used. This is 79 // the first packet in the stream, |frame_delay_at_start_| is used. This is
78 // usually set to the SeekPreRoll value from the container whenever a seek 80 // usually set to the SeekPreRoll value from the container whenever a seek
79 // happens. 81 // happens.
80 int frames_to_discard_; 82 int frames_to_discard_;
81 83
82 // Number of frames to be discarded at the start of the stream. This value 84 // Number of frames to be discarded at the start of the stream. This value
83 // is typically the CodecDelay value from the container. 85 // is typically the CodecDelay value from the container.
84 int frame_delay_at_start_; 86 int frame_delay_at_start_;
85 87
86 // Timestamp to be subtracted from all the frames. This is typically computed 88 // Timestamp to be subtracted from all the frames. This is typically computed
87 // from the CodecDelay value in the container. 89 // from the CodecDelay value in the container.
88 base::TimeDelta timestamp_offset_; 90 base::TimeDelta timestamp_offset_;
89 91
90 // Buffer for output from libopus.
91 scoped_ptr<int16[]> output_buffer_;
92
93 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder); 92 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder);
94 }; 93 };
95 94
96 } // namespace media 95 } // namespace media
97 96
98 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ 97 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698