Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 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 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 10 | #ifndef TEST_FRAME_UTILS_H_ |
| 11 | #define TEST_FRAME_UTILS_H_ |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 12 | |
pbos | c7c26a0 | 2017-01-02 08:42:32 -0800 | [diff] [blame] | 13 | #include <stdint.h> |
| 14 | |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 15 | #include "api/scoped_refptr.h" |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
nisse | 115bd15 | 2016-09-30 04:14:07 -0700 | [diff] [blame] | 18 | class I420Buffer; |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 19 | class VideoFrame; |
nisse | 7cc9cc0 | 2016-03-29 23:44:19 -0700 | [diff] [blame] | 20 | class VideoFrameBuffer; |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 21 | namespace test { |
| 22 | |
| 23 | bool EqualPlane(const uint8_t* data1, |
| 24 | const uint8_t* data2, |
nisse | 26acec4 | 2016-04-15 03:43:39 -0700 | [diff] [blame] | 25 | int stride1, |
| 26 | int stride2, |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 27 | int width, |
| 28 | int height); |
| 29 | |
nisse | 26acec4 | 2016-04-15 03:43:39 -0700 | [diff] [blame] | 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 | |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 38 | bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2); |
| 39 | |
nisse | 7cc9cc0 | 2016-03-29 23:44:19 -0700 | [diff] [blame] | 40 | bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1, |
| 41 | const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2); |
| 42 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 43 | rtc::scoped_refptr<I420Buffer> ReadI420Buffer(int width, int height, FILE*); |
nisse | 115bd15 | 2016-09-30 04:14:07 -0700 | [diff] [blame] | 44 | |
Niels Möller | 739fcb9 | 2016-02-29 13:11:45 +0100 | [diff] [blame] | 45 | } // namespace test |
| 46 | } // namespace webrtc |
| 47 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 48 | #endif // TEST_FRAME_UTILS_H_ |