OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 static const uint32_t kDefaultTimeIncrease = 30; | 107 static const uint32_t kDefaultTimeIncrease = 30; |
108 static const uint32_t kElapsedTimeInterval = 10; | 108 static const uint32_t kElapsedTimeInterval = 10; |
109 static const RawRtpPacket kTestRawRtpPackets[]; | 109 static const RawRtpPacket kTestRawRtpPackets[]; |
110 static const RawRtcpPacket kTestRawRtcpPackets[]; | 110 static const RawRtcpPacket kTestRawRtcpPackets[]; |
111 | 111 |
112 private: | 112 private: |
113 RtpTestUtility() {} | 113 RtpTestUtility() {} |
114 }; | 114 }; |
115 | 115 |
116 // Test helper for testing VideoCapturer implementations. | 116 // Test helper for testing VideoCapturer implementations. |
117 class VideoCapturerListener : public sigslot::has_slots<> { | 117 class VideoCapturerListener |
| 118 : public sigslot::has_slots<>, |
| 119 public rtc::VideoSinkInterface<cricket::VideoFrame> { |
118 public: | 120 public: |
119 explicit VideoCapturerListener(VideoCapturer* cap); | 121 explicit VideoCapturerListener(VideoCapturer* cap); |
| 122 ~VideoCapturerListener(); |
120 | 123 |
121 CaptureState last_capture_state() const { return last_capture_state_; } | 124 CaptureState last_capture_state() const { return last_capture_state_; } |
122 int frame_count() const { return frame_count_; } | 125 int frame_count() const { return frame_count_; } |
123 uint32_t frame_fourcc() const { return frame_fourcc_; } | |
124 int frame_width() const { return frame_width_; } | 126 int frame_width() const { return frame_width_; } |
125 int frame_height() const { return frame_height_; } | 127 int frame_height() const { return frame_height_; } |
126 uint32_t frame_size() const { return frame_size_; } | |
127 bool resolution_changed() const { return resolution_changed_; } | 128 bool resolution_changed() const { return resolution_changed_; } |
128 | 129 |
129 void OnStateChange(VideoCapturer* capturer, CaptureState state); | 130 void OnStateChange(VideoCapturer* capturer, CaptureState state); |
130 void OnFrameCaptured(VideoCapturer* capturer, const CapturedFrame* frame); | 131 void OnFrame(const VideoFrame& frame) override; |
131 | 132 |
132 private: | 133 private: |
| 134 VideoCapturer* capturer_; |
133 CaptureState last_capture_state_; | 135 CaptureState last_capture_state_; |
134 int frame_count_; | 136 int frame_count_; |
135 uint32_t frame_fourcc_; | |
136 int frame_width_; | 137 int frame_width_; |
137 int frame_height_; | 138 int frame_height_; |
138 uint32_t frame_size_; | |
139 bool resolution_changed_; | 139 bool resolution_changed_; |
140 }; | 140 }; |
141 | 141 |
142 class ScreencastEventCatcher : public sigslot::has_slots<> { | 142 class ScreencastEventCatcher : public sigslot::has_slots<> { |
143 public: | 143 public: |
144 ScreencastEventCatcher() : ssrc_(0), ev_(rtc::WE_RESIZE) { } | 144 ScreencastEventCatcher() : ssrc_(0), ev_(rtc::WE_RESIZE) { } |
145 uint32_t ssrc() const { return ssrc_; } | 145 uint32_t ssrc() const { return ssrc_; } |
146 rtc::WindowEvent event() const { return ev_; } | 146 rtc::WindowEvent event() const { return ev_; } |
147 void OnEvent(uint32_t ssrc, rtc::WindowEvent ev) { | 147 void OnEvent(uint32_t ssrc, rtc::WindowEvent ev) { |
148 ssrc_ = ssrc; | 148 ssrc_ = ssrc; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. | 185 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. |
186 // The number of |rtx_ssrcs| must match number of |ssrcs|. | 186 // The number of |rtx_ssrcs| must match number of |ssrcs|. |
187 cricket::StreamParams CreateSimWithRtxStreamParams( | 187 cricket::StreamParams CreateSimWithRtxStreamParams( |
188 const std::string& cname, | 188 const std::string& cname, |
189 const std::vector<uint32_t>& ssrcs, | 189 const std::vector<uint32_t>& ssrcs, |
190 const std::vector<uint32_t>& rtx_ssrcs); | 190 const std::vector<uint32_t>& rtx_ssrcs); |
191 | 191 |
192 } // namespace cricket | 192 } // namespace cricket |
193 | 193 |
194 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ | 194 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ |
OLD | NEW |