blob: 1f2b381afb56ff5f15ef5c22055d1ecb97fc0201 [file] [log] [blame]
Niels Möller739fcb92016-02-29 13:11:45 +01001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef TEST_FRAME_UTILS_H_
11#define TEST_FRAME_UTILS_H_
Niels Möller739fcb92016-02-29 13:11:45 +010012
pbosc7c26a02017-01-02 08:42:32 -080013#include <stdint.h>
14
Mirko Bonadeid9708072019-01-25 20:26:48 +010015#include "api/scoped_refptr.h"
Artem Titov9b731592022-10-07 15:01:32 +020016#include "api/video/nv12_buffer.h"
Niels Möller739fcb92016-02-29 13:11:45 +010017
18namespace webrtc {
nisse115bd152016-09-30 04:14:07 -070019class I420Buffer;
Niels Möller739fcb92016-02-29 13:11:45 +010020class VideoFrame;
nisse7cc9cc02016-03-29 23:44:19 -070021class VideoFrameBuffer;
Niels Möller739fcb92016-02-29 13:11:45 +010022namespace test {
23
24bool EqualPlane(const uint8_t* data1,
25 const uint8_t* data2,
nisse26acec42016-04-15 03:43:39 -070026 int stride1,
27 int stride2,
Niels Möller739fcb92016-02-29 13:11:45 +010028 int width,
29 int height);
30
nisse26acec42016-04-15 03:43:39 -070031static inline bool EqualPlane(const uint8_t* data1,
32 const uint8_t* data2,
33 int stride,
34 int width,
35 int height) {
36 return EqualPlane(data1, data2, stride, stride, width, height);
37}
38
Niels Möller739fcb92016-02-29 13:11:45 +010039bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2);
40
nisse7cc9cc02016-03-29 23:44:19 -070041bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1,
42 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2);
43
Yves Gerey665174f2018-06-19 15:03:05 +020044rtc::scoped_refptr<I420Buffer> ReadI420Buffer(int width, int height, FILE*);
nisse115bd152016-09-30 04:14:07 -070045
Artem Titov9b731592022-10-07 15:01:32 +020046rtc::scoped_refptr<NV12Buffer> ReadNV12Buffer(int width, int height, FILE*);
47
Niels Möller739fcb92016-02-29 13:11:45 +010048} // namespace test
49} // namespace webrtc
50
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020051#endif // TEST_FRAME_UTILS_H_