1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10 #ifndef TEST_FRAME_UTILS_H_
11 #define TEST_FRAME_UTILS_H_
12
13 #include <stdint.h>
14
15 #include "api/scoped_refptr.h"
16
17 namespace webrtc {
18 class I420Buffer;
19 class VideoFrame;
20 class VideoFrameBuffer;
21 namespace test {
22
23 bool EqualPlane(const uint8_t* data1,
24 const uint8_t* data2,
25 int stride1,
26 int stride2,
27 int width,
28 int height);
29
EqualPlane(const uint8_t * data1,const uint8_t * data2,int stride,int width,int height)30 static inline bool EqualPlane(const uint8_t* data1,
31 const uint8_t* data2,
32 int stride,
33 int width,
34 int height) {
35 return EqualPlane(data1, data2, stride, stride, width, height);
36 }
37
38 bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2);
39
40 bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1,
41 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2);
42
43 rtc::scoped_refptr<I420Buffer> ReadI420Buffer(int width, int height, FILE*);
44
45 } // namespace test
46 } // namespace webrtc
47
48 #endif // TEST_FRAME_UTILS_H_
49