OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DECODER_STREAM_H_ | 5 #ifndef MEDIA_FILTERS_DECODER_STREAM_H_ |
6 #define MEDIA_FILTERS_DECODER_STREAM_H_ | 6 #define MEDIA_FILTERS_DECODER_STREAM_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Callback for Decoder reinitialization. | 140 // Callback for Decoder reinitialization. |
141 void OnDecoderReinitialized(PipelineStatus status); | 141 void OnDecoderReinitialized(PipelineStatus status); |
142 | 142 |
143 void ResetDecoder(); | 143 void ResetDecoder(); |
144 void OnDecoderReset(); | 144 void OnDecoderReset(); |
145 | 145 |
146 void StopDecoder(); | 146 void StopDecoder(); |
147 void OnDecoderStopped(); | 147 void OnDecoderStopped(); |
148 | 148 |
149 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 149 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
150 base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_; | |
151 | 150 |
152 State state_; | 151 State state_; |
153 | 152 |
154 StatisticsCB statistics_cb_; | 153 StatisticsCB statistics_cb_; |
155 InitCB init_cb_; | 154 InitCB init_cb_; |
156 | 155 |
157 ReadCB read_cb_; | 156 ReadCB read_cb_; |
158 base::Closure reset_cb_; | 157 base::Closure reset_cb_; |
159 base::Closure stop_cb_; | 158 base::Closure stop_cb_; |
160 | 159 |
161 DemuxerStream* stream_; | 160 DemuxerStream* stream_; |
162 | 161 |
163 scoped_ptr<DecoderSelector<StreamType> > decoder_selector_; | 162 scoped_ptr<DecoderSelector<StreamType> > decoder_selector_; |
164 | 163 |
165 // These two will be set by DecoderSelector::SelectDecoder(). | 164 // These two will be set by DecoderSelector::SelectDecoder(). |
166 scoped_ptr<Decoder> decoder_; | 165 scoped_ptr<Decoder> decoder_; |
167 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; | 166 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; |
168 | 167 |
| 168 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 169 base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_; |
| 170 |
169 // This is required so the VideoFrameStream can access private members in | 171 // This is required so the VideoFrameStream can access private members in |
170 // FinishInitialization() and ReportStatistics(). | 172 // FinishInitialization() and ReportStatistics(). |
171 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream); | 173 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream); |
172 }; | 174 }; |
173 | 175 |
174 template <> | 176 template <> |
175 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; | 177 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; |
176 | 178 |
177 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; | 179 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; |
178 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; | 180 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; |
179 | 181 |
180 } // namespace media | 182 } // namespace media |
181 | 183 |
182 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ | 184 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ |
OLD | NEW |