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 11 matching lines...) Expand all Loading... |
22 #include "webrtc/media/base/mediachannel.h" | 22 #include "webrtc/media/base/mediachannel.h" |
23 #include "webrtc/media/base/videocapturer.h" | 23 #include "webrtc/media/base/videocapturer.h" |
24 #include "webrtc/media/base/videocommon.h" | 24 #include "webrtc/media/base/videocommon.h" |
25 | 25 |
26 namespace rtc { | 26 namespace rtc { |
27 class ByteBufferReader; | 27 class ByteBufferReader; |
28 class ByteBufferWriter; | 28 class ByteBufferWriter; |
29 class StreamInterface; | 29 class StreamInterface; |
30 } | 30 } |
31 | 31 |
| 32 namespace webrtc { |
| 33 class VideoFrame; |
| 34 } |
| 35 |
32 namespace cricket { | 36 namespace cricket { |
33 | 37 |
34 // Returns size of 420 image with rounding on chroma for odd sizes. | 38 // Returns size of 420 image with rounding on chroma for odd sizes. |
35 #define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2) | 39 #define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2) |
36 // Returns size of ARGB image. | 40 // Returns size of ARGB image. |
37 #define ARGB_SIZE(w, h) (w * h * 4) | 41 #define ARGB_SIZE(w, h) (w * h * 4) |
38 | 42 |
39 template <class T> inline std::vector<T> MakeVector(const T a[], size_t s) { | 43 template <class T> inline std::vector<T> MakeVector(const T a[], size_t s) { |
40 return std::vector<T>(a, a + s); | 44 return std::vector<T>(a, a + s); |
41 } | 45 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 static const RawRtpPacket kTestRawRtpPackets[]; | 112 static const RawRtpPacket kTestRawRtpPackets[]; |
109 static const RawRtcpPacket kTestRawRtcpPackets[]; | 113 static const RawRtcpPacket kTestRawRtcpPackets[]; |
110 | 114 |
111 private: | 115 private: |
112 RtpTestUtility() {} | 116 RtpTestUtility() {} |
113 }; | 117 }; |
114 | 118 |
115 // Test helper for testing VideoCapturer implementations. | 119 // Test helper for testing VideoCapturer implementations. |
116 class VideoCapturerListener | 120 class VideoCapturerListener |
117 : public sigslot::has_slots<>, | 121 : public sigslot::has_slots<>, |
118 public rtc::VideoSinkInterface<cricket::VideoFrame> { | 122 public rtc::VideoSinkInterface<webrtc::VideoFrame> { |
119 public: | 123 public: |
120 explicit VideoCapturerListener(VideoCapturer* cap); | 124 explicit VideoCapturerListener(VideoCapturer* cap); |
121 ~VideoCapturerListener(); | 125 ~VideoCapturerListener(); |
122 | 126 |
123 CaptureState last_capture_state() const { return last_capture_state_; } | 127 CaptureState last_capture_state() const { return last_capture_state_; } |
124 int frame_count() const { return frame_count_; } | 128 int frame_count() const { return frame_count_; } |
125 int frame_width() const { return frame_width_; } | 129 int frame_width() const { return frame_width_; } |
126 int frame_height() const { return frame_height_; } | 130 int frame_height() const { return frame_height_; } |
127 bool resolution_changed() const { return resolution_changed_; } | 131 bool resolution_changed() const { return resolution_changed_; } |
128 | 132 |
129 void OnStateChange(VideoCapturer* capturer, CaptureState state); | 133 void OnStateChange(VideoCapturer* capturer, CaptureState state); |
130 void OnFrame(const VideoFrame& frame) override; | 134 void OnFrame(const webrtc::VideoFrame& frame) override; |
131 | 135 |
132 private: | 136 private: |
133 VideoCapturer* capturer_; | 137 VideoCapturer* capturer_; |
134 CaptureState last_capture_state_; | 138 CaptureState last_capture_state_; |
135 int frame_count_; | 139 int frame_count_; |
136 int frame_width_; | 140 int frame_width_; |
137 int frame_height_; | 141 int frame_height_; |
138 bool resolution_changed_; | 142 bool resolution_changed_; |
139 }; | 143 }; |
140 | 144 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. | 188 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. |
185 // The number of |rtx_ssrcs| must match number of |ssrcs|. | 189 // The number of |rtx_ssrcs| must match number of |ssrcs|. |
186 cricket::StreamParams CreateSimWithRtxStreamParams( | 190 cricket::StreamParams CreateSimWithRtxStreamParams( |
187 const std::string& cname, | 191 const std::string& cname, |
188 const std::vector<uint32_t>& ssrcs, | 192 const std::vector<uint32_t>& ssrcs, |
189 const std::vector<uint32_t>& rtx_ssrcs); | 193 const std::vector<uint32_t>& rtx_ssrcs); |
190 | 194 |
191 } // namespace cricket | 195 } // namespace cricket |
192 | 196 |
193 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ | 197 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ |
OLD | NEW |