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