Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: webrtc/media/base/testutils.h

Issue 2471783002: Revert of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/media/base/mediachannel.h ('k') | webrtc/media/base/testutils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
36 namespace cricket { 32 namespace cricket {
37 33
38 // Returns size of 420 image with rounding on chroma for odd sizes. 34 // Returns size of 420 image with rounding on chroma for odd sizes.
39 #define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2) 35 #define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2)
40 // Returns size of ARGB image. 36 // Returns size of ARGB image.
41 #define ARGB_SIZE(w, h) (w * h * 4) 37 #define ARGB_SIZE(w, h) (w * h * 4)
42 38
43 template <class T> inline std::vector<T> MakeVector(const T a[], size_t s) { 39 template <class T> inline std::vector<T> MakeVector(const T a[], size_t s) {
44 return std::vector<T>(a, a + s); 40 return std::vector<T>(a, a + s);
45 } 41 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 static const RawRtpPacket kTestRawRtpPackets[]; 108 static const RawRtpPacket kTestRawRtpPackets[];
113 static const RawRtcpPacket kTestRawRtcpPackets[]; 109 static const RawRtcpPacket kTestRawRtcpPackets[];
114 110
115 private: 111 private:
116 RtpTestUtility() {} 112 RtpTestUtility() {}
117 }; 113 };
118 114
119 // Test helper for testing VideoCapturer implementations. 115 // Test helper for testing VideoCapturer implementations.
120 class VideoCapturerListener 116 class VideoCapturerListener
121 : public sigslot::has_slots<>, 117 : public sigslot::has_slots<>,
122 public rtc::VideoSinkInterface<webrtc::VideoFrame> { 118 public rtc::VideoSinkInterface<cricket::VideoFrame> {
123 public: 119 public:
124 explicit VideoCapturerListener(VideoCapturer* cap); 120 explicit VideoCapturerListener(VideoCapturer* cap);
125 ~VideoCapturerListener(); 121 ~VideoCapturerListener();
126 122
127 CaptureState last_capture_state() const { return last_capture_state_; } 123 CaptureState last_capture_state() const { return last_capture_state_; }
128 int frame_count() const { return frame_count_; } 124 int frame_count() const { return frame_count_; }
129 int frame_width() const { return frame_width_; } 125 int frame_width() const { return frame_width_; }
130 int frame_height() const { return frame_height_; } 126 int frame_height() const { return frame_height_; }
131 bool resolution_changed() const { return resolution_changed_; } 127 bool resolution_changed() const { return resolution_changed_; }
132 128
133 void OnStateChange(VideoCapturer* capturer, CaptureState state); 129 void OnStateChange(VideoCapturer* capturer, CaptureState state);
134 void OnFrame(const webrtc::VideoFrame& frame) override; 130 void OnFrame(const VideoFrame& frame) override;
135 131
136 private: 132 private:
137 VideoCapturer* capturer_; 133 VideoCapturer* capturer_;
138 CaptureState last_capture_state_; 134 CaptureState last_capture_state_;
139 int frame_count_; 135 int frame_count_;
140 int frame_width_; 136 int frame_width_;
141 int frame_height_; 137 int frame_height_;
142 bool resolution_changed_; 138 bool resolution_changed_;
143 }; 139 };
144 140
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. 184 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|.
189 // The number of |rtx_ssrcs| must match number of |ssrcs|. 185 // The number of |rtx_ssrcs| must match number of |ssrcs|.
190 cricket::StreamParams CreateSimWithRtxStreamParams( 186 cricket::StreamParams CreateSimWithRtxStreamParams(
191 const std::string& cname, 187 const std::string& cname,
192 const std::vector<uint32_t>& ssrcs, 188 const std::vector<uint32_t>& ssrcs,
193 const std::vector<uint32_t>& rtx_ssrcs); 189 const std::vector<uint32_t>& rtx_ssrcs);
194 190
195 } // namespace cricket 191 } // namespace cricket
196 192
197 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ 193 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/mediachannel.h ('k') | webrtc/media/base/testutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698