OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FAKE_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // count over all calls will be equal to total_bytes_decoded(). | 37 // count over all calls will be equal to total_bytes_decoded(). |
38 FakeVideoDecoder(int decoding_delay, | 38 FakeVideoDecoder(int decoding_delay, |
39 int max_parallel_decoding_requests, | 39 int max_parallel_decoding_requests, |
40 const BytesDecodedCB& bytes_decoded_cb); | 40 const BytesDecodedCB& bytes_decoded_cb); |
41 ~FakeVideoDecoder() override; | 41 ~FakeVideoDecoder() override; |
42 | 42 |
43 // VideoDecoder implementation. | 43 // VideoDecoder implementation. |
44 std::string GetDisplayName() const override; | 44 std::string GetDisplayName() const override; |
45 void Initialize(const VideoDecoderConfig& config, | 45 void Initialize(const VideoDecoderConfig& config, |
46 bool low_delay, | 46 bool low_delay, |
47 const PipelineStatusCB& status_cb, | 47 const InitCB& init_cb, |
48 const OutputCB& output_cb) override; | 48 const OutputCB& output_cb) override; |
49 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 49 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
50 const DecodeCB& decode_cb) override; | 50 const DecodeCB& decode_cb) override; |
51 void Reset(const base::Closure& closure) override; | 51 void Reset(const base::Closure& closure) override; |
52 int GetMaxDecodeRequests() const override; | 52 int GetMaxDecodeRequests() const override; |
53 | 53 |
54 // Holds the next init/decode/reset callback from firing. | 54 // Holds the next init/decode/reset callback from firing. |
55 void HoldNextInit(); | 55 void HoldNextInit(); |
56 void HoldDecode(); | 56 void HoldDecode(); |
57 void HoldNextReset(); | 57 void HoldNextReset(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void DoReset(); | 94 void DoReset(); |
95 | 95 |
96 base::ThreadChecker thread_checker_; | 96 base::ThreadChecker thread_checker_; |
97 | 97 |
98 const size_t decoding_delay_; | 98 const size_t decoding_delay_; |
99 const int max_parallel_decoding_requests_; | 99 const int max_parallel_decoding_requests_; |
100 BytesDecodedCB bytes_decoded_cb_; | 100 BytesDecodedCB bytes_decoded_cb_; |
101 | 101 |
102 State state_; | 102 State state_; |
103 | 103 |
104 CallbackHolder<PipelineStatusCB> init_cb_; | 104 CallbackHolder<InitCB> init_cb_; |
105 CallbackHolder<base::Closure> reset_cb_; | 105 CallbackHolder<base::Closure> reset_cb_; |
106 | 106 |
107 OutputCB output_cb_; | 107 OutputCB output_cb_; |
108 | 108 |
109 bool hold_decode_; | 109 bool hold_decode_; |
110 std::list<DecodeCB> held_decode_callbacks_; | 110 std::list<DecodeCB> held_decode_callbacks_; |
111 | 111 |
112 VideoDecoderConfig current_config_; | 112 VideoDecoderConfig current_config_; |
113 | 113 |
114 std::list<scoped_refptr<VideoFrame> > decoded_frames_; | 114 std::list<scoped_refptr<VideoFrame> > decoded_frames_; |
115 | 115 |
116 int total_bytes_decoded_; | 116 int total_bytes_decoded_; |
117 | 117 |
118 bool fail_to_initialize_; | 118 bool fail_to_initialize_; |
119 | 119 |
120 // NOTE: Weak pointers must be invalidated before all other member variables. | 120 // NOTE: Weak pointers must be invalidated before all other member variables. |
121 base::WeakPtrFactory<FakeVideoDecoder> weak_factory_; | 121 base::WeakPtrFactory<FakeVideoDecoder> weak_factory_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecoder); | 123 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecoder); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace media | 126 } // namespace media |
127 | 127 |
128 #endif // MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ | 128 #endif // MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ |
OLD | NEW |