OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 const std::vector<FrameType>* frame_types) override; | 95 const std::vector<FrameType>* frame_types) override; |
96 | 96 |
97 private: | 97 private: |
98 int delay_ms_ ACCESS_ON(sequence_checker_); | 98 int delay_ms_ ACCESS_ON(sequence_checker_); |
99 rtc::SequencedTaskChecker sequence_checker_; | 99 rtc::SequencedTaskChecker sequence_checker_; |
100 }; | 100 }; |
101 | 101 |
102 // This class implements a multi-threaded fake encoder by posting | 102 // This class implements a multi-threaded fake encoder by posting |
103 // FakeH264Encoder::Encode(.) tasks to |queue1_| and |queue2_|, in an | 103 // FakeH264Encoder::Encode(.) tasks to |queue1_| and |queue2_|, in an |
104 // alternating fashion. The class itself does not need to be thread safe, | 104 // alternating fashion. The class itself does not need to be thread safe, |
105 // as it is called from the task queue in ViEEncoder. | 105 // as it is called from the task queue in VideoStreamEncoder. |
106 class MultithreadedFakeH264Encoder : public test::FakeH264Encoder { | 106 class MultithreadedFakeH264Encoder : public test::FakeH264Encoder { |
107 public: | 107 public: |
108 explicit MultithreadedFakeH264Encoder(Clock* clock); | 108 explicit MultithreadedFakeH264Encoder(Clock* clock); |
109 virtual ~MultithreadedFakeH264Encoder() = default; | 109 virtual ~MultithreadedFakeH264Encoder() = default; |
110 | 110 |
111 int32_t InitEncode(const VideoCodec* config, | 111 int32_t InitEncode(const VideoCodec* config, |
112 int32_t number_of_cores, | 112 int32_t number_of_cores, |
113 size_t max_payload_size) override; | 113 size_t max_payload_size) override; |
114 | 114 |
115 int32_t Encode(const VideoFrame& input_image, | 115 int32_t Encode(const VideoFrame& input_image, |
(...skipping 12 matching lines...) Expand all Loading... |
128 int current_queue_ ACCESS_ON(sequence_checker_); | 128 int current_queue_ ACCESS_ON(sequence_checker_); |
129 std::unique_ptr<rtc::TaskQueue> queue1_ ACCESS_ON(sequence_checker_); | 129 std::unique_ptr<rtc::TaskQueue> queue1_ ACCESS_ON(sequence_checker_); |
130 std::unique_ptr<rtc::TaskQueue> queue2_ ACCESS_ON(sequence_checker_); | 130 std::unique_ptr<rtc::TaskQueue> queue2_ ACCESS_ON(sequence_checker_); |
131 rtc::SequencedTaskChecker sequence_checker_; | 131 rtc::SequencedTaskChecker sequence_checker_; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace test | 134 } // namespace test |
135 } // namespace webrtc | 135 } // namespace webrtc |
136 | 136 |
137 #endif // WEBRTC_TEST_FAKE_ENCODER_H_ | 137 #endif // WEBRTC_TEST_FAKE_ENCODER_H_ |
OLD | NEW |