OLD | NEW |
---|---|
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" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 void BufferReady(DemuxerStream::Status status, | 51 void BufferReady(DemuxerStream::Status status, |
52 const scoped_refptr<DecoderBuffer>& input); | 52 const scoped_refptr<DecoderBuffer>& input); |
53 | 53 |
54 bool ConfigureDecoder(); | 54 bool ConfigureDecoder(); |
55 void CloseDecoder(); | 55 void CloseDecoder(); |
56 void ResetTimestampState(); | 56 void ResetTimestampState(); |
57 bool Decode(const scoped_refptr<DecoderBuffer>& input, | 57 bool Decode(const scoped_refptr<DecoderBuffer>& input, |
58 scoped_refptr<AudioBuffer>* output_buffer); | 58 scoped_refptr<AudioBuffer>* output_buffer); |
59 | 59 |
60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
61 base::WeakPtrFactory<OpusAudioDecoder> weak_factory_; | |
62 base::WeakPtr<OpusAudioDecoder> weak_this_; | |
63 | 61 |
64 DemuxerStream* demuxer_stream_; | 62 DemuxerStream* demuxer_stream_; |
65 StatisticsCB statistics_cb_; | 63 StatisticsCB statistics_cb_; |
66 OpusMSDecoder* opus_decoder_; | 64 OpusMSDecoder* opus_decoder_; |
67 | 65 |
68 // Decoded audio format. | 66 // Decoded audio format. |
69 ChannelLayout channel_layout_; | 67 ChannelLayout channel_layout_; |
70 int samples_per_second_; | 68 int samples_per_second_; |
71 const SampleFormat sample_format_; | 69 const SampleFormat sample_format_; |
72 const int bits_per_channel_; | 70 const int bits_per_channel_; |
(...skipping 16 matching lines...) Expand all Loading... | |
89 // Number of frames to be discarded at the start of the stream. This value | 87 // Number of frames to be discarded at the start of the stream. This value |
90 // is typically the CodecDelay value from the container. This value should | 88 // is typically the CodecDelay value from the container. This value should |
91 // only be applied when input timestamp is |start_input_timestamp_|. | 89 // only be applied when input timestamp is |start_input_timestamp_|. |
92 int frame_delay_at_start_; | 90 int frame_delay_at_start_; |
93 base::TimeDelta start_input_timestamp_; | 91 base::TimeDelta start_input_timestamp_; |
94 | 92 |
95 // Timestamp to be subtracted from all the frames. This is typically computed | 93 // Timestamp to be subtracted from all the frames. This is typically computed |
96 // from the CodecDelay value in the container. | 94 // from the CodecDelay value in the container. |
97 base::TimeDelta timestamp_offset_; | 95 base::TimeDelta timestamp_offset_; |
98 | 96 |
97 // NOTE: These must always be last so they're invalidated before other member | |
98 // variables might be accessed. | |
99 base::WeakPtr<OpusAudioDecoder> weak_this_; | |
Ami GONE FROM CHROMIUM
2014/03/10 22:02:08
ditto
| |
100 base::WeakPtrFactory<OpusAudioDecoder> weak_factory_; | |
101 | |
99 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder); | 102 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder); |
100 }; | 103 }; |
101 | 104 |
102 } // namespace media | 105 } // namespace media |
103 | 106 |
104 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ | 107 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ |
OLD | NEW |