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

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

Issue 2315663002: Make cricket::VideoFrame inherit webrtc::VideoFrame. (Closed)
Patch Set: Created 4 years, 3 months 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
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
11 #ifndef WEBRTC_MEDIA_BASE_TESTUTILS_H_ 11 #ifndef WEBRTC_MEDIA_BASE_TESTUTILS_H_
12 #define WEBRTC_MEDIA_BASE_TESTUTILS_H_ 12 #define WEBRTC_MEDIA_BASE_TESTUTILS_H_
13 13
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "libyuv/compare.h" 17 #include "libyuv/compare.h"
18 #include "webrtc/base/arraysize.h" 18 #include "webrtc/base/arraysize.h"
19 #include "webrtc/base/basictypes.h" 19 #include "webrtc/base/basictypes.h"
20 #include "webrtc/base/sigslot.h" 20 #include "webrtc/base/sigslot.h"
21 #include "webrtc/base/window.h" 21 #include "webrtc/base/window.h"
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 #include "webrtc/media/base/videoframe.h"
25 26
26 namespace rtc { 27 namespace rtc {
27 class ByteBufferReader; 28 class ByteBufferReader;
28 class ByteBufferWriter; 29 class ByteBufferWriter;
29 class StreamInterface; 30 class StreamInterface;
30 } 31 }
31 32
32 namespace cricket { 33 namespace cricket {
33 34
34 // Returns size of 420 image with rounding on chroma for odd sizes. 35 // 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) 36 #define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2)
36 // Returns size of ARGB image. 37 // Returns size of ARGB image.
37 #define ARGB_SIZE(w, h) (w * h * 4) 38 #define ARGB_SIZE(w, h) (w * h * 4)
38 39
39 template <class T> inline std::vector<T> MakeVector(const T a[], size_t s) { 40 template <class T> inline std::vector<T> MakeVector(const T a[], size_t s) {
40 return std::vector<T>(a, a + s); 41 return std::vector<T>(a, a + s);
41 } 42 }
42 #define MAKE_VECTOR(a) cricket::MakeVector(a, arraysize(a)) 43 #define MAKE_VECTOR(a) cricket::MakeVector(a, arraysize(a))
43 44
44 struct RtpDumpPacket; 45 struct RtpDumpPacket;
45 class RtpDumpWriter; 46 class RtpDumpWriter;
47 // TODO(nisse): For some reason, forward declaration doens't work when
48 // the definition is a "using" alias.
49 #if 0
46 class VideoFrame; 50 class VideoFrame;
47 51 #endif
48 struct RawRtpPacket { 52 struct RawRtpPacket {
49 void WriteToByteBuffer(uint32_t in_ssrc, rtc::ByteBufferWriter* buf) const; 53 void WriteToByteBuffer(uint32_t in_ssrc, rtc::ByteBufferWriter* buf) const;
50 bool ReadFromByteBuffer(rtc::ByteBufferReader* buf); 54 bool ReadFromByteBuffer(rtc::ByteBufferReader* buf);
51 // Check if this packet is the same as the specified packet except the 55 // Check if this packet is the same as the specified packet except the
52 // sequence number and timestamp, which should be the same as the specified 56 // sequence number and timestamp, which should be the same as the specified
53 // parameters. 57 // parameters.
54 bool SameExceptSeqNumTimestampSsrc(const RawRtpPacket& packet, 58 bool SameExceptSeqNumTimestampSsrc(const RawRtpPacket& packet,
55 uint16_t seq, 59 uint16_t seq,
56 uint32_t ts, 60 uint32_t ts,
57 uint32_t ssc) const; 61 uint32_t ssc) const;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. 189 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|.
186 // The number of |rtx_ssrcs| must match number of |ssrcs|. 190 // The number of |rtx_ssrcs| must match number of |ssrcs|.
187 cricket::StreamParams CreateSimWithRtxStreamParams( 191 cricket::StreamParams CreateSimWithRtxStreamParams(
188 const std::string& cname, 192 const std::string& cname,
189 const std::vector<uint32_t>& ssrcs, 193 const std::vector<uint32_t>& ssrcs,
190 const std::vector<uint32_t>& rtx_ssrcs); 194 const std::vector<uint32_t>& rtx_ssrcs);
191 195
192 } // namespace cricket 196 } // namespace cricket
193 197
194 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ 198 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698