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 <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | |
11 | 12 |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/memory/ptr_util.h" | |
xhwang
2017/05/10 16:41:24
not needed?
xiaofengzhang
2017/05/11 06:34:43
Done.
| |
14 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_vector.h" | |
16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
17 #include "media/base/audio_decoder.h" | 18 #include "media/base/audio_decoder.h" |
18 #include "media/base/audio_timestamp_helper.h" | 19 #include "media/base/audio_timestamp_helper.h" |
19 #include "media/base/demuxer_stream.h" | 20 #include "media/base/demuxer_stream.h" |
20 #include "media/base/media_export.h" | 21 #include "media/base/media_export.h" |
21 #include "media/base/media_log.h" | 22 #include "media/base/media_log.h" |
22 #include "media/base/moving_average.h" | 23 #include "media/base/moving_average.h" |
23 #include "media/base/pipeline_status.h" | 24 #include "media/base/pipeline_status.h" |
24 #include "media/base/timestamp_constants.h" | 25 #include "media/base/timestamp_constants.h" |
25 #include "media/filters/decoder_selector.h" | 26 #include "media/filters/decoder_selector.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
44 typedef typename StreamTraits::OutputType Output; | 45 typedef typename StreamTraits::OutputType Output; |
45 | 46 |
46 enum Status { | 47 enum Status { |
47 OK, // Everything went as planned. | 48 OK, // Everything went as planned. |
48 ABORTED, // Read aborted due to Reset() during pending read. | 49 ABORTED, // Read aborted due to Reset() during pending read. |
49 DEMUXER_READ_ABORTED, // Demuxer returned aborted read. | 50 DEMUXER_READ_ABORTED, // Demuxer returned aborted read. |
50 DECODE_ERROR, // Decoder returned decode error. | 51 DECODE_ERROR, // Decoder returned decode error. |
51 }; | 52 }; |
52 | 53 |
53 // Callback to create a list of decoders. | 54 // Callback to create a list of decoders. |
54 using CreateDecodersCB = base::RepeatingCallback<ScopedVector<Decoder>()>; | 55 using CreateDecodersCB = |
56 base::RepeatingCallback<std::vector<std::unique_ptr<Decoder>>()>; | |
55 | 57 |
56 // Indicates completion of a DecoderStream initialization. | 58 // Indicates completion of a DecoderStream initialization. |
57 using InitCB = base::Callback<void(bool success)>; | 59 using InitCB = base::Callback<void(bool success)>; |
58 | 60 |
59 // Indicates completion of a DecoderStream read. | 61 // Indicates completion of a DecoderStream read. |
60 using ReadCB = base::Callback<void(Status, const scoped_refptr<Output>&)>; | 62 using ReadCB = base::Callback<void(Status, const scoped_refptr<Output>&)>; |
61 | 63 |
62 DecoderStream(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 64 DecoderStream(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
63 CreateDecodersCB create_decoders_cb, | 65 CreateDecodersCB create_decoders_cb, |
64 MediaLog* media_log); | 66 MediaLog* media_log); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 | 276 |
275 template <> | 277 template <> |
276 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; | 278 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; |
277 | 279 |
278 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; | 280 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; |
279 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; | 281 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; |
280 | 282 |
281 } // namespace media | 283 } // namespace media |
282 | 284 |
283 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ | 285 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ |
OLD | NEW |