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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Callback for updating |total_bytes_decoded_|. | 67 // Callback for updating |total_bytes_decoded_|. |
68 void OnFrameDecoded(int buffer_size, | 68 void OnFrameDecoded(int buffer_size, |
69 const DecodeCB& read_cb, | 69 const DecodeCB& read_cb, |
70 Status status, | 70 Status status, |
71 const scoped_refptr<VideoFrame>& video_frame); | 71 const scoped_refptr<VideoFrame>& video_frame); |
72 | 72 |
73 void DoReset(); | 73 void DoReset(); |
74 void DoStop(); | 74 void DoStop(); |
75 | 75 |
76 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 76 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
77 base::WeakPtrFactory<FakeVideoDecoder> weak_factory_; | |
78 base::WeakPtr<FakeVideoDecoder> weak_this_; | |
79 | 77 |
80 const int decoding_delay_; | 78 const int decoding_delay_; |
81 | 79 |
82 bool supports_get_decode_output_; | 80 bool supports_get_decode_output_; |
83 | 81 |
84 State state_; | 82 State state_; |
85 | 83 |
86 CallbackHolder<PipelineStatusCB> init_cb_; | 84 CallbackHolder<PipelineStatusCB> init_cb_; |
87 CallbackHolder<DecodeCB> decode_cb_; | 85 CallbackHolder<DecodeCB> decode_cb_; |
88 CallbackHolder<base::Closure> reset_cb_; | 86 CallbackHolder<base::Closure> reset_cb_; |
89 CallbackHolder<base::Closure> stop_cb_; | 87 CallbackHolder<base::Closure> stop_cb_; |
90 | 88 |
91 VideoDecoderConfig current_config_; | 89 VideoDecoderConfig current_config_; |
92 | 90 |
93 std::list<scoped_refptr<VideoFrame> > decoded_frames_; | 91 std::list<scoped_refptr<VideoFrame> > decoded_frames_; |
94 | 92 |
95 int total_bytes_decoded_; | 93 int total_bytes_decoded_; |
96 | 94 |
| 95 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 96 base::WeakPtrFactory<FakeVideoDecoder> weak_factory_; |
| 97 |
97 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecoder); | 98 DISALLOW_COPY_AND_ASSIGN(FakeVideoDecoder); |
98 }; | 99 }; |
99 | 100 |
100 } // namespace media | 101 } // namespace media |
101 | 102 |
102 #endif // MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ | 103 #endif // MEDIA_FILTERS_FAKE_VIDEO_DECODER_H_ |
OLD | NEW |