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_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_ |
6 #define MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_ | 6 #define MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_ |
7 | 7 |
8 #include "media/video/video_encode_accelerator.h" | 8 #include "media/video/video_encode_accelerator.h" |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 27 matching lines...) Expand all Loading... |
38 bool force_keyframe) OVERRIDE; | 38 bool force_keyframe) OVERRIDE; |
39 | 39 |
40 virtual void UseOutputBitstreamBuffer(const BitstreamBuffer& buffer) OVERRIDE; | 40 virtual void UseOutputBitstreamBuffer(const BitstreamBuffer& buffer) OVERRIDE; |
41 | 41 |
42 virtual void RequestEncodingParametersChange(uint32 bitrate, | 42 virtual void RequestEncodingParametersChange(uint32 bitrate, |
43 uint32 framerate) OVERRIDE; | 43 uint32 framerate) OVERRIDE; |
44 | 44 |
45 virtual void Destroy() OVERRIDE; | 45 virtual void Destroy() OVERRIDE; |
46 | 46 |
47 void SendDummyFrameForTesting(bool key_frame); | 47 void SendDummyFrameForTesting(bool key_frame); |
| 48 void SetWillInitializationSucceed(bool will_initialization_succeed) { |
| 49 will_initialization_succeed_ = will_initialization_succeed; |
| 50 } |
48 | 51 |
49 private: | 52 private: |
50 void DoRequireBitstreamBuffers(unsigned int input_count, | 53 void DoRequireBitstreamBuffers(unsigned int input_count, |
51 const gfx::Size& input_coded_size, | 54 const gfx::Size& input_coded_size, |
52 size_t output_buffer_size) const; | 55 size_t output_buffer_size) const; |
53 void DoBitstreamBufferReady(int32 bitstream_buffer_id, | 56 void DoBitstreamBufferReady(int32 bitstream_buffer_id, |
54 size_t payload_size, | 57 size_t payload_size, |
55 bool key_frame) const; | 58 bool key_frame) const; |
56 | 59 |
57 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 60 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
58 std::vector<uint32>* const stored_bitrates_; | 61 std::vector<uint32>* const stored_bitrates_; |
59 VideoEncodeAccelerator::Client* client_; | 62 VideoEncodeAccelerator::Client* client_; |
60 bool first_; | 63 bool first_; |
| 64 bool will_initialization_succeed_; |
61 | 65 |
62 std::list<int32> available_buffer_ids_; | 66 std::list<int32> available_buffer_ids_; |
63 | 67 |
64 base::WeakPtrFactory<FakeVideoEncodeAccelerator> weak_this_factory_; | 68 base::WeakPtrFactory<FakeVideoEncodeAccelerator> weak_this_factory_; |
65 | 69 |
66 DISALLOW_COPY_AND_ASSIGN(FakeVideoEncodeAccelerator); | 70 DISALLOW_COPY_AND_ASSIGN(FakeVideoEncodeAccelerator); |
67 }; | 71 }; |
68 | 72 |
69 } // namespace test | 73 } // namespace test |
70 } // namespace cast | 74 } // namespace cast |
71 } // namespace media | 75 } // namespace media |
72 | 76 |
73 #endif // MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_ | 77 #endif // MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |